# UninstallerSessionBuilder

Import: `import com.install4j.api.test.session.UninstallerSessionBuilder;`

```java
public final class UninstallerSessionBuilder extends InstallationDirectorySessionBuilder
```

Builds and starts an [`UninstallerSession`](UninstallerSession.md) 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 [`UninstallerSessionBuilder.start`](UninstallerSessionBuilder.md#start), runs the trailing lambda on the resulting
[`UninstallerSession`](UninstallerSession.md) as `this`, and closes the session afterwards.

## Inherited from

- [AbstractSessionBuilder](AbstractSessionBuilder.md) — 7 methods

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`forInstallation(File)`](#forinstallation-file) | `UninstallerSessionBuilder` | Create a builder for the given installation directory containing a previously installed install4j uninstaller. |
| [`timeout(Duration)`](#timeout-duration) | `UninstallerSessionBuilder` |  |
| [`arg(String[])`](#arg-string) | `UninstallerSessionBuilder` |  |
| [`systemProperty(String, String)`](#systemproperty-string-string) | `UninstallerSessionBuilder` |  |
| [`workingDirectory(File)`](#workingdirectory-file) | `UninstallerSessionBuilder` |  |
| [`logFile(File)`](#logfile-file) | `UninstallerSessionBuilder` |  |
| [`debug(boolean)`](#debug-boolean) | `UninstallerSessionBuilder` |  |
| [`start()`](#start) | `UninstallerSession` |  |

### forInstallation(File)

```java
public static UninstallerSessionBuilder forInstallation(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(Duration)

```java
public UninstallerSessionBuilder timeout(Duration d)
```

### arg(String[])

```java
public UninstallerSessionBuilder arg(String... args)
```

### systemProperty(String, String)

```java
public UninstallerSessionBuilder systemProperty(String key, String value)
```

### workingDirectory(File)

```java
public UninstallerSessionBuilder workingDirectory(File dir)
```

### logFile(File)

```java
public UninstallerSessionBuilder logFile(File logFile)
```

### debug(boolean)

```java
public UninstallerSessionBuilder debug(boolean debug)
```

### start()

```java
public UninstallerSession start()
```

