kmcnaught09
Posts: 3
Joined: Thu Jun 25, 2020 5:02 pm

Sequential conditional dialogs

I've been using conditional dialogs to add install-specific warnings or features, by adding custom dialogs and then adding a condition in "Show only if". This works fine when you have mutually-exclusive dialogs to choose between at any point in the sequence, but it's not giving me the behaviour I expected where I have a series of sequential dialogs that are all independently optional.

In pseudo-code, what I would like to achieve is:

Code: Select all

...
Show WelcomeDlg
if (condition1) {
    Show CustomDialog1
}
if (condition2) {
    Show CustomDialog2
}
if (condition3) {
    Show CustomDialog3
}
if (condition4) {
    Show CustomDialog4
}
Show FolderDlg
...
In particular, if more than one condition is true, I'd like each appropriate dialog to be shown, not just the first one that passes the check.

However, when I add conditions to each of the dialogs in turn, the behaviour I get is equivalent to:

Code: Select all

...
Show WelcomeDlg
if (condition1) {
    Show CustomDialog1
}
else if (condition2) {
    Show CustomDialog2
}
else if (condition3) {
    Show CustomDialog3
}
else if (condition4) {
    Show CustomDialog4
}
Show FolderDlg
...
This means that if condition1, 2, 3, and 4 are all true, only CustomDialog1 will be shown.

Is this expected behaviour? Is there a simple way to get the behaviour I'm after?
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Sequential conditional dialogs

Hi,

In order to achieve what you want, you need to implement the solution detailed in the "How to display some dialogs depending on the selected features" tutorial.

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

Return to “Building Installers”