install4j API documentation

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

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

Gradle

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
Packages
Package
Description
This package contains general utility classes for the install4j API.
This package contains the interfaces and abstract base classes for actions.
This package contains the utility classes for writing BeanInfo classes for screens, actions, and form components.
This package contains the base classes for all extension points in install4j as well as special property classes.
This package contains classes that allow you to interact with the installer and its environment.
This package contains classes that allow you to listen for events generated by the installer.
This package contains the interface and abstract base class for form components.
This package contains interfaces that are concerned with the look and feel of installer applications.
This package contains classes that your own application code can use to access runtime services provided by install4j.
This package contains classes with static utility methods for using macOS-specific features that are not directly supported by the Java platform.
This package contains the interfaces and abstract base classes for screens.
This package contains the interface and abstract base class for styles.
The install4j Test API.
Typed unchecked exceptions thrown by the test API for specific failure categories.
Typed handles for every form component.
Session builders and the Session interface family.
Handles for wizard screens and modal dialogs.
This package contains classes with static utility methods for using Unix-specific features that are not directly supported by the Java platform.
This package contains classes that help you to handle auto-updates.
This package contains classes with static utility methods for using Windows-specific features that are not directly supported by the Java platform.
This package contains classes to manipulate Windows services.