WiX - Allowing a *manual* uninstall of one msi to uninstall another msi that shares the same UpgradeCode (and not just during the MajorUpgrade)

回眸只為那壹抹淺笑 提交于 2019-12-24 23:43:45

问题


I have a bootstrapper (C# windows forms applications) that trigger two different msi files consecutively out of its resource. The instance transforms between the msi are 'paired' such that one instance transform from the first msi shares an UpgradeCode with one instance tranform from the second msi; these are the pairs that are installed together via the bootstrapper.

The 'core' msi (the first msi that runs) includes the MajorUpgrade element such that when a higher-versioned 'core' msi is run, all related products with a lower version are first uninstalled - this includes the secondary program installed via the second msi since it uses the same UpgradeCode and is recognized as a related product. This is the behaviour I want so that's good, but if I uninstall the 'core' msi program manually via the control panel, it only installs that one. I'd like to get it to uninstall the secondary program as well, even if I manually uninstall the 'core' one.

Do I need to write a custom function that manually calls the uninstall of the secondary msi's program with the ProductCode? E.g., as per here:

Wix - uninstall different product

Or, can I explicitly schedule RemoveExistingProducts to be run for uninstalls? Something like:

<InstallExecuteSequence>
  <RemoveExistingProducts After="InstallFinalize">REMOVE</RemoveExistingProducts>
</InstallExecuteSequence>

Is that not possible because after InstallFinalize of the 'core' msi, it knows nothing about the secondary msi? Basically, I'm wondering if I can also use the RemoveExistingProducts standard action for the manual uninstall the case, like it's doing for the MajorUpgrade case.

Thanks so much in advance.


回答1:


Unfortunately, the answer is no. RemoveExistingProducts does not trigger during a maintenance operation. You will certain lines in the log file which indicate that:

Skipping RemoveExistingProducts action: current configuration is maintenance mode or an uninstall

What you are trying to do is usually achieved by making use of a bootstrapper application. Have you explored the bootstrapping feature of Wix called Burn? Burn should be able to easily handle your requirement.

If using Burn is not an option for you, then i dont see any other option other than writing your own custom code to achieve this.

Hope this helps.



来源:https://stackoverflow.com/questions/31574574/wix-allowing-a-manual-uninstall-of-one-msi-to-uninstall-another-msi-that-sha

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