微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Wix:未执行 CustomAction 回滚操作

如何解决Wix:未执行 CustomAction 回滚操作

我正在为我的功能编写回滚操作,并将其创建为自定义操作,还有其他多个 CA 和回滚操作。我想在所有回滚操作的最后一个执行序列中执行我的功能。 我可以指定在最后一个回滚 CA 之后执行我的回滚操作。 但我的功能 CA 和回滚是单独合并模块的一部分,它作为合并模块使用

    <CustomAction Id='CustomActionId.InstallMyFeature'  Return="ignore"  BinaryKey='msiutils' DllEntry='CAInstallmfeature' Execute="immediate"/>
    <CustomAction Id='CustomActionId.UninstallMysvfeature'  Return="ignore"  BinaryKey='msiutils' DllEntry='CAUnInstallmfeature' Execute="rollback"  Impersonate="no"/>
    <InstallExecuteSequence>
        <Custom Action='CustomActionId.InstallMyFeature'  Before='InstallFiles'>NOT Installed</Custom>
        <Custom Action='CustomActionId.UnInstallMyFeature' Before='InstallFinalize'/>
    </InstallExecuteSequence>

但是当安装失败时不执行这个回滚动作。 任何帮助都非常有用。

解决方法

您需要在回滚操作之前安排回滚操作,因此在您的示例中:

<InstallExecuteSequence>
    <Custom Action='CustomActionId.InstallMyFeature'  Before='InstallFiles'>NOT Installed</Custom>
    <Custom Action='CustomActionId.UnInstallMyFeature' Before='CustomActionId.InstallMyFeature'/>
</InstallExecuteSequence>

如果两个动作的条件相同也很好。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。