fix(installer): bind MSI ProductVersion to the build version

Package.wxs hardcoded Version=1.0.0.0, so every MSI ever produced claimed
ProductVersion 1.0.0.0 and MajorUpgrade could never see a newer version --
in-place upgrades silently degraded to same-version behavior. The wixproj now
derives a numeric x.y.z from $(Version) (MSI forbids prerelease suffixes in
ProductVersion) and feeds it to the WiX preprocessor.

Verified locally: Dragon-ISO-Setup-1.2.0-beta.1.msi carries ProductVersion
1.2.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Zac Gaetano 2026-07-06 21:30:56 -04:00
parent 6a141c1031
commit f9f58a9ff4
2 changed files with 11 additions and 2 deletions

View file

@ -17,8 +17,17 @@
-->
<PublishDir>$(MSBuildThisFileDirectory)..\publish\Dragon-ISO\</PublishDir>
<!--
MSI ProductVersion must be numeric x.y.z (no -beta/-rc suffix), and it is
what MajorUpgrade compares — so it must track the real build version, not
a hardcoded literal. Strip any prerelease suffix from $(Version). Note:
two prereleases of the same x.y.z share a ProductVersion and won't
upgrade over each other; bump the patch digit between betas.
-->
<MsiProductVersion>$([System.Text.RegularExpressions.Regex]::Match('$(Version)', '^\d+\.\d+(\.\d+)?').Value)</MsiProductVersion>
<!-- Pass MSBuild values into WiX preprocessor. -->
<DefineConstants>PublishDir=$(PublishDir);AssetsDir=$(MSBuildThisFileDirectory)..\src\Dragon-ISO.App\Assets\</DefineConstants>
<DefineConstants>PublishDir=$(PublishDir);AssetsDir=$(MSBuildThisFileDirectory)..\src\Dragon-ISO.App\Assets\;ProductVersion=$(MsiProductVersion)</DefineConstants>
<!-- Code-signing hook (set externally for release builds; left empty for dev). -->
<SignOutput Condition=" '$(SignOutput)' == '' ">false</SignOutput>

View file

@ -23,7 +23,7 @@
<Package Name="Dragon-ISO"
Manufacturer="Wild Dragon LLC"
Version="1.0.0.0"
Version="$(var.ProductVersion)"
UpgradeCode="9F4A8B2C-1D3E-4A5B-9C6D-8E7F0A1B2C3D"
Scope="perMachine"
Compressed="yes"