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

Habib Salim habib at hsalim.com
Wed Apr 4 11:47:44 PDT 2018


Too late for it now, but sorry to have mislead earlier with
Microsoft.Windows.Forms namespace

Please heed Jacob's warning .  Do not use msgbox in production.

I've used messagebox in my CA only to test the installer.  I can look at
the log file post installation but this is my poor-man's debugger.

Even as a test tool its' use is questionable...





-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf
Of Hoover, Jacob via wix-users
Sent: Wednesday, April 04, 2018 2:03 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Hoover, Jacob <Jacob.Hoover at greenheck.com>
Subject: Re: [wix-users] Message Box in Wix Control & Custom Action

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.8
5%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/

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



More information about the wix-users mailing list