小编vic*_*tor的帖子

如果CustomAction中有错误,如何强制WiX卸载

我有以下CustomAction:

<CustomAction Id="ActionName"
              After="InstallFinalize">
  <![CDATA[NOT Installed AND (VSTORUNTIME4="#1")]]>
</CustomAction>
Run Code Online (Sandbox Code Playgroud)

问题是当我返回ActionResult.Failure时,CustomAction中存在一个案例.在这种情况下,安装程序将显示错误消息并说安装失败,但应用程序仍然部分安装(文件已经在Program Files中,应用程序显示在卸载程序中).

我希望如果我返回ActionResult.Failure,那么安装将被中止并卸载.如果自定义操作在默认的Visual Studio安装程序中失败,会发生这种情况,我认为这更有意义.

如果自定义操作失败,有人知道如何触发卸载吗?我是否需要为WiX XML添加额外的东西?

windows-installer custom-action wix

3
推荐指数
2
解决办法
2711
查看次数

标签 统计

custom-action ×1

windows-installer ×1

wix ×1