ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

ComboBox - default from registry

I have a ComboBox that sets the web protocol and stores the choice in a variable 'IIS_PROTOCOL'.
Choice 0 = http
Choice 1 = https
I have a published event that populates another variable 'USER_PROTO_CHOICE' with a 0 or 1 depending on the above.

I've set both variables to be set in the registry and searched then next time the installer is run to populate those variables from the registry.

The problem is, the ComboBox is still set to the 'Selected' State in the dialogue box so it overwrites the retrieved variable content.

Q. How do i get the ComboBox to populate with the variable 'IIS_PROTOCOL' instead of the Selected choice in the dialogue?
(Would i use the Init Events tab, if so, could you help?)

Many thanks.

Ian
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: ComboBox - default from registry

Just to confirm, the combobox has two options and i'd like to set the option from the previous registry entry (last time it was installed).
I don't want to use the 'Selected' option on the ComboBox dialogue.

Thank.
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: ComboBox - default from registry

Ok, so i've managed to get this figured out.

1. Setting the variable in Install Parameters so permananent this repopulates the choice to the ComboBox. (Recovers the variable from registry as the user would have set it during previous install)
2. Ensure that i have the Logic on the Next Button, Published Events. (Although this does require user input that will get done if they change the box).

So essentially, if the user doesn't want to change the protocol (ComboBox 1/2 option) then it is left set as found in the registry.
If they do change it then the action is captured and variables updated when they push 'Next' on the dialogues.
The registry is updated and the config file is updated accordingly.

Best regards,

Ian
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: ComboBox - default from registry

Hello Ian,

I'm glad you found a solution for your scenario.

To select a value into a combo box you should just set the property used by the related combo box to the desired value. For instance if you have a combo box (COMBO_PROP) with two items:
  • Value: value1
    Text: text1

    Value: value2 (selected by default)
    Text: text2
and you want the "value1" be selected in the combo box you can use a "Set installer property value" control event which will set the "COMBO_PROP" property to the "value1" value.

Hope this helped too.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”