<dynamicinstallerrequirements>Introduced in IzPack 5.0, the <dynamicinstallerrequirements> element is used to enhance the "classic" installer requirement checking that IzPack does at the beginning of an installation process. This stops the installation unless a certain condition is met.
With the dynamicinstallerrequirements element, you can check a certain set of conditions on each panel change, using a panel data validator to check if the required conditions are met.
<dynamicinstallerrequirements>
<installerrequirement severity="error"
condition="this.condition.must.not.happen"
messageid="this.condition.must.not.happen.translation.id"/>
<installerrequirement severity="error"
condition="this.condition.may.happen"
messageid="this.condition.may.happen.translation.id"/>
...
</dynamicinstallerrequirements> |
If a condition applies, a messagebox is shown with the appropriate content from translation. Depending on the value of severity attribute the installation might be continued or is aborted:
A more detailed example:
<condition type="variable" id="isNew">
<name>previous.version</name>
<value>XX.XX.XX</value>
</condition>
<condition type="not" id="isUpgrade">
<condition type="ref" refid="isNew"/>
</condition>
...
<dynamicinstallerrequirements>
<installerrequirement condition="isUpgrade" severity="warning" messageid="not.an.upgrade.warning.message"/>
</dynamicinstallerrequirements>
...
<panels>
<panel classname="HelloPanel"/>
<panel classname="TargetPanel">
<validator classname="DynamicInstallerRequirementValidator"/>
</panel>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="FinishPanel"/>
</panels>
|
On each panel with a DynamicInstallerRequirementValidator assigned will be evaluated according to the requirements given as nested elements in <dynamicinstallerrequirements>.
| Attribute | Description | Default | Required |
|---|---|---|---|
severity | The severity the validator should apply in case of the condition gets true. Possible values: "warning" | "error"
| none | yes |
condition | A valid condition ID defined within the <conditions/> element. | none | yes |
messageid | A valid message ID from the appropriate translation file. If it can't be found the mentioned ID itself is displayed instead of the translated text. | none | yes |