gpt4 book ai didi

wix - 使用 wix burn Bootstrapper UI 取消安装和回滚

转载 作者:行者123 更新时间:2023-12-03 03:29:11 27 4
gpt4 key购买 nike

我使用的是 Wix 3.7。我正在尝试创建 wix burn bootstrapper 来安装我的 msi。我在 BA UI 中添加了两个用于安装和取消的按钮。我正在使用 C# 进行 BA UI 设计。

我在“安装”按钮中添加了以下代码以启动安装。

  MySampleBA.Model.Engine.Detect();
MySampleBA.hwnd = IntPtr.Zero;
MySampleBA.Model.Bootstrapper.PlanBegin += this.PlanBegin;
MySampleBA.Model.Bootstrapper.DetectPackageComplete += this.DetectedPackage;
MySampleBA.Model.Bootstrapper.DetectComplete += this.DetectComplete;
MySampleBA.Model.Bootstrapper.PlanPackageBegin += this.PlanPackageBegin;
MySampleBA.Model.Bootstrapper.PlanComplete += this.PlanComplete;
MySampleBA.Model.Bootstrapper.ExecuteMsiMessage += this.ExecuteMsiMessage;
MySampleBA.Model.Bootstrapper.ExecuteProgress += this.ApplyExecuteProgress;
MySampleBA.Model.Bootstrapper.PlanMsiFeature += this.PlanMsiFeature;
MySampleBA.Model.Bootstrapper.PlanPackageComplete += this.PlanPackageComplete;
MySampleBA.Model.Bootstrapper.Progress += this.ApplyProgress;
MySampleBA.Model.Bootstrapper.CacheAcquireProgress += this.CacheAcquireProgress;
MySampleBA.Model.Bootstrapper.CacheComplete += this.CacheComplete;
MySampleBA.Model.Bootstrapper.Error += this.ExecuteError;
MySampleBA.Model.Bootstrapper.ExecutePackageComplete += this.ExecuteComplte;

并使用

启动安装
  MySampleBA.Model.Engine.Plan(LaunchAction.Install);
MySampleBA.Model.Engine.Apply(MySampleBA.hwnd);

安装工作正常。但我在中途取消安装时遇到问题。

我看到 bootstrapper application rollback 链接。但我无法了解 IDCANCEL 以及如何通过单击按钮触发错误事件。

谁能详细说明如何通过单击 BA UI 中的取消按钮来停止安装吗?

最佳答案

许多回调(例如 Progress)将为您的 Bootstrap 应用程序提供参数(例如 ProgressEventArgs)。在 args 对象中,您可能会看到一个 Result 属性。要取消,请将 Result 属性设置为 Result.Cancel。当回调返回到 Burn 引擎时,它会看到您将结果设置为取消并启动回滚过程(或执行该上下文中取消意味着的任何操作)。

关于wix - 使用 wix burn Bootstrapper UI 取消安装和回滚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15323427/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com