Using the "WindowsInstaller.Installer" object you can pull values from an MSI file (which is essentailly a database file) using a limited version of SQL syntax referred to as WQL.
To get all properties within a given MSI...
Dim MSIobj, MSIdb, MSIView, MSIrecords Dim propName, propValue OnErrorResume Next MSIfile = "C:\Users\BobKelly\Downloads\Firefox.msi" Set MSIobj = CreateObject("WindowsInstaller.Installer") Set MSIdb = MSIobj.OpenDatabase(MSIfile, 0) Set MSIView = MSIdb.OpenView("SELECT Property,Value FROM Property") MSIView.Execute() PropCount = 0 Set MSIrecords = MSIView.Fetch propValue = MSIrecords.StringData(2) propName = MSIrecords.StringData(1) Do While Err.number = 0 If propName <> "" Then propCount = propCount + 1 WScript.Echo propName & " = " & propValue & Chr(13) & Chr(10) End If Set MSIrecords = MSIView.Fetch propValue = MSIrecords.StringData(2) propName = MSIrecords.StringData(1) Loop
Comments