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

Patching Initial Installations

· 52CE 我爱测

A Windows Installer Patch (MSP) can be applied when installing an application for the first time by using the PATCH property.

A Windows Installer Patch (MSP) can be applied when installing an application for the first time by using the PATCH property.

To apply a patch the first time the application is installed, the PATCH property must be set on the command line. Specify the full path to the patch on the command line as the "PATCH={path to patch}" property-value pair.

Note that specifying the PATCH property on the command line overrides the patch applicability checks performed when using MsiApplyPatch or the /p Command Line Option.

If a patch is applied using MsiApplyPatch or the /p Command Line Option, the installer compares the applications currently installed on the computer to the list of product codes eligible to receive the patch in the Template Summary property.

When you set the PATCH property on the command line to install on first installation, the applications eligible to receive the patch is determined by validation conditions on the transforms embedded in the patch package. The recommended method for generating a patch package is to use a patch creation tool such as Msimsp.exe and PATCHWIZ.DLL. The validation conditions on transforms in the patch originate from the ProductValidateFlags column in the TargetImages table of the Patch Creation Properties (.pcp) file.

The patch can be applied the first time the application is installed by a command line, another application, or script.

The following shows first-time patching from the command line.

msiexec /I package.msi PATCH="c:\directory\patch.msp"

The following shows first-time patching from another application.

UINT uiStat = MsiInstallProduct(_T("package.msi"), _T("PATCH=c:\directory\patch.msp"));

The following shows first-time patching from script.

Dim Installer as Object
Set Installer = CreateObject("WindowsInstaller.Installer")
Installer.InstallProduct "package.msi", "PATCH=c:\directory\patch.msp"

**Windows Installer 3.0 and later:  **

Beginning with Windows Installer version 3.0, multiple patches can be applied when installing an application for the first time. Set the PATCH property to a semicolon delimited list of the patches' full paths. The following shows first-time patching of multiple patches from the command line.

msiexec /I package.msi PATCH="c:\directory\patch.msp;c:\directory\patch2.msp;c:\directory\patch3.msp"

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)

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

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