C# | Visual Basic | Visual C++ |
public MessageResult Message( InstallMessage messageType, Record record )
Public Function Message ( _ messageType As InstallMessage, _ record As Record _ ) As MessageResult
public: MessageResult Message( InstallMessage messageType, Record^ record )
- messageType (InstallMessage)
- Type of message to be processed
- record (Record)
- Contains message-specific fields
Logging may be selectively enabled for the various message types. See the EnableLog(InstallLogModes, String) method.
If record field 0 contains a formatting string, it is used to format the data in the other fields. Else if the message is an error, warning, or user message, an attempt is made to find a message template in the Error table for the current database using the error number found in field 1 of the record for message types and return values.
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.
Note, this method never returns Cancel or Error values. Instead, appropriate exceptions are thrown in those cases.
Win32 MSI API: MsiProcessMessage
Exception | Condition |
---|---|
InvalidHandleException | the Session or Record handle is invalid |
ArgumentOutOfRangeException | an invalid message kind is specified |
InstallCanceledException | the user exited the installation |
InstallerException | the message-handler failed for an unknown reason |