title: How to remove conditionally installed features on application uninstall?
body: <p>I'm using wix to build an installer that installs different features based on a &quot;CURRENCY&quot; property passed in from the command line.</p>
  <pre><code>msiexec /i install.msi CURRENCY=&quot;GBP&quot;
  </code></pre>
  <p>Here is the feature element of the wix file:</p>
  <pre><code>&lt;Feature Id=&quot;Complete&quot; Level=&quot;1&quot; Title=&quot;My Service&quot; Display=&quot;expand&quot; InstallDefault=&quot;local&quot;&gt;
    &lt;Feature Id=&quot;MainProgram&quot; Title=&quot;My Service&quot; Display=&quot;expand&quot; Level=&quot;1&quot; Absent=&quot;allow&quot;&gt;
      &lt;ComponentRef Id=&quot;MyCoordinator&quot; /&gt;
  
      &lt;Feature Id=&quot;Foo&quot; Title=&quot;Foo&quot; Display=&quot;expand&quot; InstallDefault=&quot;followParent&quot; Level=&quot;1&quot; Absent=&quot;disallow&quot;&gt;
  
        &lt;Feature Id=&quot;UK&quot; Title=&quot;UK Settings&quot; Description=&quot;UK Plugin.&quot; Level=&quot;0&quot; InstallDefault=&quot;followParent&quot; Absent=&quot;disallow&quot;&gt;
          &lt;Condition Level=&quot;1&quot;&gt;CURRENCY = &quot;GBP&quot;&lt;/Condition&gt;   &lt;&lt;-- CONDITION
          &lt;ComponentRef Id=&quot;UK_Settings_Component&quot; /&gt;
        &lt;/Feature&gt;
  
        &lt;Feature Id=&quot;US&quot; Title=&quot;US Settings&quot; Description=&quot;US Plugin.&quot; Level=&quot;0&quot; InstallDefault=&quot;followParent&quot; Absent=&quot;disallow&quot;&gt;
          &lt;Condition Level=&quot;1&quot;&gt;CURRENCY = &quot;USD&quot;&lt;/Condition&gt;   &lt;&lt;-- CONDITION
          &lt;ComponentRef Id=&quot;US_Settings_Component&quot; /&gt;
        &lt;/Feature&gt;
  
      &lt;/Feature&gt;
  
    &lt;/Feature&gt;
  &lt;/Feature&gt;
  </code></pre>
  <p>The install process works great.  I pass in a currency and get the appropriate country's settings component installed.</p>
  <p>But when I try to uninstall the application through the &quot;add or remove programs&quot; applet, it requires the user to uninstall the application twice before removing it from the list of installed programs.  So I ran the uninstall from the command line with verbose logging.</p>
  <pre><code>&gt; msiexec /x {product-guid} /L*v &quot;uninstall_1.txt&quot;
  &gt; msiexec /x {product-guid} /L*v &quot;uninstall_2.txt&quot;
  </code></pre>
  <p>After digging through the verbose uninstall log, I believe this is because the installer is failing to remove the currency specific settings component.</p>
  <p>From the uninstall log after the <strong>second uninstall</strong> I can see that it found:</p>
  <pre><code>Component: UK_Settings_Component; Installed: Local;   Request: Null;   Action: Local
  </code></pre>
  <p>If I pass in the the currency to the uninstall command, it only requires one uninstall</p>
  <pre><code>&gt; msiexec /x {product-guid} CURRENCY=&quot;GBP&quot;
  </code></pre>
  <p><strong>Question:</strong> How do I tell it to always remove all currency components when uninstalling the application?</p>