$sMSI = FileOpenDialog("MSI Properties", @ScriptDir, "Windows Installer Files (*.msi)")
MsgBox(0,0,'ProductName: ' & Execute_MSI_Query($sMSI,'ProductName'))
MsgBox(0,0,'Manufacturer: ' & Execute_MSI_Query($sMSI,'Manufacturer'))
MsgBox(0,0,'ProductVersion: ' & Execute_MSI_Query($sMSI,'ProductVersion'))
Func Execute_MSI_Query($MSIPath, $PropertyName)
If FileExists($MSIPath) And $PropertyName <> '' Then
Local $Query = "SELECT Value FROM Property WHERE Property = '" & $PropertyName & "'"
$oInstaller = ObjCreate("WindowsInstaller.Installer")
$oDB = $oInstaller.OpenDataBase($MSIPath, 0)
$oView = $oDB.OpenView($Query)
$oView.Execute()
$oRecords = $oView.Fetch
$oPropValue = $oRecords.StringData(1)
If $oPropValue <> "" Then
Return $oPropValue
EndIf
EndIf
Return ""
EndFunc