FindRelatedProducts 操作

FindRelatedProducts 操作按顺序运行 Upgrade 表的每个记录,并将每行中的升级代码、产品版本和语言与系统上安装的产品进行比较。 当 FindRelatedProducts 检测到升级信息与已安装产品之间的对应关系时,它会将产品代码附加到 UpgradeTable 的 ActionProperty 列中指定的属性。

FindRelatedProducts 操作仅在第一次安装产品时运行。 FindRelatedProducts 操作在维护模式下或卸载期间不运行。

查询的数据库表

此操作查询下表:

Upgrade 表

使用的属性

FindRelatedProducts 操作使用 UpgradeCode 属性以及编写到 Upgrade 表中的版本和语言信息来检测受将要进行的升级影响的已安装产品。 它会将检测到的产品的产品代码附加到 UpgradeTable 的 ActionProperty 列中的属性。

FindRelatedProducts 仅识别使用 Windows Installer 安装的现有产品,其 .msi 定义了 UpgradeCode 属性、ProductVersion 属性 ,以及 ProductLanguage 属性的值,后者是 Template Summary 属性中列出的语言之一。

请注意,FindRelatedProducts 使用 MsiGetProductInfo 返回的语言。 为使 FindRelatedProducts 正常工作,包作者必须确保 Property 表中的 ProductLanguage 属性设置为也在 Template Summary 属性中列出的语言。 请参阅为将来的重大升级准备应用程序

顺序限制

应将 FindRelatedProducts 置于 InstallUISequence 表InstallExecuteSequence 表中。 如果操作已在 InstallUISequence 中运行,安装程序会阻止 FindRelatedProducts 在 InstallExecuteSequence 中运行。 FindRelatedProducts 操作必须在 MigrateFeatureStates 操作RemoveExistingProducts 操作之前进行。

ActionData 消息

FindRelatedProducts 会为它在系统上检测到的每个相关产品发送一条操作数据消息。