Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Other variables and dynamic variables can be used withing ${ and } to be replaced in the assignment expressions below.

The attribute checkonce[ = "true"|"false"] might be added to assign a dynamic variable only one time at the beginning of the installation process, which makes it behave as a normal variable, although with enhanced capabilities to gather a value.

The attribute ignorefailure[ = "true"|"false"] might be used to allow the installation to continue or abort if an error occurred during gathering the value for a certain dynamic variable.

The assignment of a dynamic variable itself can be made dependent on a certain condition, using the condition attribute, which refers to the ID of condition defined in the installer description elsewhere.

Types of Dynamic Variable Assignments

...

Code Block
langxml
titleFiltering dynamic variable assignments using regular expressions
<dynamicvariables>

    <variable name="previous.version" jarfile="${INSTALL_PATH}/${INSTALL_SUBPATH}/libs/config.jar"
              entry="release.properties" type="options"
              key="release.version"
              checkonce="false" ignorefailure="true" condition="upgradecheck">
      <regex regexp="([0-9]+(\.[0-9]+){2})" select="\1" defaultvalue="none"/>
    </variable>

    <variable name="RegExTest.Select.Windows" checkonce="true"
              regkey="HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"
              regvalue="Path">
      <regex regexp="([^;]*)(.*)"
             select="\1"
             defaultValue="(unmatched)"
             casesensitive="false"/>
    </variable>

    <variable name="RegExTest.ReplaceFirst.Windows" checkonce="true"
              regkey="HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"
              regvalue="Path">
      <regex regexp="([^;]*)"
             replace="+++ \1 +++"
             defaultValue="(unmatched)"
             casesensitive="false"
             global="false"/>
    </variable>

    <variable name="RegExTest.ReplaceAll.Windows" checkonce="true"
              regkey="HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"
              regvalue="Path">
      <regex regexp="([^;]*)"
             replace="+++ \1 +++"
             defaultValue="(unmatched)"
             casesensitive="false"
             global="true"/>
    </variable>

</dynamicvariables>