title: WiX - Multiple Custom Actions with Parameters on Install and Uninstall (or Rollback)
body: <p>Using VS 2013, I have an old Windows Installer project that I am converting to WiX.  I have the WiX project 90% complete with the appropriate dialogs being displayed and all files copying to the appropriate locations.  However, my final task is to convert the Custom Actions that are defined in the old Windows Installer project under the sections for Install, Commit, Rollback and Uninstall.</p>
  
  <p>I have been reviewing the code from the <a href="http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html" rel="nofollow">WixToolset Site</a>, but I'm confused because I don't know how the <code>WixShellExecTarget</code> property ties to the CustomAction (as it doesn't reference that ID value) and I'm not sure how to pass in a parameter.  Also, I don't want the actions to be based on a checkbox in the dialog... they should always run.</p>
  
  <p>Basically, without using a dialog checkbox (which I "think" can be accomplised by using the <code>InstallExecuteSequence</code> section as opposed to the <code>UI\Publish</code> section), upon install (or commit), I need the following to run in order:</p>
  
  <pre><code>[INSTALLFOLDER]RegisterExtensionDotNet20.exe -i "[INSTALLFOLDER]MyNamespaceExtension.dll"
  [INSTALLFOLDER]MyApplication.exe
  </code></pre>
  
  <p>Then, upon uninstall (or rollback), <strong>before the files are deleted from the folder</strong>, I need just the following to run (note the change in the parameter from "-i" to "-u"):</p>
  
  <pre><code>[INSTALLFOLDER]RegisterExtensionDotNet20.exe -u "[INSTALLFOLDER]MyNamespaceExtension.dll"
  </code></pre>
  
  <p>Here's a snippit of my code (for just the first action... I haven't figured out how to name the second action to run MyApplication.exe yet), but it doesn't seem to be running upon install (and I haven't figured out the uninstall part).</p>
  
  <pre><code>&lt;Product&gt;
  
    &lt;!-- UI, Properties, Directories, Components and Features defined here... --&gt;
  
    &lt;Property Id="WixShellExecTarget" Value="[INSTALLFOLDER]RegisterExtensionDotNet20.exe -i '[INSTALLFOLDER]MyNamespaceExtension.dll'" /&gt;
  
    &lt;CustomAction Id="RegisterDotNetExtensionx64" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" /&gt;
  
    &lt;InstallExecuteSequence&gt;
      &lt;Custom Action="RegisterDotNetExtension" Before="InstallFinalize" /&gt;
    &lt;/InstallExecuteSequence&gt;
  
  &lt;/Product&gt;
  </code></pre>
  
  <p>Any input is greatly appreciated!</p>