We need you!

Icon

The IzPack documentation needs work, and you are invited to edit it!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added catch/final job docs.

...

Code Block
languagehtml/xml
<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>

Each <job> may have the following attributes an <os> attribute.:

AttributeDefaultDescriptionMandatory
name
(not set)IzPack condition ID for running the jobyes
condition
(not set)IzPack condition ID for running the jobno
catchfalseJob runs only in the event of other jobs failingno
finalfalseJob runs always, whether previous jobs succeed or notno

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 this event, any jobs marked with the 'catch' attribute will run. 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

...

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 supports variable substitution, for example: <env>MY_PRODUCT_HOME=$INSTALL_PATH</env>.  The 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.

...

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

...