[英]How to execute Custom Action before RemoveExistingProducts with After=“InstallValidate” in WiX
我有这样的事情:
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate"/>
</InstallExecuteSequence>
由于其中一个卸载失败,我需要执行自定义操作以在RemoveExistingProducts之前解决问题。 有些东西:
<CustomAction Id="FixStuff" .. />
<InstallExecuteSequence>
<Custom Action="FixStuff" Before="RemoveExistingProducts" />
<RemoveExistingProducts After="InstallValidate"/>
</InstallExecuteSequence>
这当然不起作用,因为自定义操作不能在InstallInitialize之前。 我真的想删除InstallValidate和InstallInitialize之间的现有产品,但我想在删除现有产品之前执行FixStuff。
甚至可以这样做吗?
遗憾的是,您无法在使用当前配置的RemoveExistingProducts之前运行提升的自定义操作。
一些可能的方法是:
在InstallFinalize之前移动RemoveExistingProducts。 这解决了自定义操作问题,但是由于此方法有许多限制(组件需要在版本之间维护其名称和GUID,您的自定义操作应该知道在安装结束时执行升级等),因此可能会出现其他问题。
创建一个EXE引导程序,在启动新的MSI之前修复旧的安装程序。 此引导程序可以通过清单要求管理员权限:
http://msdn.microsoft.com/en-us/library/bb756929.aspx
使用此方法修复损坏的MSI:
msiexec / fv <path_to_msi>
当您的新程序包运行RemoveExistingProducts时,旧的缓存MSI应该被修复,它应该正确卸载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.