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

Custom Action Execution Scheduling Options

· 52CE 我爱测

Because a custom action can be scheduled in both the UI and execute sequence tables, and can be executed either in the service or client process, a custom action can potentially execute multiple times.

Because a custom action can be scheduled in both the UI and execute sequence tables, and can be executed either in the service or client process, a custom action can potentially execute multiple times.

Note that the installer:

  • Executes actions in a sequence table immediately by default.
  • Does not execute an action if the conditional expression field of the sequence table evaluates to False.
  • Processes the UI sequence table in the client process if the internal user's interface level is set to the full UI mode (see MsiSetInternalUI for a description of UI levels).
  • Is a service registered by default when using Windows 2000 and, in this case, the execute sequence table is processed in the installer service.

You can use the following option flags to control multiple immediate execution of custom actions. To set an option, add the value in this table to the value in the Type field of the CustomAction table. None of the following flags should be used with deferred execution custom actions.

(default)

Hexadecimal: 0x00000000

Decimal: 0

Always execute. Action may run twice if present in both sequence tables.

msidbCustomActionTypeFirstSequence

Hexadecimal: 0x00000100

Decimal: 256

Execute no more than once if present in both sequence tables. Always skips action in execute sequence if UI sequence has run. No effect in UI sequence. The action is not required to be present or run in the UI sequence to be skipped in the execute sequence. Not affected by install service registration.

msidbCustomActionTypeOncePerProcess

Hexadecimal: 0x00000200

Decimal: 512

Execute once per process if in both sequence tables. Skips action in execute sequence if UI sequence has been run in same process, for example both run in the client process. Used to prevent actions that modify the session state, such as property and database data, from running twice.

msidbCustomActionTypeClientRepeat

Hexadecimal: 0x00000300

Decimal: 768

Execute only if running on client after UI sequence has run. The action runs only if the execute sequence is run on the client following UI sequence. May be used to provide either/or logic, or to suppress the UI-related processing if already done for the client session.

Note that to run a custom action during two different run modes, author two entries into the CustomAction table . For example, to have a custom action that calls a C/C++ dynamic link library (DLL) ( Custom Action Type 1) both when the mode is MSIRUNMODE_SCHEDULED and MSIRUNMODE_ROLLBACK, put two entries in the CustomAction table that call the same DLL but that have different numeric types. Include code that calls MsiGetMode to determine when to run which custom action.

Related topics

Custom Action Reference

About Custom Actions

Using Custom Actions

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)

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

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