Dynamic Installer Requirements -
This feature was introduced Introduced in IzPack 5.0.The main goal was , the <
dynamicinstallerrequirements> element is used to enhance the "classic" installer requirement of IzPack, which has been checked checking that IzPack does at the early beginning of an installation process to stop it, . This stops the installation unless a certain condition is met.
With this enhancementthe dynamicinstallerrequirements element, you will be able to can check a certain set of installer requirements conditions on each panel change, using a panel data validator for dynamic installer requirements.
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>
The installer requirement is actively checked on changing from each panel the DynamicInstallerRequirementValidator is assigned to.
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:
The messagebox is shown and the installation aborts.
The messagebox is shown and the installation can continue after the OK button is pressed.
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> <!-- The 'severity' attribute on this element violates the schema. A patch was created and a pull request submitted at https://github.com/izpack/izpack/pull/140 to change this attribute to 'status' in accordance with the schema. 'severity' works, but your IDE may tell you that the you're in violation of the schema if you have schema validation enabled. --> <installerrequirement condition="isUpgrade" severity="warningWARNING" messageid="not.an.upgrade.warning.message"/> </dynamicinstallerrequirements> ... <panels> <panel classname="HelloPanel"/> <panel classname="TargetPanel"> <!-- This definition does not work in the latest development builds. Commenting out for now. --> <!-- <validator classname="DynamicInstallerRequirementValidator"/> --> </panel> <panel classname="PacksPanel"/> <panel classname="InstallPanel"/> <panel classname="FinishPanel"/> </panels>
Each On each panel the with a DynamicInstallerRequirementValidator is assigned to will be evaluated according to the requirements given as nested elements in
<installerrequirement> - Attributes
The severity the validator should apply in case of the condition gets true.
Possible values: "WARNING" | "ERROR"
|A valid condition ID defined within the <conditions/> element.||none||yes|
|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|