[wix-users] Fwd: WiX Error Handling

Hoover, Jacob Jacob.Hoover at greenheck.com
Fri Jan 11 10:18:00 PST 2019


Should his CA not use MsiProcessMessage, INSTALLMESSAGE_ERROR,  and the error table to tell the client about the error?

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Rob Mensching via wix-users
Sent: Friday, January 11, 2019 12:02 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Rob Mensching <rob at firegiant.com>
Subject: Re: [wix-users] Fwd: WiX Error Handling

Your custom action is running on the server side and sets the Property there. When the Windows Installer returns to the client side, the Property is the client side value. Secure Properties can travel from the client to the server but IIRC Properties do not travel back. You could try marking the Property Secure and see if my memory in wrong and see if Properties can travel back.

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Todd Hoatson via wix-users
Sent: Friday, January 11, 2019 9:50 AM
To: wix-users at lists.wixtoolset.org
Cc: Todd Hoatson <todd.hoatson at gmail.com>
Subject: [wix-users] Fwd: WiX Error Handling

Further Details:

In my WiX code (near the top, below the Product, Package & Upgrade tags) I have the following property initialization:

    <Property Id="ERRMSG" Value="Undetermined Error" />

Then, within my custom action (in C#), I have these lines (as mentioned
previously) to force a failure:

            session["ERRMSG"] = "Problem encountered while closing the application";
            return ActionResult.Failure;

In the log file produced by my installer I see the following:

...
MSI (s) (0C!4C) [10:55:58:092]: PROPERTY CHANGE: Modifying ERRMSG property.
Its current value is 'Undetermined Error'. Its new value: 'Problem encountered while closing the application'.
CustomAction CloseApplications returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) …
Property(S): ERRMSG = Problem encountered while closing the application … MSI (c) (24:58) [10:55:58:133]: Doing action: FatalErrorDlg Action 10:55:58: FatalErrorDlg.
Action start 10:55:58: FatalErrorDlg.
Action 10:55:58: FatalErrorDlg. Dialog created Action ended 10:56:23: FatalErrorDlg. Return value 2.
Action ended 10:56:23: INSTALL. Return value 3.
MSI (c) (24:58) [10:56:23:082]: Destroying RemoteAPI object.
MSI (c) (24:50) [10:56:23:082]: Custom Action Manager thread ending.
…
Property(C): ERRMSG = Undetermined Error …

From this I see that the property has been properly initialized prior to it's modification in the custom action.  After the custom action has returned to the WiX code, the property still has the updated value.  Then the FatalErrorDlg is activated and closes.  But after that the property appears to be initialized again to the generic message!

1.  Why is the property being initialized twice?

2.  FatalErrorDlg shows the generic message, "Undetermined Error", rather than the updated message, "Problem encountered while closing the application".
Why is this happening?  What can I do about it?

thanks
Todd Hoatson

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
NOTE: This email was received from an external source. Please use caution when opening links or attachments in the message.


More information about the wix-users mailing list