Install component conditionally?

Comments

1 comment

  • Avatar
    juanjo

    You can enable/disable components on the fly based on any condition using the <componentSelection> action. For example, if you give your user the choice of enabling the extended functionality through a <booleanParameter> you could use its <postShowPageActionList> to configure the component:

    <booleanParameter>
        <name>installAdvance</name>
        ...
        <postShowPageActionList>
            <componentSelection>
                <select>advancedComponent</select>
                <ruleList>
                    <isTrue>
                        <value>${installAdvance}</value>
                    </isTrue>
                </ruleList>
            </componentSelection>
            <componentSelection>
                <deselect>advancedComponent</deselect>
                <ruleList>
                    <isFalse>
                        <value>${installAdvance}</value>
                    </isFalse>
                </ruleList>
            </componentSelection>
        </postShowPageActionList>
    </booleanParameter>
    

    If you also plan to to support unattended installation you will also need to place the code in the <readyToInstallActionList>, as the pages won't be displayed:

     <readyToInstallActionList>
        <componentSelection>
            <select>advancedComponent</select>
            <ruleList>
                <isTrue>
                    <value>${installAdvance}</value>
                </isTrue>
            </ruleList>
        </componentSelection>
        <componentSelection>
            <deselect>advancedComponent</deselect>
            <ruleList>
                <isFalse>
                    <value>${installAdvance}</value>
                </isFalse>
            </ruleList>
        </componentSelection>
     </readyToInstallActionList>
    

Please sign in to leave a comment.