[wix-users] Message Box in Wix Control & Custom Action

Hoover, Jacob Jacob.Hoover at greenheck.com
Wed Apr 4 11:02:45 PDT 2018


Again, a UI in a CA is going to cause lots of issues...  Silent/Quiet/Admin installs...

The DTF Session.Message internally uses MsiProcessMessage.

Per the MSDN doc's, https://msdn.microsoft.com/en-us/library/windows/desktop/aa368322%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 

The DoAction ControlEvent notifies the installer to execute a custom action.
Note that custom actions launched by a DoAction ControlEvent can send a message with the Message Method, but cannot send a message with MsiProcessMessage. On systems prior to Windows Server 2003, custom actions launched by a DoAction ControlEvent cannot send messages with MsiProcessMessage or Message Method. For more information, see Sending Messages to Windows Installer Using MsiProcessMessage.

This ControlEvent requires the user interface to be run at the full UI level. This event will not work with a reduced UI or basic UI. For more information, see User Interface Levels.



The message method they speak of is on the COM interface of IID_ISession, from the MSI.dll.


Personally, I've gone 100% bundle, and have all my MSI's property driven with no UI.  A custom BA has none of these limitations and has a full collection of controls.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Ronny Eriksson via wix-users
Sent: Wednesday, April 4, 2018 12:57 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Ronny Eriksson <ronny.eriksson at optimity.se>
Subject: Re: [wix-users] Message Box in Wix Control & Custom Action

I never got that session.Message to work in my C# CA so I just added the using System.Windows.Forms and then used e.g. 
MessageBox.Show("some text", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) to show a message box with some texts and that works for my installer at least .

Ronny Eriksson 

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Nir Bar via wix-users
Sent: Wednesday, 4 April 2018 19:39
To: Ven H <venh.123 at gmail.com>
Cc: Nir Bar <nir.bar at panel-sw.com>; WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] Message Box in Wix Control & Custom Action

The following code works for me in C++
You can try porting it to C#

    hRecord = ::MsiCreateRecord(1);
    ExitOnNullWithLastError(hRecord, hr, "Failed to create a warning record.");

    hr = WcaSetRecordString(hRecord, 0, szMsg);
    ExitOnFailure(hr, "Failed to set warning record message");

    WcaProcessMessage( INSTALLMESSAGE::INSTALLMESSAGE_WARNING, hRecord);






--
Nir Bar, Independent WiX Expert. Creator of-
JetBA: WiX WPF Bootstrapper User Interface Framework

JetBA++: WiX Native Bootstrapper User Interface Framework




____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list