Java Code Dialog | ![]() ![]() |
![]() |
The box above the edit area show the available parameters for the Java code property as well
as the return type. To get more information on classes from the com.install4j.* packages,
please see the install4j API javadoc and the
help topic for the install4j API.
A number of packages can be used with using fully-qualified class names. Those packages are:
You can put a number of import statements as the first lines in the text area in order to avoid using fully qualified class names. |
![]() |
Java code properties can be
|
![]() |
The primary interface to interact with the installer or uninstaller is the context which is always among
the available parameters. The context provides information about the current installation and gives access to
variables, screens, actions and other elements of the installation or uninstallation. The parameter is of
type
Apart from the context, the action, screen or form component to which the Java code property belongs is among the available parameters. If you know the actual class, you can cast to it and modify the object as needed. |
![]() |
In order to display an error, warning or debug message, or to ask the user a question, please use the following
methods in the install4j API:
The |
![]() |
Screens, actions and form components are wired together with installer variables, please see the
help topic on screens and actions for more
information. Setting and getting installer variables is done through the context parameter with the
context.getVariable(String variableName) and
context.setVariable(String variableName, Object value) methods. The convenience method
context.getBooleanVariable(String variableName) makes it easier to check conditions.
Any object can be used as the value for a variable. To use installer variables in text properties
of actions, screens and form components, write them as ${installer:myVariableName} .
|
![]() |
It is advisable to test your expression or script after you change it. The
![]() |
![]() ![]() |