We have a combo box that allows the user installing the application to choose between http and https. I would like to populate an xml file key with a 1 or a 0 depending on their choice.
To achieve this you can use a "Set installer property" event to set a property to "1" or "0" depending on the combobox option, then write that property in the XML file.
For example, you can create a property "USER_CHOICE" with the value "0" in the "Install Parameters" page. Then you add a "Set installer property" custom action with the settings below:
I've responded to this as I have found another related (possible) issue. It has certainly affected our current build.
When the installer runs, it carries out a few tasks including choosing a 1 or 0 depending on a combo box. This
is currently working only if you choose to change the box and then change it back during install. Otherwise it
will always stay at '0'. is this a known bug or have I unintentionally caused an issue?
Yes, that's no problem. I've tested this functionality in several different scenarios and builds - the result is always the same
except when you interact with the ComboBox. (In future we will probably set this from a registry).
So here is the setup:
1. ComboBox with two options
2. ComboBox control data with two values, http and https with HTTPS 'selected' and HTTP as the top value.
3. Two published events (set installer Property value) on the ComboBox as follows: Event Argument Condition
a) USER_PROTO_CHOICE 0 AI_INSTALL AND (IIS_PROTOCOL="http")
b) USER_PROTO_CHOICE 1 AI_INSTALL AND (IIS_PROTOCOL="https")
4. This process in turn populates the 'USER_PROTO_CHOICE' property and it is then used to update a key in an XML file.
So the fault is: SCENARIO 1
When running the built installer exe, when you reach that dialog page, the default for the ComboBox always appears as HTTPS
and therefore because it's the one we want, no one changes the ComboBox and simply goes to the next dialog box.
This action results in a '0' populating the 'USER_PROTO_CHOICE' property and it is then used to update the key in an XML file incorrectly
SCENARIO 2
When running the built installer exe, when you reach that dialog page, the default for the ComboBox always appears as HTTPS.
If you choose to change it to HTTP and then back to HTTPS, it changes the ComboBox as expected and you then move to the next dialog box.
This action results in a '1' populating the 'USER_PROTO_CHOICE' property and it is then used to update the key in an XML file correctly.
In order to resolve this problem you can simply set the default value of the "USER_PROTO_CHOICE" property to "1" or you can move the "Set installer property value" published events on the "Next" button of that dialog.
FOLLOW US
Get the latest news in Application Packaging