title: Wix - how to run an exe after installfinalize upon uninstall?
body: <p>I am using wix installer to overwrite(read: modify existing registry values), add new ones etc. Upon uninstall I need to revert them back to their original state (the ones I modified). As this is not supported by Wix and thus I have to use a custom action (as I read) I want to run an exe which will run a .reg file using <code>reg import</code>. According to this site: <a href="http://www.installsite.org/pages/en/isnews/200108/index.htm" rel="nofollow">http://www.installsite.org/pages/en/isnews/200108/index.htm</a> my custom action has to run <code>After="InstallFinalize"</code> because the wix rollback would delete my registry import (as part of the rollback).
  So essentially it looks like this: Installer modifies reg values, uninstaller deletes all touched registry changes (part of rollback), my exe will restore them.</p>
  
  <p>So I did according to his how to, to start my exe with elevated rights etc.
  <a href="http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html" rel="nofollow">http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html</a></p>
  
  <pre><code>            &lt;Component Id="registry" Guid="*"&gt;
                &lt;File Id="regexe" Source="RegistryRollback.exe"/&gt;
                &lt;File Id="regfile" Source="Reg_rollback.reg" /&gt;
              &lt;/Component&gt;
  
  &lt;Property Id="LaunchRegExe" Value="[#regexe]" /&gt;
  &lt;CustomAction Id="LaunchRegExe" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/&gt;
  
  &lt;Custom Action='LaunchRegExe' After='InstallFinalize'&gt;Installed AND NOT UPGRADINGPRODUCTCODE&lt;/Custom&gt;
  </code></pre>
  
  <p>but I get an <code>Error 19  ICE77: LaunchRegExe is a in-script custom action.  It must be sequenced in between the InstallInitialize action and the InstallFinalize action in the InstallExecuteSequence table  C:\Merlin\Main\Demo\KioskDemoSetup\nw_setup\nw.wxs  250 1   nw_setup</code></p>
  
  <p>Thank you for your help!</p>