[wix-devs] Can anyone give me a nice simple example of returning values from a Custom Action.
Rob Mensching
rob at firegiant.com
Mon Sep 11 09:56:08 PDT 2017
Wrong mailing list. Try wix-users. This list is about developing the WiX Toolset itself.
-----Original Message-----
From: wix-devs [mailto:wix-devs-bounces at lists.wixtoolset.org] On Behalf Of Paul Mumford via wix-devs
Sent: Monday, September 11, 2017 4:20 AM
To: wix-devs at lists.wixtoolset.org
Cc: Paul Mumford <paul.mumford at gmail.com>
Subject: [wix-devs] Can anyone give me a nice simple example of returning values from a Custom Action.
Hi, been banging my head against the wall on this!
I have a c# custom action to select an option and enter some text, how can I reference and act on it in the wxs. Really id like to optionally install different components depending on the select but I can seem to reference the property returned in session.
Here is sample:
<Property Id="THING_INSTALL_TYPE" Value="Default" />
<Binary Id="THINGSetupCustomActionsDLL"
SourceFile=".\Compiled\THINGSetupCustomActions.CA.dll"
/>
<CustomAction Id="SelectClientServerID"
BinaryKey="THINGSetupCustomActionsDLL"
DllEntry="SelectClientServer" Execute="immediate" Return="check" />
Will happily run the custom DLL.
In c# I say:
session["THING_INSTALL_TYPE"] = "Client";
The in WiX I want to conditionally install components based on the result, see condition in bold below. I have to do it this way because of various reasons but it just doesnt seem to return the property back from the custom action. Any ideas?
<Component Id='AppComponentID'
Guid='xxxxxxxx-3C67-4826-BB16-82DD9D876B29'>
<File Id='THINGEXEFileID' Name='THING.exe' DiskId='1'
Source='.\Compiled\THING.exe' KeyPath='yes'>
<Shortcut Id="startmenuTHINGLink"
Directory="ProgramMenuDir" Name="THINGWorkingDirectory='INSTALLDIR' Icon="
THING.exe" IconIndex="0" Advertise="yes" />
<Shortcut Id="desktopTHING" Directory="DesktopFolder" Name="
THING" WorkingDirectory='INSTALLDIR' Icon="THINGApp.exe" IconIndex="0"
Advertise="yes" />
</File>
* <Condition>**THING_INSTALL_TYPE = "Client"</Condition>*
</Component>
____________________________________________________________________
WiX Toolset Developer Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-devs
mailing list