public class PrivilegedRunner extends Object
| Constructor and Description |
|---|
PrivilegedRunner(Platform platform)
Builds a default privileged runner.
|
| Modifier and Type | Method and Description |
|---|---|
protected File |
extractMacElevator() |
protected File |
extractVistaElevator() |
protected List<String> |
getElevator(String javaCommand,
String installer,
String[] args) |
boolean |
hasCorrectPermissions(Info info,
RulesEngine rules)
Check if user has correct permissions to use the installer.
|
boolean |
isAdminUser()
Determine if user has administrative privileges.
|
boolean |
isElevationNeeded()
Determines if elevated rights are required to install/uninstall the application.
|
boolean |
isElevationNeeded(String path)
Determines if elevated rights are required to install/uninstall the application.
|
boolean |
isPlatformSupported()
Checks if the current platform is supported.
|
static boolean |
isPrivilegedMode() |
int |
relaunchWithElevatedRights()
Relaunches the installer with elevated rights.
|
int |
relaunchWithElevatedRights(String... args) |
public PrivilegedRunner(Platform platform)
platform - the current platformpublic boolean isPlatformSupported()
true if the platform is supported, false otherwise.public boolean isElevationNeeded()
true if elevation is needed to have administrator permissions, false otherwise.public boolean isElevationNeeded(String path)
path - the installation path, or null if the installation path is unknownpublic boolean isAdminUser()
public boolean hasCorrectPermissions(Info info, RulesEngine rules)
info - rules - public int relaunchWithElevatedRights()
throws Exception
IOException - if an I/O error occursInterruptedException - if the launch was interruptedExceptionpublic int relaunchWithElevatedRights(String... args) throws Exception
Exceptionpublic static boolean isPrivilegedMode()
protected List<String> getElevator(String javaCommand, String installer, String[] args) throws IOException
IOExceptionprotected File extractVistaElevator() throws IOException
IOExceptionprotected File extractMacElevator() throws IOException
IOExceptionCopyright © 2001–2025. All rights reserved.