Elevation (install4j API)
Description: declaration: package: com.install4j.api.windows, class: Elevation

Package com.install4j.api.windows

# Class Elevation

java.lang.Object
com.install4j.api.windows.Elevation

public class Elevation extends Object
Collection of methods regarding the UAC elevation state on Windows Vista or higher.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static boolean`
  `executeElevated(File executable, String parameters, File directory)`
  Runs an executable in the elevated state.
  `static ElevationState`
  `getElevationState()`
  Returns the elevation state of the current process.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getElevationState

    public static ElevationState getElevationState()
    Returns the elevation state of the current process.
    Returns:
      the elevation state or `null` if not called on Windows.

  - ### executeElevated

    public static boolean executeElevated(File executable, String parameters, File directory)
    Runs an executable in the elevated state. Blocks until all UAC dialogs have been answered.
    Parameters:
      `executable` - the executable
      `parameters` - parameters passed to the executable. Can be `null`.
      `directory` - The working directory for the process. If `null` the current working directory is used.
    Returns:
      false if the process cannot be started. Includes a canceled UAC request.