sar*_*010 2 wix bootstrapper burn
我正在使用Wix 3.7.我正在尝试创建安装我的msi的wix burn bootstrapper.我在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;
Run Code Online (Sandbox Code Playgroud)
并使用启动安装
MySampleBA.Model.Engine.Plan(LaunchAction.Install);
MySampleBA.Model.Engine.Apply(MySampleBA.hwnd);
Run Code Online (Sandbox Code Playgroud)
安装工作正常.但我在中途取消安装时遇到问题.
我看到了bootstrapper应用程序回滚链接.但我无法了解IDCANCEL以及如何通过按钮单击触发错误事件.
任何人都可以通过单击BA UI中的取消按钮详细说明如何停止安装?
许多回调(如Progress)将为ProgressEventArgs你的bootstrapper应用程序提供args(如).在args对象中,您可能会看到一个Result属性.要取消,请将Result属性设置为Result.Cancel.当回调返回Burn引擎时,它会看到您将结果设置为取消并启动回滚过程(或在该上下文中执行取消操作).