1
我正在使用在DLL中定义的自定义操作在WiX中编写安装程序文件。自定义操作在卸载时运行,如果失败,我希望它停止卸载过程并回滚。该操作不会影响系统,因此我可以在InstallInitialize
之前调用它,因此它不应该有其他更改才能撤消。WIX:使用条件停止卸载?
有人告诉我,如果我定义的自定义操作的属性,然后我可以用condition
停止卸载过程如下:
<SetProperty Id="CA_mine"
Value="No" Sequence="execute"
Before="CA_mine">
Installed AND remove=ALL
</SetProperty>
<CustomAction Id="CA_mine" BinaryKey="BIN_mine" DllEntry="mine" Execute="immediate"/>
<InstallExecuteSequence>
<Custom Action="CA_mine"
Before="InstallInitialize">
Installed AND remove=ALL
</Custom>
</InstallExecuteSequence>
<Condition>
NOT (Installed AND remove=ALL) OR [CA_mine] = "No"
</Condition>
凡mine
设置属性CA_mine
是“是”如果我想要卸载停止。
这会工作吗? condition
标签何时评估?有没有更简单的方法来实现我的目标(回滚卸载时mine
失败)?