Hi

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:


<prebuildactionlist>
    <setinstallervariable>
        <name>language</name>
        <value>none</value>
    </setinstallervariable>
    <addchoiceoptionsfromtext>
        <name>language</name>
        <text>jp=Japanese
jp.description=Language spoken in Japan
de=German
de.description=Language spoken in Germany
it=Italian
it.description=Language spoken in Italy
pl=Polish
pl.description=Language spoken in Poland
ru=Russian
ru.description=Language spoken in Russia
</text>
    </addchoiceoptionsfromtext>
    <showchoicequestion>
        <defaultvalue></defaultvalue>
        <text></text>
        <variable>answer</variable>
        <optionlist>
            <option>
                <description></description>
                <image></image>
                <text>${language}</text>
                <value></value>
            </option>
        </optionlist>
    </showchoicequestion>
    <showinfo>
        <text>${language}</text>
    </showinfo>
</prebuildactionlist>

asked 10 Apr '13, 11:22

Polla's gravatar image

Polla
1112
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>

link

answered 11 Apr '13, 02:58

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
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

By RSS:

Answers

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

Tags:

×4
×4
×2

Asked: 10 Apr '13, 11:22

Seen: 3,650 times

Last updated: 11 Apr '13, 02:58