# InstallerApplicationSessionBuilder

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

```java
public final class InstallerApplicationSessionBuilder extends InstallationDirectorySessionBuilder
```

Builds and starts an [`InstallerApplicationSession`](InstallerApplicationSession.md) for a custom installer application.

```
try (InstallerApplicationSession session = InstallerApplicationSessionBuilder
        .forInstallation(installedDir)
        .applicationId("licenseRenewal")
        .start()) {
    session.currentScreen().clickNext();
    ...
}
```

The installer and uninstaller have their own builders, see [`InstallerSessionBuilder`](InstallerSessionBuilder.md)
and [`UninstallerSessionBuilder`](UninstallerSessionBuilder.md).

Kotlin extensions

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

## Inherited from

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

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`forInstallation(File)`](#forinstallation-file) | `InstallerApplicationSessionBuilder` | Create a builder for the given installation directory. |
| [`applicationId(String)`](#applicationid-string) | `InstallerApplicationSessionBuilder` | The application id of the installer application to drive. |
| [`timeout(Duration)`](#timeout-duration) | `InstallerApplicationSessionBuilder` |  |
| [`arg(String[])`](#arg-string) | `InstallerApplicationSessionBuilder` |  |
| [`systemProperty(String, String)`](#systemproperty-string-string) | `InstallerApplicationSessionBuilder` |  |
| [`workingDirectory(File)`](#workingdirectory-file) | `InstallerApplicationSessionBuilder` |  |
| [`logFile(File)`](#logfile-file) | `InstallerApplicationSessionBuilder` |  |
| [`debug(boolean)`](#debug-boolean) | `InstallerApplicationSessionBuilder` |  |
| [`start()`](#start) | `InstallerApplicationSession` |  |

### forInstallation(File)

```java
public static InstallerApplicationSessionBuilder forInstallation(File installationDirectory)
```

Create a builder for the given installation directory. Pair with
[`InstallerApplicationSessionBuilder.applicationId`](InstallerApplicationSessionBuilder.md#applicationid-string) to choose the installer application to drive.

### applicationId(String)

```java
public InstallerApplicationSessionBuilder applicationId(String id)
```

The application id of the installer application to drive. Required.

### timeout(Duration)

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

### arg(String[])

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

### systemProperty(String, String)

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

### workingDirectory(File)

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

### logFile(File)

```java
public InstallerApplicationSessionBuilder logFile(File logFile)
```

### debug(boolean)

```java
public InstallerApplicationSessionBuilder debug(boolean debug)
```

### start()

```java
public InstallerApplicationSession start()
```

