We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

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

Update XML file depending on Combo Box selection

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.

Is this possible?

Thank you,
Ian
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Update XML file depending on Combo Box selection

Hi Ian,

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.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: Update XML file depending on Combo Box selection

I've tried to set this but it is not putting out the correct output.

Do you have any examples of syntax?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Update XML file depending on Combo Box selection

Hi Ian,

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:
  • Property: USER_CHOICE
    Value: 1
    Condition: COMBOBOX_PROP = "Value1"
Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: Update XML file depending on Combo Box selection

Email not working today.

Thanks very much Eusebiu, I have built and tested an example AIP and it was successful.

Best regards,

Ian
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Update XML file depending on Combo Box selection

You're welcome Ian. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: Update XML file depending on Combo Box selection

Hi Eusebiu,

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?

best regards,

Ian
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Update XML file depending on Combo Box selection

Hi Ian,

I'm afraid that I do not fully understand which is the case when that value is always '0'. Can you please give me more details (maybe exemplify)?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: Update XML file depending on Combo Box selection

Hi Eusebiu,

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.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Update XML file depending on Combo Box selection

Hi Ian,

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.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ipollock
Posts: 137
Joined: Wed Aug 31, 2016 10:46 am

Re: Update XML file depending on Combo Box selection

Thank you Eusebiu,

I have built and tested this and it's working as expected.

Best regards,

Ian
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Update XML file depending on Combo Box selection

You're welcome Ian. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”