Wix Bootstrapper:引导程序事件序列 [英] Wix Bootstrapper: Sequence of Bootstrapper events

查看:34
本文介绍了Wix Bootstrapper:引导程序事件序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始玩托管 Boostrapper 类和事件.简而言之,我添加了 BoostrapperCore.dll,它会给你命名空间

I've started playing with Managed Boostrapper Classes and events. Making story short, I've added BoostrapperCore.dll and it would give you the namespace

Microsoft.Tools.WindowsInstallerXml.Bootstrapper

Microsoft.Tools.WindowsInstallerXml.Bootstrapper

我能够从不同博客中的一些示例中获得一些信息.例如,入口点是 BootstrapperApplication.Run(),在引导程序应用程序准备运行时调用.

I was able to get some info from some examples present in different blogs. For instance, the Entry point is BootstrapperApplication.Run(), is called when bootstrapper application is ready to run.

然后有这样的事件:

BoostrapperApplication.DetectBegin
BoostrapperApplication.DetectPackageBegin
BoostrapperApplication.DetectForward

等等等等...

问题:是否有任何精确的文档/在线帮助提供 Microsoft.Tools.WindowsInstallerXml.Bootstrapper 命名空间中存在的事件和方法的详细信息和顺序?

Question: Is there any precise documentation/online help which provide the details and sequence of Events and Methods present in Microsoft.Tools.WindowsInstallerXml.Bootstrapper namespace?

那肯定会节省很多时间...

That would definitely save a lot of time...

问候

推荐答案

虽然 源码在 git 上,我还没有找到关于这些事件的大量文档.

While the source code is on git, I'm yet to find a significant amount of documentation for these events.

就顺序而言,WiX 引导程序有 3 个主要阶段(所有这些阶段都是异步发生的)

As far as order goes, a the WiX bootstrapper has 3 main phases (all of which happen asynchronously)

这是刻录引擎试图找出已经安装了什么(如果有的话)的时候.bootstrapper 应用程序通过调用 Engine.Detect 启动此过程,您可能希望在 bootstrapper 启动后立即执行此操作,因为您需要此结果来决定是否显示安装、卸载或升级用户界面.

This is when the Burn engine tries to figure out what (if anything) is already installed. The bootstrapper application starts this process by calling Engine.Detect, which you will probably want to do as soon as the bootstrapper starts, as you need the outcome of this in order to decide whether to show install, uninstall or upgrade UI.

在此阶段,引擎将引发 OnDetect... 事件以告诉引导程序应用程序它找到了什么.

During this phase the engine will raise the OnDetect... events to tell the bootstrapper application about what it finds.

这是刻录引擎弄清楚它要做什么的时候.引导程序应用程序通过调用 Engine.Plan 来启动此过程,指定所需的操作(例如安装、卸载、升级等).这通常在 Apply 阶段之前完成,例如在用户点击开始"之后按钮).OnPlan... 事件在此阶段引发.

This is when the Burn engine figures out what its going to do. The bootstrapper application starts this process by calling Engine.Plan, specifying the desired operation (e.g. Install, Uninstall, Upgrade etc...). This is normally done right before the Apply phase, e.g. after the user clicks on the "Go" button). The OnPlan... events are raised in this phase.

这是 Burn 引擎实际安装或卸载包中的包的时间,并在引导程序应用程序调用 Engine.Apply 时启动.其余消息的绝大多数是在此阶段提出的,用于进度和信息的组合.错误报告,或允许引导程序应用程序处理某些事情(例如 OnResolveSource,可用于提示用户查找引擎无法定位的文件)

This is when the Burn engine actually installs or uninstalls packages in the bundle, and starts when the bootstrapper application calls Engine.Apply. The vast majority of the remaining messages are raised during this phase for a combination of progress & error reporting, or to allow the bootstrapper application to handle certain things (e.g. OnResolveSource, which can be used to prompt the user to find file that the engine cannot locate)

Apply 有两个子阶段,Cache 和 Execute.

Apply has two sub-phases, Cache and Execute.

我可以看到只有 3 个事件没有在这 3 个阶段之一中引发:

There are only 3 events that I can see that are not raised during one of these 3 phases:

  • OnStartup,在引导程序首次启动时引发(基本引导程序应用程序调用 Run 入口点作为处理此事件的一部分)
  • OnShutdown,在引导程序退出时引发
  • OnSystemShutdown,当 WM_QUERYENDSESSION 收到窗口消息
  • OnStartup, which is raised when the bootstrapper first starts (the base bootstrapper application calls the Run entry point as part of handling this event)
  • OnShutdown, raised when the bootstrapper is exiting
  • OnSystemShutdown, raised when the WM_QUERYENDSESSION window message is received

您绝对需要处理的事件是 OnDetectCompleteOnPlanCompleteOnApplyComplete,它们将按此顺序发生.

The events you absolutely need to handle are OnDetectComplete, OnPlanComplete, OnApplyComplete, which will happen in that order.

这篇关于Wix Bootstrapper:引导程序事件序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆