How do you know if a non-modal dialog was canceled?
Posted: Wed May 27, 2009 1:25 pm
How can you tell if a non-modal dialog was canceled? The "Return Result in Variable" field of Display Dialog is only applicable to modal dialogs. What about non-modal dialogs?
I've tried checking the value of the built-in ABORT variable after hiding the dialog, but it never hits that code:
Neither of the message boxes are ever displayed. I do see a "Setup canceled" message box, but I believe this is coming from within IA. I am not explicitly displaying this.
How do I capture that a user pressed cancel on a non-modal dialog so that I can perform cleanup and exit cleanly?
Thanks!
I've tried checking the value of the built-in ABORT variable after hiding the dialog, but it never hits that code:
Code: Select all
Display Dialog: progress, use as progress dialog (non-modal)
Apply Install (get result into variable SUCCESS)
if Variable SUCCESS not Equals ERROR
Call DLL Function $TARGETDIR$\\CustomActions.dll->Install (get result into variable CUSTACTSUCCESS)
if Variable CUSTACTSUCCESS not Equals 0
Set Variable SUCCESS to ERROR
Set Variable LASTERROR to Post-Install Actions Failed
Apply Uninstall
end
end
Hide Dialog
if Variable ABORT Equals TRUE
MessageBox: $TITLE$ Setup, User Canceled! Abort = true!
else
MessageBox: $TITLE$ Setup, Abort != true
end
Neither of the message boxes are ever displayed. I do see a "Setup canceled" message box, but I believe this is coming from within IA. I am not explicitly displaying this.
How do I capture that a user pressed cancel on a non-modal dialog so that I can perform cleanup and exit cleanly?
Thanks!