Read ProductCode and UpgradeCode from burn installers #175
Open
Description
WiX msi installers have inconsistent ProductCode, so does burn.
This script works by extracting files using WiXToolset's built-in utility dark
, and then reading data from extracted files. WiXToolset is pre-installed in GitHub Actions runners so it should work in vedant's automation as well.
# Extract files from burn installer using WiXToolset built-in utility
dark -x .\output .\vc_redist.x64.exe
# Load installer's manifest
$manifest = [xml](Get-Content .\output\UX\BootstrapperApplicationData.xml)
# ProductCode
$manifest.BootstrapperApplicationData.WixBundleProperties.Id
# UpgradeCode
$data.BootstrapperApplicationData.WixBundleProperties.UpgradeCode
We can identify installer type by using https://www.nuget.org/packages/Vestris.ResourceLib, according to wingetcreate's code.
$rc = [Vestris.ResourceLib.ManifestResource]::new()
$rc.LoadFrom('.\VC_redist.x64.exe')
$rc.Manifest.assembly.description.Split(' ')[0].Equals('WiX', [System.StringComparison]::InvariantCulture)