title: How to run WIX custom action on "msiexec /x ..." call?
body: <p>I'm requested to implement custom action with parameters on uninstall from command line:</p>
  <pre><code>msiexec /x MyInstaller.msi PARAM_FILE_PATH=&quot;...&quot; /qn
  </code></pre>
  <p>Looks like common approach looks like is this:</p>
  <pre><code>&lt;Custom Action=&quot;ActionName&quot; Before=&quot;RemoveFiles&quot;&gt;(REMOVE~=&quot;ALL&quot;) AND (NOT UPGRADINGPRODUCTCODE)&lt;/Custom&gt;
  &lt;Custom Action=&quot;ActionName&quot; Before=&quot;InstallFinalize&quot;&gt;(REMOVE~=&quot;ALL&quot;) AND (NOT UPGRADINGPRODUCTCODE)&lt;/Custom&gt;
  </code></pre>
  <p>But in both cases ActionName is not executed (checked via debug output).</p>
  <hr />
  <p>Tried few things.</p>
  <p>Not executed on install and uninstall:</p>
  <pre><code>&lt;Custom Action=&quot;ActionName&quot; Before=&quot;RemoveFiles&quot;&gt;&lt;/Custom&gt;
  </code></pre>
  <p>Runs only on install (opposite of what I need):</p>
  <pre><code>&lt;Custom Action=&quot;ActionName&quot; Before=&quot;InstallFinalize&quot;&gt;&lt;/Custom&gt;
  </code></pre>