Modified installation based on a corporate "config" file

Comments

1 comment

  • Avatar
    wojciechka

    This can easily be built by using xmlFileGet/iniFileGet actions. For example:

    <iniFileGet>
        <file>${installer_directory}/setup.ini</file>
        <section>Features</section>
        <key>component1</key>
        <variable>enable_component1</variable>
    </iniFileGet>
    <if>
        <actionList>
            <setInstallerVariable>
                <name>project.component(component1).show</name>
                <value>0</value>
            </setInstallerVariable>
            <setInstallerVariable>
                <name>project.component(component1).selected</name>
                <value>0</value>
            </setInstallerVariable>
        </actionList>
        <conditionRuleList>
            <isFalse>
                <value>${enable_component1}</value>
            </isFalse>
        </conditionRuleList>
    </if>
    

    This will read setup.ini and check if key component1 in section [Features] is set to 1, yes or true. Simply setting it to anything else or removing this key will cause component1 not to be shown and installed.

    This can be exdended to make it more difficult to guess component names by doing:

    <!-- get MD5 checksum of some static string + component name to
       make guessing key names more difficult -->
    <md5>
        <text>somesecretstring__component1</text>
        <variable>keyname</variable>
    </md5>
    <iniFileGet>
        <file>${installer_directory}/setup.ini</file>
        <key>${keyname}</key>
        <section>Features</section>
        <variable>enable_component1</variable>
    </iniFileGet>
    <if>
        <actionList>
            <setInstallerVariable>
                <name>project.component(component1).show</name>
                <value>0</value>
            </setInstallerVariable>
            <setInstallerVariable>
                <name>project.component(component1).selected</name>
                <value>0</value>
            </setInstallerVariable>
        </actionList>
        <conditionRuleList>
            <isFalse>
                <value>${enable_component1}</value>
            </isFalse>
        </conditionRuleList>
    </if>
    

Please sign in to leave a comment.