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

Major Upgrades

· 52CE 我爱测

A major upgrade is a comprehensive update of a product that needs a change of the ProductCode Property.

A major upgrade is a comprehensive update of a product that needs a change of the ProductCode Property.

A typical major upgrade removes a previous version of an application and installs a new version. A major upgrade can reorganize the feature component tree. For more information, see ProductCode and Changing the Product Code.

During a major upgrade using Windows Installer, the installer searches the user's computer for applications that are related to the pending upgrade, and when it detects one, it retrieves the version of the installed application from the system registry. The installer then uses information in the upgrade database to determine whether to upgrade the installed application.

To enable the installer upgrade capabilities, each package should have an UpgradeCode Property and an Upgrade Table. Each stand-alone product or product suite should have its own UpgradeCode. For more information about using the UpgradeCode see the section Using an UpgradeCode. Each record in the Upgrade table gives a combination of the upgrade code, product version, and language information used to identify a set of products affected by the upgrade. When the FindRelatedProducts Action detects that an affected product is installed on the system, it appends the product code to a property in the ActionProperty column of the Upgrade table. The RemoveExistingProducts action and the MigrateFeatureStates Action remove or migrate the products listed in the ActionProperty list. Package authors can also follow the procedure described in the topic: Preparing an Application for Future Major Upgrades.

Windows Installer upgrade packages can be authored such that major upgrades will not install if the user already has a newer version of the application installed. For more information about how to author a package that will not install over a newer version, see Preventing an Old Package from Installing Over a Newer Version

Note:
Windows Installer uses only the first three fields of the product version. See ProductVersion Property for descriptions of these fields. If you include a fourth field in your product version, the installer ignores the fourth field.

The recommended method of applying a major upgrade by installing the full package for the updated product. For information about how to apply a major upgrade by installing the product, see Applying Major Upgrades by Installing the Product.

A major upgrade applied as a Patch Package for the product cannot be sequenced with other updates and is not an uninstallable patch. For information about how to apply a major upgrade patch package to a Windows Installer package see Applying Major Upgrades by Patching the Local Installation of the Product. The application of a major upgrade using a patch package is not recommended, instead apply major upgrades by installing the full product.

Note:
If an application is installed in the per-user installation context, any major upgrade to the application must also be performed using the per-user context. If an application is installed in the per-machine installation context, any major upgrade to the application must also be performed using the per-machine context. The Windows Installer will not install major upgrades across installation context.

You can condition custom actions that are sequenced after InstallValidate to handle major upgrades by using the UPGRADINGPRODUCTCODE property:

  • If you want a custom action to run during an uninstallation of the product, but not during the removal of the product by a major upgrade, use this condition.

    REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE

  • If you want a custom action to run only during a major upgrade, use this condition.

    UPGRADINGPRODUCTCODE

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)

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

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