首页 > 解决方案 > “msiexec”如何获取平台信息

问题描述

我有一些 python 脚本可以为一些应用程序数据库生成信息。

.msi现在我需要为指定的文件获取支持的平台。目的是区分.msi文件内的 Win32 和 x64 应用程序。

我没有看到任何有用的东西,它基本上显示了与https://docs.microsoft.com/en-us/windows/desktop/msi/command-line-optionsmsiexec /? 相同的东西

标签: windows-installer

解决方案


您可以检查Windows Installer 对象的模板摘要吗?这是一个可以转换为 Python 的 VBScript 示例:

'create installer object
Set oInstaller = CreateObject("WindowsInstaller.Installer")
'open msi in read-only mode
Set oDatabase = oInstaller.OpenDatabase("C:\Temp\test.msi", 0)
Dim streamobj : Set streamobj = oDatabase.SummaryInformation(0) '0 = read only
'read PID_TEMPLATE (template summary)
MsgBox streamobj.Property(7)
Set streamobj = Nothing
Set oDatabase = Nothing
Set oInstaller = Nothing

推荐阅读