# Module install4j-api

This documentation specifies the public API that install4j provides for scripting installers
and uninstallers, developing extensions, and accessing runtime services.

## Getting started

Read the *API → installer API* chapter in the install4j documentation for an overview of how
to use the API. Packaging custom beans as install4j extensions is covered under
*API → Extensions*. The documentation ships under `doc` in the install4j installation directory
and can be displayed with **F1** in the install4j IDE.

To get started writing custom screens, actions, and form components, the *Custom code* example
project under `samples/customCode` in the install4j installation directory is the canonical
starting point.

## Classpath for framework classes

Add the install4j runtime to your *compile* classpath only — do not distribute it with your
application. install4j wires `i4jruntime.jar` onto the classpath automatically for installers
and for every generated launcher. The runtime is published to Maven Central:

**Maven**

```xml
<dependency>
    <groupId>com.install4j</groupId>
    <artifactId>install4j-runtime</artifactId>
    <version>13.0</version>
</dependency>
```

**Gradle**

```kotlin
dependencies {
    compileOnly("com.install4j:install4j-runtime:13.0")
}
```

If a Maven dependency isn't an option, the JAR ships under `resource/i4jruntime.jar` of the
install4j installation.

Some calls, for example `com.install4j.api.launcher.Variables.getCompilerVariable(...)`,
need the config file of an installation. Set the system property `install4j.runtimeDir` to the
`.install4j` directory of an installed copy of your project to make the config file resolvable.

## Extension points

install4j defines four extension points for custom code. Browse the per-package overviews:

- `com.install4j.api.screens` — installer screens
- `com.install4j.api.actions` — installer actions
- `com.install4j.api.formcomponents` — form components
- `com.install4j.api.styles` — screen styles

## Test API

The packages under `com.install4j.api.test` are the install4j Test API. This is a separate Maven
artifact (`com.install4j:install4j-test`) for writing automated UI tests that drive an actual
installer UI from inside a test JVM. Start with `com.install4j.api.test` for the overview, then
drill into:

- `com.install4j.api.test.session` — session builders and the `Session` interface family
- `com.install4j.api.test.ui` — screen and dialog handles
- `com.install4j.api.test.formcomponents` — typed handles for every install4j form component
