WIX. How to not reinstall a feature during repair?

廉价感情. 提交于 2019-12-10 17:51:06

问题


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?


回答1:


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




回答2:


The only way I can think of is to give all the components in that feature an empty guid, that's the signal to Windows Installer not to do anything with them, such as repair them, patch them, uninstall them. If the product is already shipped it's too late for that. However that's a drastic step that is normally necessary only when you want to install some things for temporary use and then delete them. So you are fighting the framework here. It's look like you have a problem that disabling feature repair might solve, so why not describe the problem to see if there is another solution?



来源:https://stackoverflow.com/questions/28816058/wix-how-to-not-reinstall-a-feature-during-repair

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!