1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
Const msiOpenDatabaseModeReadOnly = 0
'créer WindowsInstaller.Installer object
Dim oInstaller : Set oInstaller = CreateObject("WindowsInstaller.Installer")
'récupérer le chemin du ficher MSI en ligne de commande
strMsiPath = WScript.Arguments(0)
'ouvrir the MSI
Dim oDatabase : Set oDatabase = oInstaller.OpenDatabase(strmsipath, msiOpenDatabaseModeReadOnly)
'créer la vu de la table "property"
Dim sql : sql = "SELECT `Property`, `Value` FROM `Property`"
Dim regView : Set regView = oDatabase.OpenView(sql)
'exécuter la requête
regView.Execute
'récupérer la premier ligne
Dim regRecord : Set regRecord = regView.Fetch
'
While Not regRecord Is Nothing
'afficher le couple proprieté et valeur
wscript.echo "property: " & regRecord.StringData(1) & " valeur : " & regRecord.StringData(2)
'récuperer la nouvelle ligne
Set regRecord = regView.Fetch
Wend
Set regRecord = Nothing
Set oDatabase = Nothing
Set oInstaller = Nothing |
Partager