title: WiX Burn: Reading LaunchTarget from Registry
body: <p>I'm new with WiX, and I'm trying to have my Bootstrapper launch my installed application when it completes. To accomplish this, I'm using</p>
  
  <pre><code>&lt;Variable Name="LaunchTarget" Value="path_to_exe"/&gt;
  </code></pre>
  
  <p>However, it is not easy for me to get the path to the executable. The reason for this is because I'm using &lt;Chain&gt; to install some pre-requisites and then an msi that actually installs my exe. </p>
  
  <p>So to do this, the msi is writting the path to a known location in the registry, and then the bootstrapper reads it and uses it.</p>
  
  <p>The problem is that when the bootstrapper reads the registry, the msi hasn't run yet, so it is unable to run the executable at the end.</p>
  
  <p>Here's my WiX, if it helps:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"&gt;
      &lt;Bundle Name="My Installation" UpgradeCode="a8964402-f3fc-4878-aafd-31ecda6b685e" Version="1.0.0.0"&gt;
          &lt;BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"&gt;
              &lt;bal:WixStandardBootstrapperApplication LicenseFile="EULA.rtf"
                                                      ThemeFile="theme.xml"
                                                      SuppressOptionsUI="yes" /&gt;
          &lt;/BootstrapperApplicationRef&gt;
          &lt;Chain&gt;
              &lt;PackageGroupRef Id="NetFx40Redist"/&gt;
              &lt;ExePackage Id="OpenSSL" SourceFile="pre-requesite.exe" /&gt;
              &lt;MsiPackage Id="myInstall" SourceFile="mySetup.msi" /&gt;
          &lt;/Chain&gt;
          &lt;util:RegistrySearch Root="HKLM"
                               Key="Software\myProgram"
                               Value="myEXEPath"
                               Variable="myEXEPath"
                               Result="value"
                               Format="raw" /&gt;
          &lt;Variable Name="LaunchTarget" Value="[myEXEPath]"/&gt;
      &lt;/Bundle&gt;
  &lt;/Wix&gt;
  </code></pre>
  
  <p>So, in short, I'm trying to have the RegistrySearch run <strong>AFTER</strong> the MsiPackage installs. Can this be done? If not, what alternatives do I have?</p>
  
  <p>As I side note, if I manually fill in the registry value before installation, everything works fine. This means that besides the order things are running in, everything is working fine.</p>