[wix-users] How to show the result of a CA on a dialog?

Peter Schraffl Schraffl at telecomsoftware.com
Tue Jan 7 05:18:17 PST 2020


I have now retried it - without success, maybe someone can give me a hint:

- I customized the FatalError dialog like so (added [SAMWINERRORMESSAGE] to the "Text" attribute of the "Description" element):
	<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
	   <Fragment>
	      <UI>
	         <Dialog Id="SamwinFatalError" Width="370" Height="270" Title="!(loc.FatalError_Title)">
	            ...
	            <Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="80" Transparent="yes" NoPrefix="yes" Text="!(loc.FatalErrorDescription1) 	[SAMWINERRORMESSAGE] !(loc.FatalErrorDescription2)" />
	         </Dialog>
	
	         <InstallUISequence>
	            <Show Dialog="SamwinFatalError" OnExit="error" Overridable="yes" />
	         </InstallUISequence>
	
	         <AdminUISequence>
	            <Show Dialog="SamwinFatalError" OnExit="error" Overridable="yes" />
	         </AdminUISequence>
	
	      </UI>
	   </Fragment>
	</Wix>

- replaced the reference to "FatalError" in the UI.wxs with "SamwinFatalError"
	<DialogRef Id="SamwinFatalError" />

- changed the custom action to set the property with
               session["SAMWINERRORMESSAGE"] = message.ToString();

According to the msi log the property is set and the SamwinErrorDialog is shown but the message itself is not - [SAMWINERRORMESSAGE] is replaced with an empty string.
	...
	MSI (s) (F4!80) [14:11:15:646]: PROPERTY CHANGE: Adding SAMWINERRORMESSAGE property. Its value is 'Missing Windows Features!
What am I missing?...
	...
	MSI (c) (40:34) [14:11:15:771]: Doing action: SamwinFatalError
	Action 14:11:15: SamwinFatalError. 
	Action start 14:11:15: SamwinFatalError.
	Action 14:11:15: SamwinFatalError. Dialog created

Kind regards
PETER SCHRAFFL

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Peter Schraffl via wix-users
Sent: Dienstag, 7. Jänner 2020 11:53
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Peter Schraffl <Schraffl at telecomsoftware.com>
Subject: Re: [wix-users] How to show the result of a CA on a dialog?

Thanks for hints.

Actually I have already tried the approach with the property and modifying the FatalError dialog but maybe I did something wrong. Will give it another try.

Kind regards
PETER SCHRAFFL

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Nir Bar via wix-users
Sent: Dienstag, 7. Jänner 2020 10:36
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Nir Bar <nir.bar at panel-sw.com>
Subject: Re: [wix-users] How to show the result of a CA on a dialog?

You can use my WiX extension to enable Windows Features:

https://www.nuget.org/packages/PanelSwWixExtension/

<Component>

<panelsw:Dism EnableFeatures="IIS"/>

</Component>





As for the FatalError dialog, you can edit it to present a property, say "MY_LONG_ERROR"

Then in the CA set this property to the error message.





--

Nir Bar

WiX Expert






---- On Tue, 07 Jan 2020 10:48:44 +0200 Peter Schraffl via wix-users <wix-users at lists.wixtoolset.org> wrote ----



Hi all, 
 
our installer requires some features (basically IIS features) to be installed and fails if those are not installed on the system. In such cases the FatalError dialog is shown which does not provide any useful information about the root cause of the issue. 
That’s why we have implemented a C# custom action which does some checks. If the checks fail, a message box with a dynamically generated text is shown via the session.Message(…) function before the CA returns an error result. 
This is working fine so far. 
 
Anyways we would prefer to show the message on the FatalError dialog (or less preferred on its own dialog). Mostly because the generated message might be pretty long and the length of the text shown in the message box is limited, causing the message to be cut off. 
 
So the general question is: how can the (dynamically generated) value of a property (the “result” of a C# custom action) be shown on a dialog? Preferably on the FatalError dialog. 
 
Any hints would be appreciated. 
Thanks in advance and a happy new year. 
 
Kind regards 
Schraffl Peter 
 

____________________________________________________________________
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