...
The simpliest way to assign a value to a dynamic variable is a plain value.
Using a plain dynamic variable assignment is recognized by using the attribute value in the variable definition.
Specific attributes:
- value
The plain value to be assigned to the dynamic variable.
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
<dynamicvariables> <variable name="previous.version" value="4.3.3"/> </dynamicvariable> |
...
Values from Environment Variables
...
lang | xml |
---|---|
title | Assigning the value of an environment variable to a dynamic variable |
Using a dynamic variable assignment from an environment variable is recognized by using the attribute environment in the variable definition.
Specific attributes:
- environment
The name of the environment variable to get the assignment value from.
Code Block | ||||
---|---|---|---|---|
| ||||
<dynamicvariables> <variable name="search.path" environment="PATH"/> </dynamicvariables> |
...
Dynamic variables can be also assigned from a value in configuration files with key-value pairs, as property files.
The attribute type="options" is to be used to make this file parsed as an option file. Separators between the key and value might be for instance '=', ':' including their escaped variants '\=', '\:', where leading and trailing whitespaces are trimmed off.
Example:
...
lang | xml |
---|---|
title | Assigning a dynamic variable from properties/option files |
...
Using a dynamic variable assignment from a certain option or property of an option or property file is recognized by using the attribute file in the variable definition along with the attribute type set to "options" (or left out).
Specific attributes:
- file
The property/option file path to read from. - type := "options" | "ini" | "xml" (optional, defaults to "options")
The file type, must be "options" to read options or properties. - key
The option or property key to read the value for.
The attribute type="options" is to be used to make this file parsed as an option file. Separators between the key and value might be for instance '=', ':' including their escaped variants '\=', '\:', where leading and trailing whitespaces are trimmed off.
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
<dynamicvariables> <variable name="option.1" checkonce="true" keyfile="first.setting"/> <variable name="option.2" checkonce="true" file="${INSTALL_PATH}/../old_installation/test.conf" type="options" key="work.dir"/> </dynamicvariables> |
Values from INI Files
...
${INSTALL_PATH}/../old_installation/test.properties" type="options"
key="first.setting"/>
<variable name="option.2" checkonce="true"
file="${INSTALL_PATH}/../old_installation/test.conf" type="options"
key="work.dir"/>
</dynamicvariables> |
Values from INI Files
It's also possible to assign Windows INI file values to IzPack dynamic variables. INI files are 3-dimensional configuration files with key-value pairs which are divided into several sections, following a certain syntax.
Using a dynamic variable assignment from a certain entry of an INI file is recognized by using the attribute file in the variable definition along with the attribute type set to "ini".
Specific attributes:
- file
The INI file path to read from. - type := "options" | "ini" | "xml" (optional, defaults to "options")
The file type, must be "ini" to read INI keys. - section
The INI section to lookup the entry in. - key
The INI entry key to read the value for.
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
<dynamicvariables> <variable name="ini.1" checkonce="true" file="C:/Program Files/freesshd/FreeSSHDService.ini" type="ini" section="SSH server" key="SSHCMD"/> </dynamicvariables> |
...