Package com.install4j.api.windows
Class Elevation
java.lang.Object
com.install4j.api.windows.Elevation
Collection of methods regarding the UAC elevation state on Windows Vista or higher.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanexecuteElevated(File executable, String parameters, File directory) Runs an executable in the elevated state.static ElevationStateReturns the elevation state of the current process.
-
Method Details
-
getElevationState
Returns the elevation state of the current process.- Returns:
- the elevation state or
nullif not called on Windows.
-
executeElevated
Runs an executable in the elevated state. Blocks until all UAC dialogs have been answered.- Parameters:
executable- the executableparameters- parameters passed to the executable. Can benull.directory- The working directory for the process. Ifnullthe current working directory is used.- Returns:
- false if the process cannot be started. Includes a canceled UAC request.
-