|
install4j API | ||||||||
| PREV NEXT | FRAMES NO FRAMES | ||||||||
See:
Description
| Packages | |
|---|---|
| com.install4j.api | This package contains classes that can be used to develop custom actions and custom screens for install4j installers. |
| com.install4j.api.launcher | This package contains classes that can be user in your launcher to use services provided by install4j. |
| com.install4j.api.windows | This package contains classes with static utility methods for accessing Windows system services. |
This documentation specifies the public API that install4j provides for runtime services and installer customization.
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.
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.
To test and debug custom screens and custom actions for your installer you can follow this procedure:
The debug directories contain
They start the installer and the uninstaller with a plain java invocation. All exceptions are directly printed to stderr and no separate error log files are created.
The file user.jar in the debug directory contains all your custom code. For interactive development you will not want to rebuild the project after each modification of your custom code. You can set up the installer or the uninstaller in your IDE by
Note: The working directory for the executed java process must be the the debug directory, otherwise both the installer as well as the uninstaller will not work!
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.
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.
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.
|
install4j API | ||||||||
| PREV NEXT | FRAMES NO FRAMES | ||||||||