How to customise selection of Install Dir page?

Comments

1 comment

  • Avatar
    wojciechka

    It is possible to use <postShowPageActionList> to perform cheks for existence of specific file - such as uninstall.dat, which is the InstallBuilder uninstaller data file. Then using next_page it is possible to not allow continuing. For example:

    <postShowPageActionList> <if> <actionList> <showQuestion> <default>no</default> <text>Do you want to uninstall the application first?</text> <variable>installdir_exists_answer</variable> </showQuestion> <if> <actionList> <exit> <exitCode>1</exitCode> </exit> </actionList> <conditionRuleList> <isTrue> <value>${installdir_exists_answer}</value> </isTrue> </conditionRuleList> <elseActionList> <setInstallerVariable> <name>next_page</name> <value>same</value> </setInstallerVariable> </elseActionList> </if> </actionList> <ruleList> <fileExists> <path>${installdir}/uninstall.dat</path> </fileExists> </ruleList> </if> </postShowPageActionList>

    The example can also be customized to run uninstaller and go back to same page instead of simply exiting. For example:

    <if> <actionList> <if> <actionList> <runProgram> <program>${installdir}/uninstall.app/Contents/MacOS/installbuilder.sh</program> <programArguments>&amp;</programArguments> </runProgram> </actionList> <conditionRuleList> <platformTest> <type>osx</type> </platformTest> </conditionRuleList> <elseActionList> <runProgram> <program>${installdir}/uninstall.${platform_exec_suffix}</program> <programArguments>&amp;</programArguments> </runProgram> </elseActionList> </if> <setInstallerVariable> <name>next_page</name> <value>same</value> </setInstallerVariable> </actionList> <conditionRuleList> <isTrue> <value>${installdir_exists_answer}</value> </isTrue> </conditionRuleList> <elseActionList> <setInstallerVariable> <name>next_page</name> <value>same</value> </setInstallerVariable> </elseActionList> </if>

    This is the condition after the <showQuestion> with the updated actions.

Please sign in to leave a comment.