Search code examples
wixconditional-statementsreinstall

WIX. How to not reinstall a feature during repair?


In WIX I'd like a feature to be installed and uninstalled normally but not to be touched during repair.

I was not able to find a condition which would allow me to do this. My attempts has failed: the feature is reinstalled on repair (what I do not need) or is not uninstalled.

This is a sample that I tried last:

<Feature Id="aFeature" Title="A Features" Level="1">
  <ComponentRef Id="aComponent" />
  <Condition Level="0">
    <![CDATA[WixUI_InstallMode="Repair"]]>
  </Condition>
</Feature>

What is the right condition to uninstall but not re-install during repair? Or what did I do wrong?


Solution

  • This works for me:

    <Feature Id="aFeature" Title="A Features" Level="1">
      <ComponentRef Id="aComponent" />
      <Condition Level="0">
         <![CDATA[REINSTALL<>""]]>
      </Condition>
    </Feature>
    

    This way during Repair the feature is ignored and not touched, but normally uninstalled