Loading and displaying options before build

Comments

1 comment

  • Avatar
    wojciechka

    Unfortunately it is not possible to dynamically modify list of items in a <showChoiceQuestion>.

    If you know the maximum number of values, you can define that number of options and use variables for the text. Then you can set the variables by loading a configuration file and show the dialog, throwing an error if an empty option is selected. For example:

    <preBuildActionList> <setInstallerVariable> <name>option_text_1</name> <value>Option 1</value> </setInstallerVariable> <setInstallerVariable> <name>option_text_2</name> <value>Option 2</value> </setInstallerVariable> <setInstallerVariable> <name>option_text_3</name> <value>Option 3</value> </setInstallerVariable> <setInstallerVariable> <name>option_text_4</name> <value></value> </setInstallerVariable> <setInstallerVariable> <name>option_text_5</name> <value></value> </setInstallerVariable> <showChoiceQuestion> <defaultValue></defaultValue> <text></text> <variable>answer</variable> <optionList> <option> <description></description> <image></image> <text>${option_text_1}</text> <value>1</value> </option> <option> <description></description> <image></image> <text>${option_text_2}</text> <value>2</value> </option> <option> <description></description> <image></image> <text>${option_text_3}</text> <value>3</value> </option> <option> <description></description> <image></image> <text>${option_text_4}</text> <value>4</value> </option> <option> <description></description> <image></image> <text>${option_text_5}</text> <value>5</value> </option> </optionList> </showChoiceQuestion> <throwError> <text>Invalid option</text> <ruleList> <compareTextLength> <length>0</length> <logic>equals</logic> <text>${option_text_${answer}}</text> </compareTextLength> </ruleList> </throwError> </preBuildActionList>

Please sign in to leave a comment.