Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer

RFSoC RF数据转换器系统设置函数详解:从初始化到同步的工程实践 在嵌入式系统与FPGA开发中,驱动API是连接硬件与上层应用的关键桥梁,其设计遵循分层与抽象原则,旨在封装底层寄存器操作,提供安全、高效的访问方式。系统初始化、时钟管理与多设备同步是驱动层的基础核心功能,它们确保了硬件资源的正确配置与协调,为高性能数据处理提供了稳定的运行时环境。这些技术对于实现射频直采直放、软件定义无线电等需要高带宽和精确时序的应用场景至关重要。本文聚焦于AMD/Xilinx RFSoC芯片的RF数据转换器驱动,深入解析其系统设置相关函数,涵盖安全初始化、动态PLL配置及多Tile同步等实 阅读详情

Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer

Abstract: When creating a custom action in InstallShield Professional - Windows Installer Edition you have several in-script execution options to choose from:

  • Immediate execution
  • Deferred execution
  • Rollback execution
  • Commit execution
  • Deferred execution in System Context

This article explains what these options mean and how they affect in which phase your custom action is executed at installation run time. It also helps you to insert the custom action in the correct location in the user interface or execute sequence, in order to avoid error messages like "Cannot write script record. Transaction not started."

GERMAN: Deutsche Version dieses Artikels
RUSSIAN: Перевод на русский язык доступен по ссылке: http://www.installsite.ru/go/installationphases.htm

Installation User Interface Sequence

install user inteface sequence

In the user interface sequence, you can use only immediate custom actions. This applies to the sequence table and DoAction control events as well.

The ExecuteAction standard action launches the execute sequence as a sub procedure.

After the execute actions are finished, the installer returns to the user interface sequence and executes any actions that may be specified after ExecuteAction. By default there is none, but you could insert an immediate execution custom action here, e.g. to launch another msi file.

Finally the SetupCompleteSuccess dialog is displayed, which is identified by its special sequence number of -1.

Installation Execute Sequence

install execute sequence

The part of the execute sequence between InstallInitialize and InstallFinalize is processed in two phases: First the installer goes through the actions (standard and custom actions) and notes them down in an installation script. Then it goes through the script and actually executes the commands. This second phase is where the target computer is modified, i.e. files are copied, registry entries are written, etc.

Because of these two phases it may look as if the installer went through the execute sequence twice: once building the script and once executing it. However that's not exactly true.

In addition to script creation and script execution there are two special installation phases, commit and rollback, that will be explained later in this section.

Immediate Execution during Script Creation

While the installer builds the script, only immediate execution custom actions are actually executed. All other actions (standard actions like InstallFiles and deferred execution custom actions) are only noted in the script.

All properties are stored in the script, and can no longer be changed until the script execution is finished.

Any conditions on actions are evaluated in this phase.

Deferred Execution during Script Execution

When the script is built (i.e. InstallFinalize is reached) the installer starts to execute the script. On NT based systems this phase runs in a separate process. All the script execution takes place "inside" the InstallFinalize action.

During this phase the deferred execution custom actions are executed, along with all the standard actions. They are executed in the order they have been written to the script in the script creation phase, and only if their condition was true at the time the script was built.

Because this phase runs in a separate process, deferred execution customs actions cannot directly access installer properties, and they cannot set the value of any property.

Rollback Execution

While the installer executes the installation script, it builds a rollback script. For any standard action in the installation script, a rollback command is added to the rollback script. The installer cannot automatically undo changes that custom actions make to the target system. Instead it adds any rollback custom actions to the rollback script.

In addition, backup copies of any files that the installer overwrites are stored in a temporary directory.

Rollback actions are added in the order they are encountered in the installation script, but only if their condition was true at the time the installation script was built.

If the installation is cancelled by the user or aborted because of an error during script execution, the rollback script is executed to undo any changes that have been made to the target system. This is when the rollback custom actions are executed.

The rollback script is processed from bottom up, i.e. most recent actions are undone first.

When the installer has finished to process the installation script without interruption, the rollback script and all backup files are deleted, and any commit custom actions are executed.

If Rollback has been disabled on the target computer, no rollback script is created, and no backup copies of replaced files are made.

Commit Execution

Commit custom actions are the opposite of rollback actions. They are added to a commit script while the installation script is executed, much in the same way that rollback custom actions are added to the rollback script.

Commit actions are added to the commit script only if their condition was true at the time the installation script was built.

The commit script is executed at the end of the InstallFinalize action, when the installation script has been processed, and only if installation has not been aborted.

The purpose of commit actions is to remove any backup information that had been created by a custom action.

A sample for the use of deferred, rollback and commit custom actions

Imagine a custom action that would modify an existing file. This should be a deferred execution custom action, so that this change can be undone if the setup is cancelled. Therefore the custom action would first make a backup copy of the file and then modify it.

The rollback custom action would delete the modified file and replace it with the backup copy. It would also delete the backup file.

The commit custom action would delete the backup file, because it is no longer needed now that the installation has been completed successfully.

If Rollback has been disabled on the target computer, no commit script is created. Commit is the counterpart of rollback. If rollback is disabled, your custom action should not create backup files, and therefore commit execution actions are ignored in this case.

Deferred Execution in System Context

This is a special sort of deferred custom action that is used to perform tasks with elevated privileges. On NT/2000 systems Windows Installer runs as a service and therefore would have full access to the system. However to restrict users from performing unauthorized tasks, Windows Installer uses Impersonation to perform any tasks with the privileges of the currently logged on user. However, if installation with elevated privileges is enabled by the system administrator, this type of custom action can run with system privileges. This custom action type is also called "deferred execution with no user impersonation" in the MSI documentation.

Except from the elevated privileges, this type is similar to the deferred execution custom action discussed above.

If installation with elevated privileges is not enabled, such custom actions run with user level privileges, similar to other deferred execution custom actions.

Some Rules You Should Follow

  • Immediate execution custom actions should not modify the target system because they cannot be rolled back. They should only make changes that influence the installation process, e.g. set paths and properties, select features, verify passwords, and the like.
  • Each deferred custom action should have a corresponding rollback custom action.
  • The rollback custom action should be inserted directly in front of the deferred custom action so that it is added to the rollback script immediately before the deferred custom action is executed. This ensures proper rollback in case the installation is aborted during your custom action.
  • The rollback custom action should have the same condition as the corresponding deferred custom action. This ensures that both actions are always added to the script together.
  • Custom actions that should run with elevated privileges must be of type deferred in system context.
  • Deferred, rollback and commit custom actions can only be placed between InstallInitialize and InstallFinalize. Not following this rule will result in error 2762: "Cannot write script record. Transaction not started."
  • There is no rollback if setup is aborted during user interface sequence, in execute sequence before InstallInitialize or after InstallFinalize.
  • Use commit custom actions with care. They will not be executed if rollback is disabled.

About the Author

Stefan Krueger is working as freelance setup consultant, offering support, custom programming and workshops independently from InstallShield Software Corporation. Besides his contract work, he answers questions in various newsgroups and maintains the InstallSite.org web site, a place where setup developers share resources and information among peers.

41|DeepSeek Harness 侧栏拿到的是绝对路径,为什么目录接口返回相对路径? 为什么 Harness 侧栏文件行是绝对路径,目录接口返回的却是相对路径?用真实客户端组件和本地目录方法复现,覆盖混合斜杠、中文、空格和百分号。 阅读详情

相关推荐

【无线通信】射频杂散(RF Spurious Emissions)

射频杂散(RF Spurious Emissions)是指在无线通信系统中,除了在指定频率范围内的预期信号之外,任何不需要的或非预期的射频信号。这些杂散信号可能会干扰其他通信系统,降低系统性能,并违反无线电通信法规。射频杂散通常包括谐波、次谐波、互调产物和其他非线性失真所产生的信号。

qq_38801607的博客 5441

Script Execution Order

Script Execution Order 默认情况下,不同的脚本的Awake/OnEnable/Update函数根据脚本的加载顺序依次调用(但是脚本的加载的顺序是不确定的)。但是可以通过设置脚本执行顺序来调整这些函数的执行。 1.Edit > Project Settings > Script Execution Order DefaultTime 上

SHY不小心 1969

散户逆袭神器:用通达信DIY指数发现下一个光伏储能(附龙头股筛选模板)

本文详细介绍了如何利用通达信软件的自定义指数功能,构建个人专属的行业监控工具,以发现类似光伏储能这样的潜力赛道。文章提供了从零开始的指数编制步骤、核心的龙头股筛选模板,以及五个关键的数据校验技巧,帮助散户投资者实现机构级的行业分析与机会挖掘,有效提升投资决策能力。

w3x4y的博客 486

内置CustomAction的使用

1. Quiet Execution Custom Action 安静模式下执行操作。允许用户在后台执行一些命令,但是不出现执行窗口。 例1,安静模式下执行CMD操作 ion="QtExecExample" After="TheActionYouWantItAfter"/> 采用安静模式执行CMD操作,但是不出现CMD命令窗口。注意Value中的命令以及应用程序必须加

wilsonke的专栏 2854

华为OD机试真题 新系统 2026-08-02 C++ 实现【战士技能规划设计】

你为一款动作游戏设计战士角色的技能。战士每个技能会消耗不同能量,释放技能有两个约束:连续释放技能数量不能超过 m 个,技能能量总和不能超过能量上限 k;如果超过则必须中断当前技能,进入调息状态,也就是分段。

MISAYAONE的博客 77

系统架构设计师重难点知识脑图

大家都知道现在的软考自从变成机考后,越来越难了,教程上的内容不仅全还细,几乎任何内容都有可能考,出题老师主打一个出其不意,比如2024年5月考试,连UML时序图的片段都考,这。软件工程、系统架构基础知识、系统质量属性与架构评估、软件架构的演化和维护、信息系统架构设计、层次式架构设计、云原生架构设计、面向服务架构设计、安全架构设计、大数据架构设计等。所以对于教程上的任何知识点,都需要去记忆。因此我在这里制作了一个脑图,将所有知识点集中在一个脑图中,通过首词组句法,记忆背诵,通过一个个的展开节点,加强记忆。

分享技术干货和灵感、推荐新书和好玩的项目、分享Java面试题 1108

HOWTO:InstallShield中如何调用批处理文件

版权声明: 可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息。在InstallShield中调用批处理文件其实是安装打包中很常用的一种手段,通过批处理启动服务,进行数据库初始配置等等。在实际操作中,针对不同工程类型,对批处理的调用还是有很多疑惑困扰着大家,撰写此文希望能帮助到那些被困扰的打包开发人员。这里假设我们的需求是要启动安装路径下的批处理文件Sample.bat。Instal...

weixin_33752045的博客 294

RD算法(一)初出茅庐 —— 算法原理

在《SAR成像概述》的第4节已经对各种SAR成像算法进行了一个简要的概述,本文就直接从RD算法讲起了。

5295

如何解决Office 2010 安装时提示:错误1406 安装程序无法将值clview.exe写入注册表项……”

office安装时提示:错误1406 安装程序无法将值clview.exe写入注册表项   2013-09-26 21:33:05|  分类: 计算机应用 |举报|字号 订阅 先不要点击忽略、继续等按钮,打开运行,输入regedit打开注册表,找到HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Internet Explorer/MAIN/FeatureCo

Lexicaholic的专栏 9432

15、运行语音识别应用:从Mac到微控制器的部署指南

本文详细介绍了如何在Mac上运行语音识别应用,并将其部署到Arduino Nano 33 BLE Sense和SparkFun Edge等微控制器设备上的完整流程。内容涵盖应用构建、设备特定的音频与输出实现、部署步骤、常见问题解决方案及进一步优化建议。通过本指南,开发者可快速实现基于TensorFlow Lite的嵌入式语音识别系统,并根据需求进行自定义修改与功能扩展。

l3m4n的博客 61

什么是DHCP Snooping?如何配置DHCP Snooping?

功能描述防护类型防御伪造 DHCP 服务器、避免地址冲突、增强网络安全性使用场景企业园区网、校园网、大型局域网配合机制IP Source Guard、DAI、防止 ARP 欺骗部署难度⭐⭐(简单)“DHCP Snooping,是内网 DHCP 安全防护的第一道门神。” 🛡️。

网络技术联盟站 1274

Vue开发篇之组件通信与表单:点了任务行,谁来更新列表

用四个Vue组件完成任务录入与状态切换,跟踪props、事件转发和表单草稿的归属。

code2cat的博客 267

深入剖析 Wenet 下 AISHELL-1 的 run.sh 脚本:从数据准备到模型训练

run.sh脚本用于处理 AISHELL-1 数据集的整个训练和测试流程。我们将逐步分析脚本中的每个部分,包括环境变量、参数设置、各个阶段的执行等。stage: 设置脚本的起始阶段(如数据准备)。stop_stage: 设置脚本的结束阶段。通过对 Wenet 下 AISHELL-1 的run.sh脚本的详细剖析,我们希望你能更好地理解每个步骤的功能及其背后的原理。此脚本不仅为模型训练提供了便利,也为用户自定义和扩展训练流程提供了基础。希望本教程能帮助你顺利完成语音识别项目!

帅小柏的博客 1635

鸿蒙 命令行工具:hdc(二)

本文介绍HDC(Huawei Device Connector)工具的使用方法,重点涵盖USB与TCP连接调试流程。需开启USB调试,通过USB线连接设备,使用hdclisttargets查询设备,支持hdc -t指定目标设备执行shell命令。TCP连接需在同一WiFi下启用无线调试,注意最多支持16个连接。远程连接使用s参数指定服务器地址。常见问题排查包括检查调试开关、数据线、接口、环境变量及驱动,建议优先使用USB连接以确保稳定。

梦想不只是梦与想的博客 379

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

权限判断的三段式设计:模块:功能:操作

本文基于若依3.9.2与SpringBoot3,介绍其权限控制的“模块:功能:操作”三段式设计。通过权限字符串(如system:user:edit)实现细粒度控制,支持通配符*批量授权。登录时加载用户权限集合,管理员默认拥有全部权限(*:*:*)。角色权限变更后,通过refreshPermissionByRoleId实时刷新在线用户缓存,无需重新登录;菜单权限修改则依赖getInfo接口触发同步。权限判断由SecurityUtils.hasPermi完成,基于缓存的权限集合进行匹配,确保高效、实时的权限验证

多低调的博客 242

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

Dart 之可迭代对象与生成器

从逐项读取理解 Iterable,讲清惰性计算、where/map/take 链式处理、sync* 与 yield,以及同步生成器和 Stream 的区别,配合图解、代码和测试题掌握使用方法。

2601_96393911的博客 297

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

【RHCA+】numactl命令(管理numa)

root@wuzuniao ~]# numactl -H #查看服务器上的numa数量及每个node内的cpu和内存数。[root@wuzuniao ~]# yum -y install numactl #安装工具。[root@wuzuniao ~]# numactl #输入错误就会弹出命令帮助。限制程序只使用node本地内存,不能使用其他node内存;[root@wuzuniao ~]# numactl -s #查看策略。查看、管理numa;语法格式:numactl [参数]使用哪个node的cpu。

376

gstreamerd的bin插件基本介绍

本文简要介绍GStreamer中bin插件的实现流程,重点分析其核心结构GstBin及关键函数。bin作为元素容器,通过gst_bin_add_many将子元素添加至列表,并设置父关系、总线、时钟等属性。状态管理由gst_bin_change_state_func负责,遍历子元素按序变更状态,支持异步处理与状态同步。bin在无父级时为顶层容器,其状态变化会传递至所有子元素,实现统一控制。

ZZXTIANMING的博客 195

线性表入门:从基本概念到顺序表实现

本文系统介绍线性表的基本概念及其顺序表实现。线性表是相同类型数据元素的有限序列,具有明确的逻辑结构。重点讲解顺序表的两种实现方式:静态顺序表(固定数组)和动态顺序表(动态内存)。通过定义结构体与接口函数,实现初始化、插入、删除、查找等操作,并强调动态顺序表需手动管理内存,避免泄漏。文章结合图示与代码,清晰展示顺序表的存储结构与核心算法,为后续数据结构学习奠定基础。

ACH_YYX的博客 199

C++ initializer_list 详解

本文详解C++11引入的std::initializer_list,涵盖其底层机制、基本用法及常见陷阱。它作为统一初始化的核心,提供轻量级只读视图,支持函数参数、构造函数初始化,但需注意底层数组生命周期与对象绑定,避免返回或保存临时initializer_list。重载决议中initializer_list优先级高,易引发意外行为,应谨慎使用。

本博客分享软硬件一体化开发实战。硬件涵盖 PCB 设计、STM32 等 MCU 底层开发;软件包含 C++、Rust,Qt/QML、PyQt、Slint、TouchGFX、LVGL 各类 GUI 框架。方便软硬件开发者查阅学习。欢迎关注! 298

Java集合框架核心笔记|List、Set、Map底层原理+选型+面试高频

本文系统梳理Java集合框架核心知识:Collection(List、Set、Queue)与Map双列集合体系,重点解析ArrayList、LinkedList、HashSet、HashMap等常用类的底层原理、特性及选型建议。涵盖泛型、遍历方式、线程安全问题及高频面试题,附集合选型速查表与常见异常避坑指南,适合快速掌握集合核心要点。

jiucai27的博客 245

JavaScript编程篇之异步请求:切换到待办,为什么又显示了全部任务

用可运行的任务筛选页面观察fetch的两次等待、HTTP错误、取消和迟到响应,并用请求编号保护列表与加载提示。

code2cat的博客 451

jquick-transform-function 的“一函数注册、多引擎消费“能力

Manager.invoke 是整个 JQuick 生态的"函数分发总线"。它用一个 HashMap 当路由器,用一个 interface 当统一契约,把下游引擎和函数实现解耦。引擎只负责"把用户写的表达式拆成方法名和参数",函数只负责"拿到参数返回结果"。业务规则改一处,全平台生效——这就是这套架构的核心价值。

PaoHaiJiao的博客 328

【camera 008】android camera id 注册、状态监控等状态变化 全流程梳理

应用层通过CameraManager获取可用Camera ID列表,并注册AvailabilityCallback监控相机状态变化。当相机可用性变更(如被占用或释放)时,回调会及时通知。打开相机时需提供StateCallback,用于接收设备启动、关闭或错误等状态事件,其中ERROR_CAMERA_IN_USE表示相机正被高优先级客户端占用。开发者需适时注销回调以避免资源泄漏。

universe_search的博客 43

SA-G-12 暂停恢复与升级

恢复失败主因非状态丢失,而在一致性检查缺失。即使快照完整、无错误日志,若恢复时外部环境已变(如事件窗口滑出、凭证过期),系统仍可能基于过时假设得出错误结论。关键在暂停点必须设于可重入边界,并冻结轮次等状态;恢复前需显式执行四类检查:环境快照比对、资源有效性、权限与时间窗口、幂等键一致性。建议优先补全一致性检查,避免软失败导致误判。

u010902120的博客 529
上一篇: Windows Installer 常见问题
下一篇: 一个有意思的问题(关于SendMessage)
rayvane
博客等级 码龄25年 1粉丝 6原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值