Property created in UI sequence lost its value in Execute sequence


You create a property in the UI sequence and set its value.  When you try to use this property in the Execute sequence, the property is missing or blank.


In this sample we will use Application Search to find the installation path to the Zune software during execution of the InstallUISequence.  We will use that property to launch the Zune.exe at the end of installation.

Here is the WiX source:

<?xml version="1.0" encoding="UTF-8"?>

<Wix xmlns="">


  <Product Id="{E2842676-5648-4A17-8993-E4BA183AAB55}"

           Name="Minimal Windows Installer Sample"




           Manufacturer="Acme Corporation"



    <Package Id="{????????-????-????-????-????????????}"

             Description="Minimal Windows Installer Sample"

             Comments="This installer database contains the logic and data required to install [ProductName]."









             ShortNames ="no"

             Manufacturer="Acme Corporation" />


    <Media Id="1" Cabinet="" EmbedCab="yes" />


    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="ProgramFilesFolder">

        <Directory Id="INSTALLDIR" Name="Minimal" LongName="MinimalInstallation">


          <Component Id="Component1"


            <File Id="ReadMe" DiskId="1" Name="Readme.txt" Source="Readme.txt" Vital="yes" KeyPath="yes" />







    <!-- Find Zune's installation path -->

    <Property Id="ZUNEFOLDER">

      <RegistrySearch Id="ZuneReg"



                      Name="Installation Directory"

                      Type="raw" />



    <!-- Set the property to the <path>\Zune.exe -->

    <CustomAction Id="SetZunePath"


                  Value="[ZUNEFOLDER]Zune.exe" />


    <!-- Custom action to start the executable -->

    <CustomAction Id="StartZune"



                  Return="asyncNoWait" />



      <Custom Action="StartZune" After="InstallFinalize">Not Installed</Custom>




      <Custom Action="SetZunePath" After="AppSearch" />



    <Feature Id="Feature1"

             Title="Feature1 title"

             Description="Feature1 description"


             ConfigurableDirectory="INSTALLDIR" >

      <ComponentRef Id="Component1" />





Compile this code using the following commands:

d:\Wix\candle.exe Minimal.wxs

d:\Wix\light.exe -out Minimal.msi Minimal.wixobj

When we install this installation package, it installs successfully, but Zune.exe is not launched.

Let's add the custom action Type 19 to see the value of ZunePath property:

<CustomAction Id='PrintZunePath' Error='ZunePath=[ZunePath]' />



  <Custom Action="StartZune" After="InstallFinalize">Not Installed</Custom>

  <Custom Action='PrintZunePath' After='StartZune' />


At the end of installation we will see the message box with the message "ZunePath=".  Obviously, our ZunePath property is empty or, more likely, does not exist.  How is that possible?

Remember that Microsoft Windows Installer has two processes: client and server.  All UI sequence actions are done in the client process and all Execute sequence actions - in the server process.  Only public properties are passed from client to server process.

So, to fix this problem, simply change the name of the ZunePath property to ZUNEPATH:

<!-- Set the property to the <path>\Zune.exe -->

<CustomAction Id="SetZunePath"


              Value="[ZUNEFOLDER]Zune.exe" />


<!-- Custom action to start the executable -->

<CustomAction Id="StartZune"



              Return="asyncNoWait" />


<CustomAction Id='PrintZunePath' Error='ZUNEPATH=[ZUNEPATH]' />


Comments (3)

  1. Rob Flum says:

    Hi Alex,

     I have the reverse issue: I am setting a custom public property (that exists on the client side) during execution in the server process.  I want the value that I set in the server process to be available to the Windows Installer when I go back to the client, but when I get back, the value has remained the same as it was before I went to the server.

     Is it possible to do what I want?  Is there a window in the client process after I come back from the server to pick up this value from the registry and assign it then?

      thank you, Rob

  2. Alex Shevchuk says:

    Hmm.  That is unusual requirement.  Because there are no standard actions to run after ExecuteAction I assume you are going to use some custom action.  So, it is up to you how to pass the property back to the client process.  I don’t know if Windows Installer psses properties back from server process to client process and based on your testing it does not look like it passes them back.  So, use whatever mechanism you prefer to persist property value – registry, some file in temp folder, .ini file in windows directory, etc.  Sorry, I don’t know if any "standard" method exists for this particular situation.


  3. Rob Flum says:

     Thanks for your quick reply!

     I do have a couple of functions already to write to and read from the registry to deal with deferred and commit CAs that need values.

     However, I tried to insert an immediate Installscript CA after the ExecuteAction SA yesterday, and looking at the log, the Installer didn’t even call it, so I must be doing something wrong.


Skip to main content