This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Use the messagebox flags in System.Windows.Forms
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 16, 2008
07:04 AM
How do I show Error Message using Managed Custom Actions with Windows Installer
I am writing a managed custom action. I am using the DTF Framework from Windows Installer Xml to wrap the managed dll into a usable CA dll. The CA does what it is supposed to, but I am still having trouble with error handling:
The above code produces the following text shown in the MSI log:
The error number refers to the code contained in the Error table within the MSI. The Message shown above is correct.
My problem is: Why does Windows Installer NOT create a dialog notifying the user about the error?
Dim record As New Record(1)
' Field 0 intentionally left blank
' Field 1 contains error number
record(1) = 27533
session.Message(InstallMessage.Error, record)
The above code produces the following text shown in the MSI log:
MSI (c) (C4 ! C6) [13:15:08:749]: Product: TestMSI -- Error 27533. The case-sensitive passwords do not match.
The error number refers to the code contained in the Error table within the MSI. The Message shown above is correct.
My problem is: Why does Windows Installer NOT create a dialog notifying the user about the error?
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 16, 2008
08:22 AM
While I love DTF with InstallShield, it's not really an InstallShield technology so better answers will be gotten from the WiX-Users list on sourceforge/nabble.
That said, checkout:
http://msdn.microsoft.com/en-us/library/aa371672(VS.85).aspx
Notice at the bottem how the explain how to create messageboxes. Problem is, the interop seems to only expose an enum so I'm not sure how to make it work. I'm going to play with it and talk to Jason G. and then I'll get back to you on this.
That said, checkout:
http://msdn.microsoft.com/en-us/library/aa371672(VS.85).aspx
Notice at the bottem how the explain how to create messageboxes. Problem is, the interop seems to only expose an enum so I'm not sure how to make it work. I'm going to play with it and talk to Jason G. and then I'll get back to you on this.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 16, 2008
09:30 AM
Thanks Christopher!
I crossposted the question to WiX-User earlier as you already have noticed. You are right, the discussion is better lead there.
However, in case we find a solution to this problem we should remember posting it here as well.
I am sure that many people start using DTF rather than InstallShield's solution (it's better documented, there are more samples, the WiX community is pretty responsive,...). So if anyone searches for this topic across the net, he or she should not get to a dead end here. 😉
Thanks for your help!
Christian.
I crossposted the question to WiX-User earlier as you already have noticed. You are right, the discussion is better lead there.
However, in case we find a solution to this problem we should remember posting it here as well.
I am sure that many people start using DTF rather than InstallShield's solution (it's better documented, there are more samples, the WiX community is pretty responsive,...). So if anyone searches for this topic across the net, he or she should not get to a dead end here. 😉
Thanks for your help!
Christian.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 16, 2008
09:46 AM
From the DTF documentation for Session.Message:
"The messageType parameter may also include message-box flags from the following enumerations: System.Windows.Forms.MessageBoxButtons, System.Windows.Forms.MessageBoxDefaultButton, System.Windows.Forms.MessageBoxIcon. These flags can be combined with the InstallMessage with a bitwise OR."
What it doesn't say is you will need to cast the result back to an InstallMessage enum. DTF's Session.Message is a very thin wrapper around MsiProcessMessage, so the behavior regarding how user messageboxes are displayed should be the same.
"The messageType parameter may also include message-box flags from the following enumerations: System.Windows.Forms.MessageBoxButtons, System.Windows.Forms.MessageBoxDefaultButton, System.Windows.Forms.MessageBoxIcon. These flags can be combined with the InstallMessage with a bitwise OR."
What it doesn't say is you will need to cast the result back to an InstallMessage enum. DTF's Session.Message is a very thin wrapper around MsiProcessMessage, so the behavior regarding how user messageboxes are displayed should be the same.