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

Session.Mode property

· 52CE 我爱测

This is the Mode property of the Session object. This property is a value representing the designated mode flag for the current install session. Most of the mode flags are read-only externally, but a few specified flags may be set as well.

This is the Mode property of the Session object. This property is a value representing the designated mode flag for the current install session. Most of the mode flags are read-only externally, but a few specified flags may be set as well.

The MsiGetMode function returns a Boolean TRUE or FALSE, indicating whether the specific property passed into the function is currently set (TRUE) or not set (FALSE).

Note that not all the run mode values of flag are available when calling the Mode property from a deferred custom action. For more information, see Obtaining Context Information for Deferred Execution Custom Actions.

This property is read-only.

Syntax

propVal = Session.Mode

Property value

Required integer value for the flag. Must be one of the following:

Flag name Meaning
msiRunModeAdmin 0 Administrative mode install, else product install.
msiRunModeAdvertise 1 Advertise mode of install.
msiRunModeMaintenance 2 Maintenance mode database loaded.
msiRunModeRollbackEnabled 3 Rollback is enabled.
msiRunModeLogEnabled 4 Log file is active.
msiRunModeOperations 5 Executing or spooling operations.
msiRunModeRebootAtEnd 6 Reboot is needed (settable).
msiRunModeRebootNow 7 Reboot is needed to continue installation (settable).
msiRunModeCabinet 8 Installing files from cabinets and files using Media table.
msiRunModeSourceShortNames 9 Source files use only short file names.
msiRunModeTargetShortNames 10 Target files are to use only short file names.
msiRunModeWindows9x 12 Operating system is Windows 98/95.
msiRunModeZawEnabled 13 Operating system supports advertising of products.
msiRunModeScheduled 16 Deferred custom action called from install script execution.
msiRunModeRollback 17 Deferred custom action called from rollback execution script.
msiRunModeCommit 18 Deferred custom action called from commit execution script.

Requirements

Requirement Value
Version Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP

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)

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

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