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!

litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

conditional text update file

Hello,

We want to add a dialog on our installation that asks the user to choose one of two options (with a combo box). That's easy. The non-easy part (for me) is to change the value of an xml file depending of the user's choice. If the user has chosen "http", then change the xml file replacing XXX for "false" and if the user has chosen "https" on the combo box, then change the xml file replacing XXX for "true".

How can I do that?

Thanks in advance.
Arnau.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: conditional text update file

Hello Arnau,

In order to achieve this you can add a combo box control (e.g. COMBO_PROP) on your dialog with two items like this:
  • Text: http
    Value: false

    Text: https
    Value: true
Then, you can import your XML file in "Files and Folders" page and edit its XXX element/attribute value to use the "COMBO_PROP" property.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: conditional text update file

Hi,
If I do that in the combo box a strange thing happens...

After selecting "http" or "https", the "true" or "false" value is shown on the combo box. The user doesn't need to see that, it's confusing.

Thanks,
Arnau.
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: conditional text update file

Hello,

I don't know if I've explained myself enough or not. So, two images woth two thousand words... ;)
First image of the combo, before selecting anything
First image of the combo, before selecting anything
Combo1.jpg (32.07 KiB) Viewed 5255 times
Second image of the combo, once one value is selected.
Second image of the combo, once one value is selected.
Combo2.jpg (30.18 KiB) Viewed 5255 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: conditional text update file

Hello Arnau,

If you want to avoid this behavior, then you can use an additional property (MY_PROP) which will be set depending on COMBO_PROP property value. Here are the steps to proceed:
- in "Dialogs" page add a combo box control with the following items:
  • Text: http
    Value: http

    Text: https
    Value: https
- select the above combo box control and add the following events on its published events tab:
  • Event: Set installer property value
    Property: MY_PROP
    Argument: true
    Condition: COMBO_PROP = "https"

    Event: Set installer property value
    Property: MY_PROP
    Argument: false
    Condition: COMBO_PROP = "http"
- use MY_PROP property to update your XML file
- build and run your project

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
litu
Posts: 71
Joined: Fri Mar 22, 2013 2:57 pm

Re: conditional text update file

Yes! It worked!

Thanks a lot.
Arnau.



Note for Caphyon CEO: the support guys deserve a raise!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: conditional text update file

You're always welcome Arnau. Thank you for your positive words.

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

Return to “Building Installers”