MSI 的 PackageCode 是否存储在 Windows 中的任何位置? [英] Is the PackageCode for an MSI stored anywhere in windows?
问题描述
我可以从 \Uninstall
和其他注册表项中获取 ProductCode
,但我没有看到特定的 PackageCode
列表.
I can get the ProductCode
from the \Uninstall
and other Registry keys, but I dont see a specific PackageCode
listing.
有没有办法可靠地获取已安装的 MSI 的软件包代码列表?不建议打开每个 MSI,只是出于性能原因.
Is there any way to reliably get a list of package codes for MSI's that have been installed? Opening each MSI is not preferred, but only for performance reasons.
推荐答案
请在下面找到一个 VBScript 来检索各种类型的 MSI 信息,包括包代码.
Please find below a VBScript to retrieve MSI information of various kinds, including package code.
在桌面上创建一个 VBScript 文件并粘贴以下代码.从桌面运行脚本并查找创建的文件 msiinfo.csv
.使用 Excel 或等效工具打开此文件,然后导入逗号分隔的文件以便正确查看.
Create a VBScript file on desktop and paste the below code. Run the script from desktop and look for the file msiinfo.csv
that gets created. Open this in Excel or equivalent and import the comma separated file for proper viewing.
Set fso = CreateObject("Scripting.FileSystemObject")
Set output = fso.CreateTextFile("msiinfo.csv", True, True)
Set installer = CreateObject("WindowsInstaller.Installer")
On Error Resume Next ' we ignore all errors
' Write headers
output.writeline ("ProductName" & ", " & "Version" & ", " & "ProductCode" & ", " & "PackageCode")
For Each product In installer.ProductsEx("", "", 7)
name = product.InstallProperty("ProductName")
version=product.InstallProperty("VersionString")
productcode = product.ProductCode
packagecode=product.InstallProperty("PackageCode")
output.writeline (name & ", " & version & ", " & productcode & ", " & packagecode )
Next
output.Close
这篇关于MSI 的 PackageCode 是否存储在 Windows 中的任何位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!