Package com.install4j.api.windows
Class Elevation
- java.lang.Object
-
- com.install4j.api.windows.Elevation
-
public class Elevation extends java.lang.ObjectCollection of methods regarding the UAC elevation state on Windows Vista or higher.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanexecuteElevated(java.io.File executable, java.lang.String parameters, java.io.File directory)Runs an executable in elevated state.static ElevationStategetElevationState()Returns the elevation state of the current process.
-
-
-
Method Detail
-
getElevationState
public static ElevationState getElevationState()
Returns the elevation state of the current process.- Returns:
- the elevation state or
nullif not called on Windows.
-
executeElevated
public static boolean executeElevated(java.io.File executable, java.lang.String parameters, java.io.File directory)Runs an executable in 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 cancelled UAC request.
-
-