问题描述
我有一个引导程序(C#Windows窗体应用程序),它会从其资源中连续触发两个不同的msi文件. msi之间的实例转换是成对的",以便第一个msi的一个实例转换与第二个msi的一个实例转换共享一个UpgradeCode;这些是通过引导程序安装在一起的对.
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.
核心" msi(运行的第一个msi)包含MajorUpgrade元素,这样,当运行版本较高的核心" msi时,将首先卸载所有具有较低版本的相关产品-这包括已安装的辅助程序通过第二个msi,因为它使用相同的UpgradeCode并被识别为相关产品.这是我想要的行为,这很好,但是如果我通过控制面板手动卸载"core" msi程序,它将仅安装该程序.我也希望它也可以卸载辅助程序,即使我手动卸载了核心"程序也是如此.
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.
我是否需要编写一个自定义函数,以使用ProductCode手动调用辅助Msi程序的卸载?例如,按照此处:
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:
或者,我可以明确安排要运行的RemoveExistingProducts进行卸载吗?像这样:
Or, can I explicitly schedule RemoveExistingProducts to be run for uninstalls? Something like:
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallFinalize">REMOVE</RemoveExistingProducts>
</InstallExecuteSequence>
那是不可能的,因为在核心" msi的InstallFinalize之后,它对辅助msi一无所知吗?基本上,我想知道是否还可以使用RemoveExistingProducts标准操作来手动卸载该案例,就像对MajorUpgrade案例所做的那样.
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.
非常感谢.
推荐答案
不幸的是,答案是否定的.在维护操作期间,不会触发RemoveExistingProducts.您将在日志文件中的某些行表示:
Unfortunately, the answer is no.RemoveExistingProducts does not trigger during a maintenance operation.You will certain lines in the log file which indicate that:
跳过RemoveExistingProducts操作:当前配置是维护模式或卸载
您通常想通过使用引导程序应用程序来实现.您是否浏览过Wix的称为Burn的引导功能?刻录应该能够轻松满足您的要求.
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.
如果不适合使用Burn,那么除了编写自己的自定义代码来实现此目的外,我看不到其他任何选择.
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.
希望这会有所帮助.
这篇关于WiX-允许*手动*卸载一个msi来卸载另一个具有相同UpgradeCode的msi(而不仅仅是在MajorUpgrade期间)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!