I am trying to load choice options from text before an installer build starts, and then want to show these options in a Show Choice Question dialog to the person performing the build. Subsequent actions in the build depends on the option selected.

As an example I have used the languages example from the InstallBuilder help to populate a set of languages for use with the Add Choice Options from Text, but I get stuck when I get to the Show Choice Dialog to be able to show these options.

Any help would be most appreciated.

Here is what I have:

jp.description=Language spoken in Japan
de.description=Language spoken in Germany
it.description=Language spoken in Italy
pl.description=Language spoken in Poland
ru.description=Language spoken in Russia

asked 10 Apr '13, 11:22

Polla's gravatar image

accept rate: 0%

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>


answered 11 Apr '13, 02:58

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 10 Apr '13, 11:22

Seen: 3,650 times

Last updated: 11 Apr '13, 02:58