|
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 help topic on using the API 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.
An alternative way of adding your beans to the install4j is packaging them as an
extension. In that case, you can select them
directly from the standard registry dialogs instead of having to go through the "Search in custom code"
menu entries when adding beans to the installer.
-
including resource files into the installer. Resource files are arbitrary files like DLLs, external executables or
text files that have to be available before the "Install files" action has run.
While all class files are packed into a single
user.jar file, archives and resource file are extracted
to the user subdirectory in the working directory of the installer. You can access a resource file with the
following expression:
new File("user", "[file name]")
For example, if you have added a native library jni.dll to your custom code, you can load it
in a "Run script" action by calling
System.load(new File("user", "jni.dll").getPath());
|