Hi,
can someone explain me(or send me a link to more in-depth documentation) about the error dialog handling?
I have a basic msi project with 2-3 installscript custom actions. Within these custom actions I want to show the user a 'custom' error dialog when something goes wrong. Depending on the errorlevel, I want that the user can continue the installation, retry the failed action or abort the installation.
I've read within the MSI documentation(MSI Error Dialog) that you can create a custom error dialog by setting the 'error dialog style bit'.
However what I need to know:
+ does the dialog needs to follow certain guidelines?
+ is it possible to call the dialog multiple times from out of the same installscript custom action?
+ how is the dialog triggered - how do I show it to the user?
+ how do I capture which button has been pressed on the dialog? Can I write different installscript functions per button?
Any help about this topic would be much appreciated...
Thanks in advance.
Christoph
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

Error dialog
Started by
Christoph
, Mar 28 2007 13:02
1 reply to this topic
Posted 28 March 2007 - 15:42
You can find an example in any existing MSI file, or development environments like InstallShield.
+ does the dialog needs to follow certain guidelines?
Yes, see your link. It should look like a normal MessageBox function.
+ is it possible to call the dialog multiple times from out of the same installscript custom action?
Yes, this comes in handy when you want to display a Retry/Cancel message, where you can retry and show the message again on failure.
Note that the message is NOT shown when the installation is supposed to be completely silent, OR when the CA is called from a ControlEvent (it only works for CAs called from a sequence).
+ how is the dialog triggered - how do I show it to the user?
Call MsiProcessMessage()
+ how do I capture which button has been pressed on the dialog? Can I write different installscript functions per button?
Check the return value of MsiProcessMessage()
Instead of the error dialog you can also use the normal MessageBox API, but then you should add additional logic for silent installations.
A big advantage of error dialogs is that you do not have to determine a suitable HWND that will function as owner, which is a big problem for MessageBox.
+ does the dialog needs to follow certain guidelines?
Yes, see your link. It should look like a normal MessageBox function.
+ is it possible to call the dialog multiple times from out of the same installscript custom action?
Yes, this comes in handy when you want to display a Retry/Cancel message, where you can retry and show the message again on failure.
Note that the message is NOT shown when the installation is supposed to be completely silent, OR when the CA is called from a ControlEvent (it only works for CAs called from a sequence).
+ how is the dialog triggered - how do I show it to the user?
Call MsiProcessMessage()
+ how do I capture which button has been pressed on the dialog? Can I write different installscript functions per button?
Check the return value of MsiProcessMessage()
Instead of the error dialog you can also use the normal MessageBox API, but then you should add additional logic for silent installations.
A big advantage of error dialogs is that you do not have to determine a suitable HWND that will function as owner, which is a big problem for MessageBox.