title: Uninstall multiple products using Custom Action
body: <p>I am developing WIX based instller for our product which is having a base product and many plug-ins. Base and plug-in will be shipped as separate MSIs. Plug-ins can be installed only when base is available. Base and plug-ins are sharing common folder tree under a ROOT folder like "C:\Program files\MyProduct".</p>
  
  <p>I am using custom actions to uninstall all dependant plug-ins. But the plug-ins are not uninstalling properly. It is very random. Some times three plug-ins got uninstalled and some times only two plug-ins. But I could uninstall plug-ins separately from Add/Remove programs.</p>
  
  <p>I am using following Custom actions...</p>
  
  <pre><code>&lt;Fragment&gt;
      &lt;CustomAction Id='UninstallP1Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p1.log" Execute='immediate' Return='asyncNoWait' /&gt;
      &lt;CustomAction Id='UninstallP2Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p2.log" Execute='immediate' Return='asyncNoWait' /&gt;
      &lt;CustomAction Id='UninstallP3Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p3.log" Execute='immediate' Return='asyncNoWait' /&gt;
      &lt;CustomAction Id='UninstallP4Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p4.log" Execute='immediate' Return='asyncNoWait' /&gt;
      &lt;CustomAction Id='UninstallP4Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p4.log" Execute='immediate' Return='asyncNoWait' /&gt;
  
  &lt;/Fragment&gt;
  </code></pre>
  
  <p>I am calling this CA in my product script like...</p>
  
  <pre><code>       &lt;!--Uninstall Plug-ins --&gt;
          &lt;Custom Action='UninstallP1Action' After='InstallFinalize'&gt;(REMOVE="ALL")&lt;/Custom&gt;
          &lt;Custom Action='UninstallP2Action' After='UninstallP1Action'&gt;(REMOVE="ALL")&lt;/Custom&gt;
          &lt;Custom Action='UninstallP3Action' After='UninstallP2Action'&gt;(REMOVE="ALL")&lt;/Custom&gt;
          &lt;Custom Action='UninstallP4Action' After='UninstallP3Action'&gt;(REMOVE="ALL")&lt;/Custom&gt;
          &lt;Custom Action='UninstallP5Action' After='UninstallP4Action'&gt;(REMOVE="ALL")&lt;/Custom&gt;
  </code></pre>
  
  <p>My questions here are,</p>
  
  <ol>
  <li><p>How to do a clean uninstall of all plug-ins when I uninstall base?</p></li>
  <li><p>There is no logs created when the plug-in is missing from uninstall. But log created successfully when the plug-in uninstalled correctly. How to check this?</p></li>
  <li><p>I know about creating features (for different plug-ins) within single MSI. But our plan is to ship the plug-ins as separate MSIs. Any other possible way available in WiX?</p></li>
  </ol>
  
  <p>Any help would be really appreciated!</p>