Oleksandr
Posts: 15
Joined: Tue Dec 04, 2012 11:09 am

How to show some information based on the drop-down value?

Dear support,

We would like to ask you for a suggestion.
We have different configurations for the application, and only one of them should be installed based on the value selected in the drop-down during the installation.
At the same time, to make installation more user-friendly we would like to display the description of the selected configuration in the multi-line text box under this drop-down (the configuration name is meaningless).
Thus whenever user changes the configuration (the value in the drop-down), the description should be changed automatically.
Could you please suggest us a good solution for this problem?
Looking forward to your reply.
Thank you.

Kind regards,
Oleksandr
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to show some information based on the drop-down valu

Hello Oleksandr,

In order to achieve what you want you can proceed like this:
- Go to "Dialogs" page and add a combo box control (e.g. MY_COMBO) containing the following items:
  • Text: c1
    Value: 1

    Text: c2
    Value: 2

    Text: c3
    Value: 3
- Add a static text control (containing a description display text for c1) with the following control conditions:
  • Condition: MY_COMBO = "1"
    Action: Show

    Condition: MY_COMBO <> "1"
    Action: Hide
- Over the above static text control add another static text control (containing a description display text for c2) with the following control conditions:
  • Condition: MY_COMBO = "2"
    Action: Show

    Condition: MY_COMBO <> "2"
    Action: Hide
- Over the above static text control add another static text control (containing a description display text for c3) with the following control conditions:
  • Condition: MY_COMBO = "3"
    Action: Show

    Condition: MY_COMBO <> "3"
    Action: Hide
- Build and run your project.

Also, here's attached a sample project, created with version 9.7 of Advanced Installer, which implements a similar scenario.
sample.zip
(3.04 KiB) Downloaded 366 times
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Oleksandr
Posts: 15
Joined: Tue Dec 04, 2012 11:09 am

Re: How to show some information based on the drop-down valu

Dear support,

Thank you very much for the reply.
The suggested solution looks very good, but unfortunately we need to support about 300 configurations.
And the description of every configuration should be provided to the end-user as well.
Thus we reckon that it can be a bit problematic for us to support all those descriptions, and it will be even more difficult if we need to update some of them (say, about 20-30).
Moreover, these updates should be done on regular basis.
Would you be so kind to let us know if there is any other possible solution?
Looking forward to your reply.
Thank you.

Kind regards,
Oleksandr
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to show some information based on the drop-down valu

Hello Oleksandr,

Another solution would be to include all the related configurations in specific features from "Organization" page and add their descriptions in "Description" field from "Feature Properties" right pane. Then, in "Dialogs" page you should add the "SetupTypeDlg" dialog.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
waspy
Posts: 64
Joined: Fri Oct 03, 2008 10:58 am

Re: How to show some information based on the drop-down valu

Hi Daniel,

Thanks for the reply!

Let me give you a different description of the same scenario which might help you to find an optimal solution for this problem...
We are building an installer for the product that will be deployed onto diffirent environments. Each environment has it's own settings (e.g. databases, xml configurations). Each environment configuration will contain the same number of files. To simplify let's assume that it's a web.config file that needs to overwritten every time certain configuration is selected. The key point is that only one configuration can be selected at a time (therefore Features won't work here). What we've done so far:
  • we created a custom dialog with a dropdown listing all configurations, each of which has it's own associated variable
  • we have added multiple folders (each representing a configuration) with corresponding web.config files in them with an option to overwrite a root web.config file based on the condition defined by the selected configuration (variable)
So far so good - all works like a charm. Now, on the same dialog we'd like to add a text box that would include a formatted text that would describe the selected configuration (e.g. databases, IP addreses and other parameters). Everytime a configuration is selected this textbox needs to be updated. The question is: what is the best way to do it? Keep in mind that your first suggestion is not really workable since we'll have about 300 various environments that also change in time. Is there a way to solve it using variables?

Thank you very much,
Alexei
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to show some information based on the drop-down valu

Hello Alexei,

In order to achieve this you can use installer properties in the "Text" field from "Properties" right pane. Then, you should refresh the dialog after configuration selection. Also, you can replace your combo box control with a list box control and add the refresh UI custom action as a published event for the list box control.

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

Return to “Building Installers”