Installer
Uninstaller
The uninstaller is a special application for uninstalling an installation. It is used in various contexts:
The uninstaller cannot be deleted from the tree of installer elements. If you do not wish to generate an uninstaller, you can disable it.
Custom installer application
You can add new custom installer application by clicking on the
[Add]
button on the right side of the list and choosing Add Application from the popup.
The application templates dialog
will be displayed and lets you choose a starting point for your custom installer application.
Application templates are entirely made up of existing screens, actions and form components.
You can modify the selected application template after adding it.
Unlike the installer and uninstaller above, custom applications are also created for archive media files. Please see the help topic on screens and actions for more information on how to create first-run installers for archives.
Custom installer applications with a non-empty "executable directory" property are automatically added to the "Default file set". Unlike launchers, they cannot be assigned to specific file sets. If your installation components do no include the root of the default file set, you have to select the custom installer applications explicitly in the installation component configuration. If the custom installer application is added to the .install4j directory by leaving the executable directory empty, they will always be included.
Installer |
||||
|
||||
Uninstaller |
||||
|
||||
Custom application |
||||
|
||||
An additional feature with respect to the variable selection dialog is that you can navigate to a binding by selecting an element in the binding tree at the bottom and click on the [Go To Selection] button.
The first way to start an installer application is programmatically, by using the API contained in [install4j installation directory]/resource/i4jruntime.jar. To get the code snippet for starting the selected installer application, click on the [Start integration wizard] button. The integration wizard will present a number of options that control the condition and possible call backs from the installer application. Note that you do not have to distribute i4jruntime.jar, since it is automatically available for installed applications.
The second way to start an installer application is automatically, by defining a launch schedule and a launch mode. The launch schedule is one of
com.install4j.api.update.UpdateScheduleRegistry in the API. The
selected installer application will be started only if the update schedule requires an update check.
In your launcher, you can check for this condition with Boolean.getBoolean("install4j.firstRun")
in case you want to perform some actions outside of a custom installer application.
The launch mode is one of
Just like with the API, the installer application can be started in the launcher process itself or in a new process. By default, the installer application is started in the same process. If the "Blocking at start up" or "Non-blocking at start up" launch modes are selected, the look and feel it set to the system look and feel. For the "When first window is shown" launch mode, the look and feel is not changed, so your own look and feel will be used. When the installer application is executed in the same process, the "Shutdown calling launcher" action has a different effect: The whole process will be terminated when the installer application exits. Furthermore, the "Request privileges" action only works for elevating a helper process, not the main process in this case.
By default, the selected installer application is started for all launchers in your project. If this is not desired, you can restrict the integration to selected launchers. Note that if "All launchers" is selected and the project is merged into another project, the integration will be performed for all launchers in the main project as well.