[wix-users] Can anyone give me a nice simple example of returning values from a Custom Action?

harald goci harald.goci at panagenda.com
Tue Sep 12 06:44:32 PDT 2017


Hi Paul!

I'm missing the InstallExecuteSequence like this:
    <InstallExecuteSequence>
      <Custom Action="SelectClientServerID" Before="???" />
    </InstallExecuteSequence>

It seems to me your custom action does not get called.

BR,
Harald Goci
Senior Software Engineer

Email: harald.goci at panagenda.com - Web: www.panagenda.com
Phone: +43 1 890 12 89-44 - Fax: +43 1 890 12 89-15

(Embedded image moved to file: pic01842.jpg)

panagenda GmbH - Schreyvogelgasse 3/10 - 1010 Vienna - Austria
Registered Office: Vienna - HG Wien - FN 293516t - VAT-ID: ATU63362738
Executive Directors: Florian Vogler (CEO & CTO), Felix Vogler (CFO & COO)

(Embedded image moved to file: pic00288.jpg)

The information in this E-Mail is confidential and privileged. It is
intended solely for the addressee. Access to this E-Mail by anyone else is
unauthorized. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken in reliance on it is prohibited
and will be unlawful. If you receive this message in error, please notify
the sender immediately and delete all copies of this message.




From:	Paul Mumford via wix-users <wix-users at lists.wixtoolset.org>
To:	wix-users at lists.wixtoolset.org
Cc:	Paul Mumford <paul.mumford at gmail.com>
Date:	12.09.2017 10:04
Subject:	[wix-users] Can anyone give me a nice simple example of
            returning values from a Custom Action?
Sent by:	"wix-users" <wix-users-bounces at lists.wixtoolset.org>



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 a 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";

Then in the WXS 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 doesn't 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 Users Mailing List provided by FireGiant
http://www.firegiant.com/




More information about the wix-users mailing list