IzPack offers the possibility to set a list of default installation directories depending on the target installation platform. When the compiled installer is executed IzPack chooses the one matching the assigned platform.
This can be achieved by explicitely setting variables with the prefix: TargetPanel.dir
. IzPack recognizes this as built-in variable which can be user-modified.
For example, change the resources to variables:
<res id="TargetPanel.dir.windows" src="@{izpack.dir.app}/installpath.windows.txt"/> <res id="TargetPanel.dir.unix" src="@{izpack.dir.app}/installpath.unix.txt"/> |
to
<variable name="TargetPanel.dir.windows" value="C:/MyApp"/> <variable name="TargetPanel.dir.unix" value="/usr/local/myapp"/> |
This uses the following variable search order to determine the default directory to display:
Available platforms can be found in the class Platforms. The names are the lowercase versions of those defined.
Allowed names include:
Differences from 4.3.6
Differences between 4.3.5 and 4.3.6
In 4.3.5, resources were used rather than variables. Resources were searched for with the following names
IZPACK-798 changed the above to use variables instead of text files, following the same naming convention.