This documentation specifies the public API that install4j provides for runtime services and installer customization.

Getting started

To get started with writing custom actions and custom screens, please have a look at the Hello World Suite example project that is located in the demo subdirectory of your install4j installation. Source code for custom actions can be found in demo/actions, source code for custom screens is located in demo/screens (enterprise edition only). Both custom actions and custom screens are compiled and packaged as a JAR file in demo/custom.jar.

Classpath for framework classes

When developing our own classes, include {install4j installation directory}/resource/i4jruntime.jar in your classpath. Do not distribute this jar file with your application, install4j will handle this for you. i4jruntime.jar will be available on the classpath for custom screens and custom actions in the installer as well as for all launchers generated by install4j.

Testing and debugging

To test and debug custom screens and custom actions for your installer you can follow this procedure:

This procedure allows for an edit-compile-debug cycle that is much faster than building the media file and running the installer. In addition, output on stderr and stdout can be captured and you can debug your custom actions and custom screens this way.

Notes on custom install actions

Custom install actions are the most important and most common extension available in the install4j API. Custom install actions are derived from com.install4j.api.InstallAction. You have to override all appropriate methods. The performAction() method is where you do the actual work.

Internationalization

Custom actions and custom screens can be localized with the standard Java ResourceBundle mechanism (see the Java API Javadoc for java.util.ResourceBundle for further information).

The locale of the installer will always be set to the locale that is specified for the media set, not the locale of the system that the installer is running on. You can query com.install4j.api.Util.getInstallerLanguage() to find out what locale your installer is runnning with.