大网数据广告活动
安装更新与部署

Commit Custom Actions

· 52CE 我爱测

Commit Custom actions are executed upon successful completion of the installation script.

Commit Custom actions are executed upon successful completion of the installation script. If the InstallFinalize action is successful, the installer will then run any existing Commit Custom actions. The only mode parameter the installer sets in this case is MSIRUNMODE_COMMIT. See MsiGetMode for a description of the run mode parameters.

A commit custom action can be specified by adding an option flag to the Type field of the CustomAction table. See Custom Action In-Script Execution Options for the option flag designating a commit custom action.

A commit custom action is the complement to a rollback custom action and can be used with rollback custom actions to reverse custom actions that make changes directly to the system.

Note that a rollback custom action may not be able to remove all of the changes made by commit custom actions. Although the installer writes both rollback and commit custom actions into the rollback script, commit custom actions only run after the installer has successfully processed the installation script. Commit custom actions are the first actions to run in the rollback script. If a commit custom action fails, the installer initiates rollback but can only rollback those operations already written to the rollback script. This means that depending on the commit custom action, a rollback may not be able to undo the changes made by the action. You can ignore failures in commit custom actions by authoring the custom action to ignore return codes.

Rollback and commit custom actions do not run when rollback is disabled. If a package author requires these types of custom actions for proper installation, they should use the RollbackDisabled Property in a condition that prevents the installation from continuing when rollback is disabled.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。