fix(windows-msi): inject rev into MSI Version Build field

Version was static (X.Y.Z.0) across nightlies, so MajorUpgrade never triggered the automatic uninstall; the Windows Installer only compares Major.Minor.Build, ignoring the 4th field.
This commit is contained in:
Laurent Trinques
2026-06-30 18:49:43 +02:00
parent 5dac26d9c7
commit e19f523227
+7 -3
View File
@@ -74,9 +74,6 @@ jobs:
} }
} }
# Numeric MSI version: 4 digits required (e.g. 0.100.1.0)
$verMsi = "$ver.0"
# Short SHA for the display version # Short SHA for the display version
$sha = git rev-parse --short HEAD 2>$null $sha = git rev-parse --short HEAD 2>$null
if (-not $sha) { $sha = "unknown" } if (-not $sha) { $sha = "unknown" }
@@ -85,6 +82,13 @@ jobs:
$count = git rev-list HEAD --count 2>$null $count = git rev-list HEAD --count 2>$null
$rev = [int]$count + 473 $rev = [int]$count + 473
# MSI Version only compares Major.Minor.Build (the 4th field is
# ignored by Windows Installer for upgrade detection), so we
# inject rev into Build to force a real increase between
# nightlies and trigger MajorUpgrade's automatic uninstall.
$verParts = $ver -split '\.'
$verMsi = "$($verParts[0]).$($verParts[1]).$($rev % 65535)"
$verDisplay = "${ver}-r${rev}-${sha}_x86_64-win64" $verDisplay = "${ver}-r${rev}-${sha}_x86_64-win64"
echo "VERSION_MSI=$verMsi" >> $env:GITHUB_OUTPUT echo "VERSION_MSI=$verMsi" >> $env:GITHUB_OUTPUT