jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • IzPack
  • IZPACK-526

Add merging and patching of configuration files and registry entries

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Major 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

Task - A task that needs to be done. IZPACK-520 Implement basic upgrade handling

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Rene Krell added a comment - 18/Feb/10 3:36 AM

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

<!-- Configuration listener class -->
<listeners>
  <listener installer="ConfigurationInstallerListener"/>
</listeners>

<!-- Resource to process -->
<resources>
  <res id="ConfigurationActionsSpec.xml" src="@BUILD_DIR@/config-actions-spec.xml" />
</resources>

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>
Show
Rene Krell added a comment - 18/Feb/10 3:36 AM 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
<!-- Configuration listener class -->
<listeners>
  <listener installer="ConfigurationInstallerListener"/>
</listeners>

<!-- Resource to process -->
<resources>
  <res id="ConfigurationActionsSpec.xml" src="@BUILD_DIR@/config-actions-spec.xml" />
</resources>
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>
Hide
Permalink
Julien Ponge added a comment - 18/Feb/10 3:50 AM

Since you are on GitHub, what if you experimented on a branch there?

Show
Julien Ponge added a comment - 18/Feb/10 3:50 AM Since you are on GitHub, what if you experimented on a branch there?
Hide
Permalink
Rene Krell added a comment - 21/Apr/10 5:36 AM

Resolved as ConfigurationInstallerListener, still to be documented in the Wiki

Show
Rene Krell added a comment - 21/Apr/10 5:36 AM Resolved as ConfigurationInstallerListener, still to be documented in the Wiki

People

  • Assignee:
    Unassigned
    Reporter:
    Rene Krell
Vote (0)
Watch (0)

Dates

  • Created:
    12/Feb/10 3:08 AM
    Updated:
    21/Apr/10 5:36 AM
    Resolved:
    21/Apr/10 5:36 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.