Skip to content

Instantly share code, notes, and snippets.

@sevaa
Created December 20, 2022 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sevaa/4ce60ccb9bc1d6661d426649d95a1075 to your computer and use it in GitHub Desktop.
Save sevaa/4ce60ccb9bc1d6661d426649d95a1075 to your computer and use it in GitHub Desktop.
A Powershell script to change a property value in an MSI file
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