UninstallerSessionBuilder (install4j API)
Description: declaration: package: com.install4j.api.test.session, class: UninstallerSessionBuilder

# Class UninstallerSessionBuilder

java.lang.Object
com.install4j.api.test.session.AbstractSessionBuilder
com.install4j.api.test.session.InstallationDirectorySessionBuilder
com.install4j.api.test.session.UninstallerSessionBuilder

public final class UninstallerSessionBuilder extends InstallationDirectorySessionBuilder
Builds and starts an `UninstallerSession` for an installed uninstaller.

    try (UninstallerSession session = UninstallerSessionBuilder
            .forInstallation(installedDir)
            .start()) {
        session.currentScreen().clickNext();
        session.waitForScreenId("uninstallFinished");
        session.currentScreen().clickFinish();
    }

## Kotlin extensions

`SessionExtensions.kt` in this package adds `useSession { ... }` as a Kotlin inline extension: it calls `start()`, runs the trailing lambda on the resulting `UninstallerSession` as `this`, and closes the session afterwards.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `UninstallerSessionBuilder`
  `arg(String... args)`
  Additional command-line arguments passed to the installer application.
  `UninstallerSessionBuilder`
  `debug(boolean debug)`
  Switch the session to in-process debug mode.
  `static UninstallerSessionBuilder`
  `forInstallation(File installationDirectory)`
  Create a builder for the given installation directory containing a previously installed install4j uninstaller.
  `UninstallerSessionBuilder`
  `logFile(File logFile)`
  Redirect install4j's runtime logger output to the given file.
  `UninstallerSession`
  `start()`
  Start the installer application and return the typed session handle.
  `UninstallerSessionBuilder`
  `systemProperty(String key, String value)`
  Set a system property on the test JVM before the installer starts.
  `UninstallerSessionBuilder`
  `timeout(Duration d)`
  Default timeout applied to every wait operation.
  `UninstallerSessionBuilder`
  `workingDirectory(File dir)`
  Working directory for the running installer application.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### forInstallation

    @NotNull public static UninstallerSessionBuilder forInstallation(@NotNull File installationDirectory)
    Create a builder for the given installation directory containing a previously installed install4j uninstaller. The directory is the installation target chosen for the corresponding installer run.

  - ### timeout

    @NotNull public UninstallerSessionBuilder timeout(@NotNull Duration d)
    Description copied from class: `AbstractSessionBuilder`
    Default timeout applied to every wait operation. The default is 3 minutes. Override per session for longer installations.
    Overrides:
      `timeout` in class `AbstractSessionBuilder`

  - ### arg

    @NotNull public UninstallerSessionBuilder arg(@NotNull String... args)
    Description copied from class: `AbstractSessionBuilder`
    Additional command-line arguments passed to the installer application.
    Overrides:
      `arg` in class `AbstractSessionBuilder`

  - ### systemProperty

    @NotNull public UninstallerSessionBuilder systemProperty(@NotNull String key, @NotNull String value)
    Description copied from class: `AbstractSessionBuilder`
    Set a system property on the test JVM before the installer starts.
    Overrides:
      `systemProperty` in class `AbstractSessionBuilder`

  - ### workingDirectory

    @NotNull public UninstallerSessionBuilder workingDirectory(@NotNull File dir)
    Description copied from class: `AbstractSessionBuilder`
    Working directory for the running installer application.
    Overrides:
      `workingDirectory` in class `AbstractSessionBuilder`

  - ### logFile

    @NotNull public UninstallerSessionBuilder logFile(@NotNull File logFile)
    Description copied from class: `AbstractSessionBuilder`
    Redirect install4j's runtime logger output to the given file.
    Overrides:
      `logFile` in class `AbstractSessionBuilder`

  - ### debug

    @NotNull public UninstallerSessionBuilder debug(boolean debug)
    Description copied from class: `AbstractSessionBuilder`
    Switch the session to in-process debug mode. By default the test API spawns the produced installer media as a real subprocess (with its bundled JRE, native launcher, and the full extraction code path) and drives it over IPC. In debug mode it runs the installer in the test JVM directly, which is faster but requires an `install4jc -g` debug build to exist alongside the media file. Use debug mode locally during development; leave it off for CI runs that should exercise the real installer.
    Overrides:
      `debug` in class `AbstractSessionBuilder`

  - ### start

    @NotNull public UninstallerSession start()
    Description copied from class: `AbstractSessionBuilder`
    Start the installer application and return the typed session handle.
    Specified by:
      `start` in class `AbstractSessionBuilder`