Created
December 20, 2022 16:58
-
-
Save sevaa/4ce60ccb9bc1d6661d426649d95a1075 to your computer and use it in GitHub Desktop.
A Powershell script to change a property value in an MSI file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param($Path, $Property, $Value) | |
$i = New-Object -COM "WindowsInstaller.Installer" | |
$db = $i.OpenDatabase($Path, 2) | |
$r = $i.CreateRecord(2) | |
$r.StringData(1) = $Value | |
$r.StringData(2) = $Property | |
$vw = $db.OpenView("update Property set Value=? where Property=?") | |
$vw.Execute($r) | |
$r = $null | |
$vw.Close() | |
$vw = $null | |
$db.Commit() | |
$db = $null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment