在InstallFile之后和CreateShortcuts之前运行CA [英] Run CA after InstallFile and before CreateShortcuts

查看:62
本文介绍了在InstallFile之后和CreateShortcuts之前运行CA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有InstallShield 2013 Basic MSI项目
我想拥有一个将在安装文件之后但在创建快捷方式之前运行的CA,我该怎么做?
我试图创建将在InstallFile之后运行的CA,但是在运行安装程序时,我看到当它进入InstallInitialize时,它将跳过除我添加的CA之外的所有CA并运行它,然后返回InstallInitialize并运行所有

I have InstallShield 2013 Basic MSI project I want to have a CA that will run after the files are being installed but before creating the shortcuts, how can I do that ? I tried to create CA that will run after InstallFile but when running the setup I see that when it get to InstallInitialize it skip all CA excepts the one I added and it run it and after that go back to InstallInitialize and run all custom action it has skipped.

推荐答案

您在日志中看到的是延迟执行操作中。 InstallExecute InstallFinalize 之间的每个延迟操作都会在遇到脚本时写入。然后,作为 InstallFinalize 的一部分,执行脚本中的所有操作。 (除非发生故障,否则将涉及回滚操作,而跳过其余的延迟操作。)

What you're seeing here in the log is the effect of Deferred Execution actions in the InstallExecuteSequence. Each deferred action between InstallExecute and InstallFinalize is written into a script as it is encountered. Then, as part of InstallFinalize, all actions in the script are executed. (Unless there are failures, in which case rollback actions get involved, and the remaining deferred actions are skipped.)

大多数内置操作要么具有延迟组件,要么是完全推迟了。对机器的任何更改均应推迟进行。请注意,延迟的操作具有限制,尤其是关于它们可以读取哪些属性(

Most built-in actions either have deferred components, or are entirely deferred. Any changes to the machine should be done in a deferred action. Note that deferred actions have limitations, particularly about which properties they can read (through MsiGetProperty or equivalent).

这使我们回到了您的自定义操作试图做什么的问题。根据您的要求,直接的答案是您需要将其标记为推迟。这样做可能需要您更改其实现。但更重要的是,您应该考虑是否有内置的Windows Installer手段来完成您想要完成的工作,或者内置于所使用工具的方式(在本例中为InstallShield)。如果是这样,您应该宁愿使用这些内置替代方法而不是自己编写,因为编写自定义操作很容易,因为它不能处理应有的所有情况。

That brings us back to the question of what your custom action is attempting to do. By what you've asked, the direct answer is you need to mark it deferred. Doing so may require you to change its implementation. But more importantly, you should consider whether there are built-in Windows Installer means to accomplish what you want to accomplish, or ways that are built-in to the tool you're using (in this case InstallShield). If so, you should prefer using these built-in alternatives over writing your own, as it's very easy to write a custom action that does not handle every scenario it should.

这篇关于在InstallFile之后和CreateShortcuts之前运行CA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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