1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Const msiOpenDatabaseModeTransact = 1
'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)
'open the MSI (the first argument supplied to the vbscript)
Dim oDatabase : Set oDatabase = oInstaller.OpenDatabase(strMsiPath,msiOpenDatabaseModeTransact)
'créer la vu de la table "File"
Dim sql : sql = "UPDATE `File` SET `File`.`Attributes`=16384 WHERE `File`.`Attributes`<>16384"
Dim regView : Set regView = oDatabase.OpenView(sql)
'exécuter la requête
regView.Execute
'Enregistrer la modification de la bade de donnée
oDatabase.Commit
Set regRecord = Nothing
Set oDatabase = Nothing
Set oInstaller = Nothing |
Partager