windows-installer - “msiexec”如何获取平台信息
问题描述
我有一些 python 脚本可以为一些应用程序数据库生成信息。
.msi
现在我需要为指定的文件获取支持的平台。目的是区分.msi
文件内的 Win32 和 x64 应用程序。
我没有看到任何有用的东西,它基本上显示了与https://docs.microsoft.com/en-us/windows/desktop/msi/command-line-optionsmsiexec /?
相同的东西
解决方案
您可以检查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
推荐阅读
- javascript - Javascript 为什么不能在 eval() 中使用 let
- python - 如何在后台调度 Python Selenium 脚本?
- httpclient - RestSharp 到 HTTPClient RequestBody
- hibernate-tools - HibernateTools hbm2ddl ant 任务不保留顺序
- javascript - 使用条件语句过滤对象数组
- sql - Sybase SQL:分区上的行号
- javascript - 在 Javascript 中访问对象的对象
- database - 如何修复安装 mongoDB
- nginx - 如何在带有 nginx 的 debian 9 服务器上通过 https 从 phpmyadmin 发送数据?
- c# - Xamarin iOS - 使用 XCode 编辑的 .xib 的 .cs 和 .designer.cs 文件