Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.0
-
Component/s: Build, Compiler, Documentation, Installer
-
Labels:None
Description
For integrating upgrade handling there is a need to pre-configure an installed application.
Therefore, I'd like to introduce a native possibility to handle configure files.
Requirements:
- supported file formats: option/properties, INI, XML
- registry support on Windows
- explicitely set values
- explicitely delete values
- merge configuration parameters from a previous installation (or a local template).
Example:
<packs>
<pack name="My Program Core" required="yes">
<description>The core files of my program</description>
<file src="plainfiles" targetdir="${INSTALL_PATH}" override="true"/>
<configurable keepOldKeys="false" keepOldValues="true"
fromfile="${INSTALL_PATH_OLD}/conf/myapp.properties" type="properties"
targetfile=${INSTALL_PATH}/conf/myapp.properties" type="properties"
condition="previousversion.is.1.0.0">
<set key="propkey1" value="propvalue" create="true"/>
<delete key="propkey2"/>
</configurable>
<configurable keepOldKeys="false" keepOldValues="true"
fromfile="${INSTALL_PATH_OLD}/conf/myapp.xml" type="xml"
targetfile=${INSTALL_PATH}/conf/myapp.xml" type="xml"
condition="previousversion.is.1.0.0">
<set key="/root/autostart" value="true" create="true"/>
</configurable>
<configurableset type="properties" keepOldKeys="false" keepOldValues="true" create="false"
fromdir="${OLD_INSTALL_PATH}/conf"
targetdir="${OLD_INSTALL_PATH}/conf"
condition="mergeconfigallowed">
<include="*.properties"/>
<exclude="*.conf"/>
</configurableset>
<configurableset keepOldKeys="false" keepOldValues="true" create="false"
fromregkey="HKLM\oldkey"
targetregkey="HKLM\newkey"
condition="changeregistryallowed"/>
...
</pack>
</packs>}}
Issue Links
- is superceded by
-
IZPACK-520
Implement basic upgrade handling
-
I will probably implement this as configuration installer listener, because this issue will require some additional frameworks to add optionally for being able to handle XML merging and XPath patching of XML files. This might look like this:
install.xml
config-actions-spec.xml:
<configurationactions> <pack name="Test Core"> <configurationaction order="beforepacks"> <variable name="INSTALL_PATH_OLD" value="${INSTALL_PATH}"/> </configurationaction> <configurationaction order="afterpacks"> <configurable keepOldKeys="false" keepOldValues="true" fromfile="${INSTALL_PATH_OLD}/conf/myapp.properties" type="properties" targetfile=${INSTALL_PATH}/conf/myapp.properties" type="properties" condition="previousversion.is.1.0.0"> <set key="propkey1" value="propvalue" create="true"/> <delete key="propkey2"/> </configurable> <configurable keepOldKeys="false" keepOldValues="true" fromfile="${INSTALL_PATH_OLD}/conf/myapp.xml" type="xml" targetfile=${INSTALL_PATH}/conf/myapp.xml" type="xml" condition="previousversion.is.1.0.0"> <set key="/root/autostart" value="true" create="true"/> </configurable> <configurableset type="properties" keepOldKeys="false" keepOldValues="true" create="false" fromdir="${OLD_INSTALL_PATH}/conf" targetdir="${OLD_INSTALL_PATH}/conf" condition="mergeconfigallowed"> <include="*.properties"/> <exclude="*.conf"/> </configurableset> <configurableset keepOldKeys="false" keepOldValues="true" create="false" fromregkey="HKLM\oldkey" targetregkey="HKLM\newkey" condition="changeregistryallowed"/> ... </configurationaction> ... </pack> </configurationactions><configurationactions> <pack name="Test Core"> <configurationaction order="beforepacks"> <variable name="INSTALL_PATH_OLD" value="${INSTALL_PATH}"/> </configurationaction> <configurationaction order="afterpacks"> <configurable keepOldKeys="false" keepOldValues="true" fromfile="${INSTALL_PATH_OLD}/conf/myapp.properties" type="properties" targetfile=${INSTALL_PATH}/conf/myapp.properties" type="properties" condition="previousversion.is.1.0.0"> <set key="propkey1" value="propvalue" create="true"/> <delete key="propkey2"/> </configurable> <configurable keepOldKeys="false" keepOldValues="true" fromfile="${INSTALL_PATH_OLD}/conf/myapp.xml" type="xml" targetfile=${INSTALL_PATH}/conf/myapp.xml" type="xml" condition="previousversion.is.1.0.0"> <set key="/root/autostart" value="true" create="true"/> </configurable> <configurableset type="properties" keepOldKeys="false" keepOldValues="true" create="false" fromdir="${OLD_INSTALL_PATH}/conf" targetdir="${OLD_INSTALL_PATH}/conf" condition="mergeconfigallowed"> <include="*.properties"/> <exclude="*.conf"/> </configurableset> <configurableset keepOldKeys="false" keepOldValues="true" create="false" fromregkey="HKLM\oldkey" targetregkey="HKLM\newkey" condition="changeregistryallowed"/> ... </configurationaction> ... </pack> </configurationactions>