WiX动作序列 [英] WiX Action Sequence

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

问题描述

运行WiX设置时,我一直在寻找动作列表及其顺序。官方网站似乎不提供任何信息。

I was looking for list of actions and their sequence when running a WiX setup. Somehow the official website doesn't seem to provide any information.

基本问题是我想正确安排自定义操作。通常,我需要使用regsvr32.exe注册DLL,并且只有将文件复制到硬盘后才能完成此操作。但是,自定义操作

The basic problem is that I want to schedule my custom actions correctly. Typically I need to register a DLL with regsvr32.exe, and this can only be done once the files are copied to the harddrive. However the custom action

<Custom Action="RegisterShellExt" After="InstallFiles">

失败,并显示错误消息找不到文件。

failed with the error message "file not found".

然后我所做的就是使用WiX Edit对MSI的日志进行分析,发现操作 InstallFiles 存在更多不止一次。有效的是,文件仅在第二次出现时才被写入。因此,我将自定义操作更改为以下内容:

What I've done then is analizing the log of my MSI with WiX Edit, and I've found that the Action InstallFiles exists more than once. And effectively the files are written only the second time it appears. So I changed my custom action to the following :

<Custom Action="RegisterShellExt" Before="InstallFinalize">

这是我从MSI日志中提取的顺序:

Here is the sequence I've extracted from the logs of my MSI:

Action start 15:16:49: INSTALL.
Action start 15:16:49: PrepareDlg.
Action start 15:16:49: AppSearch.
Action start 15:16:49: LaunchConditions.
Action start 15:16:49: ValidateProductID.
Action start 15:16:49: DIRCA_NEWRETARGETABLEPROPERTY1.5D429292039C46FCA3253E37B4DA262A.
Action start 15:16:50: CostInitialize.
Action start 15:16:50: FileCost.
Action start 15:16:50: CostFinalize.
Action start 15:16:50: WelcomeDlg.
Action 15:16:51: LicenseAgreementDlg. Dialog created
Action 15:16:53: CustomizeDlg. Dialog created
Action 15:16:55: VerifyReadyDlg. Dialog created
Action start 15:16:56: ProgressDlg.
Action start 15:16:56: ExecuteAction.
Action start 15:16:58: INSTALL.
Action start 15:16:58: AppSearch.
Action start 15:16:58: LaunchConditions.
Action start 15:16:58: ValidateProductID.
Action start 15:16:58: CostInitialize.
Action start 15:16:59: FileCost.
Action start 15:16:59: CostFinalize.
Action start 15:16:59: InstallValidate.
Action start 15:17:00: InstallInitialize.
Action start 15:17:08: ProcessComponents.
Action 15:17:09: GenerateScript. Generating script operations for action:
Action ended 15:17:09: ProcessComponents. Return value 1.
Action start 15:17:09: UnpublishFeatures.
Action start 15:17:09: RemoveShortcuts.
Action start 15:17:09: RemoveFiles.
Action start 15:17:09: InstallFiles.
Action start 15:17:10: CreateShortcuts.
Action start 15:17:10: RegisterUser.
Action start 15:17:10: RegisterProduct.
Action start 15:17:10: PublishFeatures.
Action start 15:17:10: PublishProduct.
Action start 15:17:10: ConfigureInstaller.
Action start 15:17:10: InstallFinalize.
Action 15:17:10: ProcessComponents. Updating component registration
Action 15:17:12: InstallFiles. Copying new files
Action 15:17:21: CreateShortcuts. Creating shortcuts
Action 15:17:21: RegisterProduct. Registering product
Action 15:17:23: ConfigureInstaller. [[note: CustomAction]]
Action 15:17:22: PublishFeatures. Publishing Product Features
Begin CustomAction 'ConfigureInstaller'
Action 15:17:28: RollbackCleanup. Removing backup files
Action ended 15:17:28: InstallFinalize. Return value 1.
Action start 15:17:28: RegisterShellExt. [[note: CustomAction]]
Action ended 15:17:33: INSTALL. Return value 1.
Action start 15:17:35: ExitDialog.

有人知道官方列表吗?

推荐答案

简短的答案-您应该推迟自定义操作并在InstallFiles之后安排(如果它依赖于已安装的文件,我认为是这样)。

The short answer - you should make you custom action deferred and schedule after InstallFiles (if it relies on installed file, which I think it does).

答案很长-您应该熟悉脚本执行术语。 在MSDN上详细了解它。当您首次在日志文件中看到InstallFiles时,即是立即执行操作,然后将延迟的操作写入并计划到安装脚本中。第二次是它实际执行(和安装文件)的时间。如果您推迟操作,则在日志文件中会看到相同的行为。

The long answer - you should get acquainted with in-script execution term. Read more about it on MSDN. When you see the InstallFiles the first time in the log file, it's when immediate actions run and deferred actions are written and scheduled to the installation script. The second time is when it actually executes (and installs files). If you make your action deferred, you'll see the same behavior for it in the log file.

这听起来可能不太清楚,但是直到您详细了解其设计工作方式。

This might sound not very clear, but it can't until you read more about the way it is designed to work.

这篇关于WiX动作序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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