Installer - Custom Code

## Installer - Custom Code |

| Custom code is used for specifying additional libraries that can be used in scripts and expressions of screens, actions and form components. developing new types of actions, screens or form components with the install4j API. Please see the for more information. Before you start to develop a new action, please have a look at the available actions and screens. If it's just a few lines of code, you can use the "Run script" action to enter them directly into install4j. If you would like to collect user input, most use cases can be solved with a "Configurable form" screen.

| In the [Custom code] section you can specify the location of your custom code. The following custom code location types are available: Class or resource files Directories Archives All classes used by your custom code have to be included in these locations (except for Java runtime classes and install4j framework classes). The control buttons allow you to modify the contents of the list of custom code locations, the [Add] button displays the custom code entry dialog. After you have chosen your custom code locations, you will be able to select your own screens, actions and form components.

| By default, all custom code is packaged separately into the installer. If your custom code uses the same libraries as your installed launchers (such as a database driver), these libraries are duplicated, increasing the size of your installer. If you would like to avoid this duplication you can select the "use installed JAR files where possible" check box. In that case, the install4j compiler checks if a custom code JAR file location is equal to a JAR file that was packaged in the distribution tree and doesn't package it again. Note: The installed JAR files will be available only after the "Install files" action has run. All your custom code that depends on these JAR files must be placed after the "Install files" action, otherwise a runtime error will occur. If you use installation components, these libraries should be part of a mandatory component. The "use installed JAR files where possible" option changes the initialization strategy of the installer. If selected, the installer initialized screens and actions up to the "Install files" action at startup and the rest after the "Install files" action has run. If not selected, all screens and actions are initialized at startup.