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.

...

Using System Properties As Variables

System properties given on the command line can be directly included as IzPack variables when using the SYSTEM_ prefix followed by the system property name in the variable name, and substituting alls occurences of '.' by '_'.

Examples:

  • java.version would be available as $SYSTEM_java_version
  • os.name would be available as $SYSTEM_os_name

No substitution are directly assigned to variables using the following syntax, provided the system property is variable.name:

  • IzPack 5.0 and later:

    ${SYSTEM[variable.name]}

    More examples:
     
Code Block
titleExample 1
languagexml
<variables>
  <variable name="featureEnabled" value="${SYSTEM[feature.Enabled]}" />
</variables>

<conditions>
  <condition type="variable" id="isFeatureEnabled">
    <name>featureEnabled</name>
    <value>true</value>
  </condition>
</conditions>

 is equivalent to:

Code Block
titleExample 2
languagexml
<conditions>
  <condition type="variable" id="isFeatureEnabled">
    <name>SYSTEM[feature.Enabled]</name>
    <value>true</value>
  </condition>
</conditions>

 

  • IzPack 4 and earlier (obsolete handling in IzPack 5.0 for backward compatibility):

    ${SYSTEM_variable_name}

    More examples:
Code Block
titleExample 1
languagexml
<variables>
  <variable name="featureEnabled" value="${SYSTEM_feature_Enabled}" />
</variables>

<conditions>
  <condition type="variable" id="isFeatureEnabled">
    <name>featureEnabled</name>
    <value>true</value>
  </condition>
</conditions>

 is equivalent to:

Code Block
titleExample 2
languagexml
<conditions>
  <condition type="variable" id="isFeatureEnabled">
    <name>SYSTEM_featureEnabled</name>
    <value>true</value>
  </condition>
</conditions>

For Izpack before 5.0.0-rc2, no substitution happens if the specified system variable cannot be found in the execution environment. This means that the string ${SYSTEM_java_version} gets inserted into the output as a literal string, instead of being replaced by the value of the java.version environment variable.