This panel allows you to execute arbitrary files after installation.
You may also want to refer to the specific example of Executing a Java Class with ProcessPanel for a discussion of of a particular use case for the ProcessPanel.
ProcessPanel Specification File
The details for the compilation execution process are specified using the resource
<processing> <job name="do xyz"> <os family="windows" /> <executefile name="$INSTALL_PATH/scripts/xyz.bat" workingDir="$INSTALL_PATH"> <arg>doit</arg><arg>$variable</arg> </executefile> </job> <job name="do xyz"> <os family="unix" /> <executefile name="$INSTALL_PATH/scripts/xyz.sh"> <arg>doit</arg><arg>$variable</arg> </executefile> </job> <job name="run on failure" catch="true"> <os family="unix" /> <executefile name="$INSTALL_PATH/scripts/run_on_fail.sh"> <arg>doit</arg><arg>$variable</arg> </executefile> </job> <job name="run always" final="true"> <os family="unix" /> <executefile name="$INSTALL_PATH/scripts/run_always.sh"> <arg>doit</arg><arg>$variable</arg> </executefile> </job> </processing>
<job> may have the following attributes an and an
|(not set)||IzPack condition ID for running the name given to the step the job||yes|
|(not set)||IzPack condition ID for running the job||no|
|catch||false||Job runs only in the event of other jobs failing||no|
|final||false||Job runs always, whether previous jobs succeed or not||no|
Catch and Final jobs
The 'catch' and 'final' attributes for a process panel job are used to create a try/catch/final structure for your processes. If a standard job (one without catch or final) fails, the process panel will skip the remaining jobs and exit with a failure.
In the event of a failure of a normal job, any jobs marked with the 'catch' attribute will run.
If a job fails and there is no 'catch' job, the process panel will skip the remaining jobs and exit with a failure.
The jobs marked with the 'final' attributes will always run regardless of success or failure.
In the example above, the "run on failure" job is only run if one of the "do xyz" jobs fails. The "run always" job is always run regardless of whether there is a previous failure or not.
Nested elements to <job>
<os> - Limit Job Execution Environment
<executeFile>- Execute Shell Scripts
In addition to
<arg> elements, the
<executefile> element also accepts
<env> elements to set variables in the environment of the target process. This can be useful if this process requires some environment variables, such as its installation directory, to work properly. An
<env> element has the following syntax:
<env>variable=value</env>. Note the value element supports variable substitution, for example:
The workingDir attribute for the
<executefile> element adds the ability to set the working directory of the process spawned by the ProcessBuilder object, much as <env> elements refer to the environment object of ProcessBuilder.
The ProcessPanel now also supports configurable behaviour for the panel's "Previous" and "Next" buttons. By adding
<onSuccess> childs children to the
<processing> element, you can define which buttons you want unlocked in case of failure and in case of success, respectively.
It is also possible to execute Java classes from this panel. Here's what this feature's author (Alex Bradley) says:
To use the executeclass facility, you will need to create a jar file with your class and then add it to the installer with the `The Jar Merging Element`.
See Executing a Java Class with ProcessPanel for details.
<executeForPack> - Only execute the job for certain packs
<logfiledir> - Output of the processPanel saved to a log
New with version 3.7 is the possibility to tee output Output that is written to the ProcessPanel's textarea into can be duplicated in an optional logfile. Using this feature is pretty much straightforward, you only have to add a line in Add a
<logfiledir> element to the <processing> element of the
ProcessPanel.Spec.xml that will to tell IzPack the location, where the logfile should be stored.
Variable substitution is performed, so you can use
$INSTALL_PATH as for example.
The name of the logfile is not (yet) configurable but should fit in most cases. It will be namedInstallnamed Install_V<$APP_VER><YYYY><MM><DD><hh><mm><ss>_<RandomId>.log
Here's an example:
ProcessPanelWorker will write all output that is directed to
stderr to this file if
ProcessPanel.Spec.xml contains the
Please note that this one the same file is used for storing the complete output of all jobs and not a file for each job that is run.