通过MSI升级代码检测MSI安装的功能

时间:2021-07-16 22:38:37

I need to detect what features of MSI package are currently installed on the computer but I know only MSI upgrade code guid. Any ideas how to do this some nice way?

我需要检测计算机上当前安装的MSI软件包的哪些功能,但我只知道MSI升级代码guid。任何想法如何做到这一点很好的方式?

Thanks, Marek

谢谢,马雷克

1 个解决方案

#1


1  

If you're just migrating feature states from a previous version of the same install, you can do this by authoring the Upgrade table - fill in your Upgrade Code and version range, then set Attributes to '771' and it will copy over the feature states without removing the other installation.

如果您只是从同一安装的先前版本迁移功能状态,则可以通过编写升级表来执行此操作 - 填写升级代码和版本范围,然后将属性设置为'771',它将复制到功能状态而不删除其他安装。

If you need to do this in an unrelated app, you can do this with the Automation Interface - Use the MsiEnumRelatedProducts call to get a Product code from your Upgrade code, then use that product code with MsiEnumFeatures to get a list of features, and then with MsiQueryFeatureState to read the feature status.

如果需要在不相关的应用程序中执行此操作,可以使用自动化接口执行此操作 - 使用MsiEnumRelatedProducts调用从升级代码获取产品代码,然后将该产品代码与MsiEnumFeatures一起使用以获取功能列表,然后使用MsiQueryFeatureState来读取功能状态。

#1


1  

If you're just migrating feature states from a previous version of the same install, you can do this by authoring the Upgrade table - fill in your Upgrade Code and version range, then set Attributes to '771' and it will copy over the feature states without removing the other installation.

如果您只是从同一安装的先前版本迁移功能状态,则可以通过编写升级表来执行此操作 - 填写升级代码和版本范围,然后将属性设置为'771',它将复制到功能状态而不删除其他安装。

If you need to do this in an unrelated app, you can do this with the Automation Interface - Use the MsiEnumRelatedProducts call to get a Product code from your Upgrade code, then use that product code with MsiEnumFeatures to get a list of features, and then with MsiQueryFeatureState to read the feature status.

如果需要在不相关的应用程序中执行此操作,可以使用自动化接口执行此操作 - 使用MsiEnumRelatedProducts调用从升级代码获取产品代码,然后将该产品代码与MsiEnumFeatures一起使用以获取功能列表,然后使用MsiQueryFeatureState来读取功能状态。