Soren started the thread "Displaying custom error messages if deferred CA
fails" several days ago, and I have been trying to resolve a similar
problem.
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Displaying-custom-error-messages-if-deferred-CA-fails-td7594643.html

My CA is C++ and I use WcaUtil when possible.  I implemented a call to
WcaErrorMessage (which wraps MsiProcessMessage indirectly).  I used as a
sample the wix 3.8.1228 code at: src\ext\ca\wixca\dll\XmlConfig.cpp line
919.  I defined a error code for the first param of WcaErrorMessage in an h
file using the info in: src\libs\wcautil\custommsierrors.h making sure the
code was between 25000 and 30000, and not one of  the codes already defined.

This CA is in my extension project and I modified the other arguments to the
WcaErrorMessage to pass my additional data, in my case the name of an
installed Printer.  When this code is executed, without modifying my mba, a
message box is displayed which includes the "Error5" message from
WixUI_en-us.wxl.  "The installer has encountered an unexpected error
installing this package. This may indicate a problem with this package. The
error code is [1]. {{The arguments are: [2], [3], [4]}}"  My error code
which was passed to WcaErrorMessage is displayed.   All of this is
background for the following concern.

In my mba I have a ExecuteError(object sender, ErrorEventArgs e) function
similar to that found at:  src\Setup\WixBA\InstallationViewModel.cs line
504.  I thought I could add code to ExecuteError handler to detect that the
error had been encountered and look up a resource string to display to the
user.  Setting aside the delegation of the message to the View, ExecuteError
never seems to fire when this error is encountered in the CA.  Burn displays
"Error5".  The log says (which is reasonable):

MSI (s) (2C:28) [08:41:27:897]: Created Custom Action Server with PID 944
(0x3B0).
MSI (s) (2C:A0) [08:41:27:916]: Running as a service.
MSI (s) (2C:A0) [08:41:27:918]: Hello, I'm your 64bit Elevated custom action
server.
MSI (s) (2C!AC) [08:41:27:998]: Note: 1: 2205 2:  3: Error 
MSI (s) (2C!AC) [08:41:27:998]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 29999 
MyCAExec:  Initialized.
The installer has encountered an unexpected error installing this package.
This may indicate a problem with this package. The error code is 29999. The
arguments are: 0, MyPrinterName, 
MSI (s) (2C!AC) [08:41:41:006]: Note: 1: 2205 2:  3: Error 
MSI (s) (2C!AC) [08:41:41:006]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1709 
MSI (s) (2C!AC) [08:41:41:006]: Product: MyMsiName -- The installer has
encountered an unexpected error installing this package. This may indicate a
problem with this package. The error code is (my error number in the 29xxx
range). The arguments are: 0, MyPrinterName, 

I am back to asking the same question that Soren raised, how do we get
notification in a burn/mba that an error in a CA was encountered when we use
WcaErrorMessage (or MsiProcessMessage) in the CA?   Clearly there are
several examples in the wix extensions where this sort of message is being
presented to the user but I am missing some step in the implementation.  I
am aware of how to post the message to a log file and then fail the install
from the CA but would like to allow the user to retry, as is done in the
CloseApplication CA. 

Thank you for any advise on this issue.
Phill 



--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Revisit-Displaying-custom-error-messages-if-deferred-CA-fails-tp7594695.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to