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

Examples of Conditional Statement Syntax

· 52CE 我爱测

The following provides some common instances of conditional statements. For more information, see Conditional Statement Syntax.

The following provides some common instances of conditional statements. For more information, see Conditional Statement Syntax.

Run action on removal.

For information, see Conditioning Actions to Run During Removal.

Run action only if the product has not been installed.

NOT Installed

Run action only if the product will be installed local. Do not run action on a reinstallation.

(&FeatureName=3) AND NOT(!FeatureName=3)

The term "&FeatureName=3" means the action is to install the feature local. The term "NOT(!FeatureName=3)" means the feature is not installed local.

Run action only if the feature will be uninstalled.

(&FeatureName=2) AND (!FeatureName=3)

This condition only checks for a transition of the feature from an installed state of local to the absent state.

Run action only if the component was installed local, but is transitioning out of state.

(?ComponentName=3) AND ($ComponentName=2 OR $ComponentName=4)

The term "?ComponetName=3" means the component is installed local. The term "$ComponentName=2" means that the action state on the component is Absent. The term "$ComponentName=4" means that the action state on the component is run from source. Note that an action state of advertise is not valid for a component.

Run action only on the reinstallation of a component.

?ComponentName=$ComponentName

Run action only when a particular patch is applied.

PATCH AND PATCH >< MEDIASRCPROPNAME

For more information, see the Remarks section on the PATCH property page.

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)

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

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