问题描述
我正在为我们的产品开发基于WIX的instller,该产品具有基本产品和许多插件。 Base和插件将作为单独的MSI交付。仅当base可用时才能安装插件。基础和插件在ROOT文件夹(如 C:\Program files\MyProduct)下共享公用文件夹树。
I am developing WIX based instller for our product which is having a base product and many plug-ins. Base and plug-in will be shipped as separate MSIs. Plug-ins can be installed only when base is available. Base and plug-ins are sharing common folder tree under a ROOT folder like "C:\Program files\MyProduct".
我正在使用自定义操作来卸载所有依赖插件。但是插件无法正确卸载。这是非常随机的。有时三个插件被卸载,有时只有两个插件。但是我可以独立于添加/删除程序来卸载插件。
I am using custom actions to uninstall all dependant plug-ins. But the plug-ins are not uninstalling properly. It is very random. Some times three plug-ins got uninstalled and some times only two plug-ins. But I could uninstall plug-ins separately from Add/Remove programs.
我正在使用以下自定义操作...
I am using following Custom actions...
<Fragment>
<CustomAction Id='UninstallP1Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p1.log" Execute='immediate' Return='asyncNoWait' />
<CustomAction Id='UninstallP2Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p2.log" Execute='immediate' Return='asyncNoWait' />
<CustomAction Id='UninstallP3Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p3.log" Execute='immediate' Return='asyncNoWait' />
<CustomAction Id='UninstallP4Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p4.log" Execute='immediate' Return='asyncNoWait' />
<CustomAction Id='UninstallP4Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p4.log" Execute='immediate' Return='asyncNoWait' />
</Fragment>
我在我的产品脚本中将此CA称为...
I am calling this CA in my product script like...
<!--Uninstall Plug-ins -->
<Custom Action='UninstallP1Action' After='InstallFinalize'>(REMOVE="ALL")</Custom>
<Custom Action='UninstallP2Action' After='UninstallP1Action'>(REMOVE="ALL")</Custom>
<Custom Action='UninstallP3Action' After='UninstallP2Action'>(REMOVE="ALL")</Custom>
<Custom Action='UninstallP4Action' After='UninstallP3Action'>(REMOVE="ALL")</Custom>
<Custom Action='UninstallP5Action' After='UninstallP4Action'>(REMOVE="ALL")</Custom>
我的问题是,
-
当我卸载基本版本时如何彻底卸载所有插件?
How to do a clean uninstall of all plug-ins when I uninstall base?
卸载缺少插件。但是在正确卸载插件后,日志创建成功。
There is no logs created when the plug-in is missing from uninstall. But log created successfully when the plug-in uninstalled correctly. How to check this?
我知道如何在单个MSI中创建功能(针对不同的插件)。但是我们的计划是将插件作为单独的MSI交付。在WiX中还有其他可用的方法吗?
I know about creating features (for different plug-ins) within single MSI. But our plan is to ship the plug-ins as separate MSIs. Any other possible way available in WiX?
任何帮助将不胜感激!
推荐答案
您的卸载自定义操作不会等待返回。因此,他们基本上是在不等待每个进程完成的情况下依次启动卸载命令。
Your uninstall custom actions do not wait for return. So they are basically launching uninstall commands one after another without waiting for each process to finish.
Windows Installer不支持同时运行两个InstallExecuteSequences。因此,两个卸载过程无法同时运行。由于您同时启动多个卸载过程,因此其中一些失败。
Windows Installer doesn't support two InstallExecuteSequences running at the same time. So two uninstall process cannot run simultaneously. Since your launching multiple uninstall processes simultaneously, some of them fail.
一种解决方案是使用BAT文件执行卸载命令。它等待每个命令完成,然后再启动下一个命令。缺点是,卸载完成后,您无法轻松地从目标计算机上删除该BAT。
A solution is using a BAT file to execute the uninstall commands. It waits for each command to finish before launching the next one. The downside is that you can't remove that BAT easily from the target machine when your uninstall is finished.
Windows Installer会自动检测到冲突的安装或卸载过程。因此,您的插件卸载会在开始写入日志之前失败。
Windows Installer automatically detects conflicting install or uninstall processes. So your plugin uninstall fails before it starts writing a log.
不是真的。
这篇关于使用“自定义操作”卸载多个产品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!