cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sagalovichm
Level 2

NewDialog after SpawnDialog - how to wait?

Hi All!
I have a problem.
When user clicks the 'Next' button on one of the dialogs, I need to check a condition A and, if A is true, show a message which is designed as a custom dialog in Basic MSI project in IS 2009. The message asks the user whether he/she wants to continue or to abort the installation. If the user chooses to continue, I need to show the next screen (as it would happen if A was false). If the user chooses to abort the installation, I need to show a standard screen (i.e. the screen which is normally shown when the installation is canceled and cancellation is confirmed).
I have tried something that seemed to be a normal sequence of events for the 'Next' button:

Event Argument Condition
DoAction ActionToSetA 1
SpawnDialog MyMessage A=1
NewDialog NextDialog 1

But it does not work because, as I understood, the program does not wait for the 'MyMessage' dialog to close before moving to next event. Thus, the 'MyMessage' dialog is overlapped by the 'NextDialog' dialog.

Two possible solutions that I found are these:
1. Create property 'FlagProperty' and set it to 0 as default and then set the following sequence for the 'Next' button:

DoAction ActionToSetA FlagProperty=0
SpawnDialog MyMessage (A=1) AND (FlagProperty=0)
NewDialog NextDialog (A=0) OR (FlagProperty=1)

The following for the 'MyMessage' 'Yes' button:
[FlagProperty] 1 1
EndDialog Return 1

And the following for the 'No' button:
EndDialog Exit 1

The drawbacks of this approach are:
a) The user will need to click 'Next' again after clicking the 'Yes' button.
b) If the user returns to this dialog, A will not be set and the 'MyMessage' dialog will not be spawned again as FlagProperty will be 1.

2. Create two properties MessageClosed and Answer and set the following sequences:

for the 'Next' button of the dialog:

DoAction ActionToSetA 1
NewDialog NextDialog A=0
[MessageClosed] 0 1
SpawnWaitDialog MyMessage MessageClosed=1
NewDialog NextDialog Answer=1
EndDialog Exit Answer=0

for the 'Yes' button of the 'MyMessage' dialog:
[Answer] 1 1
[MessageClosed] 1 1

for the 'No' button:
[Answer] 0 1
[MessageClosed] 1 1

This approach has one drawback: the cursor turns into hourglass when the 'MyMessage' dialog is shown.

Is there any third approach or a way to eliminate the drawbacks of these 2?
Thanks for reading this looooong question 🙂
Labels (1)
0 Kudos
(1) Reply
HFishgrund
Level 2

Hi sagalovichm,

Since all you wanna do is to display a "YES" "NO" dialog to the user, you can do that in a Custom Action script.
In your script, use the built in function "AskYesNo" and you can proceed accordingly.
If you need more assistance on that, let me know.

H
0 Kudos