dragon-iso/installer/Dragon-ISO.Installer.wixproj
Zac Gaetano f9f58a9ff4 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>
2026-07-06 21:30:56 -04:00

44 lines
No EOL
1.8 KiB
XML

<Project Sdk="WixToolset.Sdk/5.0.2">
<PropertyGroup>
<OutputType>Package</OutputType>
<OutputName>Dragon-ISO-Setup-$(Version)</OutputName>
<!-- 64-bit MSI; suppresses ICE80 on components in Program Files (x64). -->
<Platform>x64</Platform>
<InstallerPlatform>x64</InstallerPlatform>
<!--
Built artifact location. The installer expects a published build of
Dragon-ISO.App rooted here. CI / local script:
dotnet publish src/Dragon-ISO.App/Dragon-ISO.App.csproj
-c Release -r win-x64 -self-contained false
-o $(SolutionDir)publish/Dragon-ISO
-->
<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\;ProductVersion=$(MsiProductVersion)</DefineConstants>
<!-- Code-signing hook (set externally for release builds; left empty for dev). -->
<SignOutput Condition=" '$(SignOutput)' == '' ">false</SignOutput>
</PropertyGroup>
<!--
Reference the WiX UI extension so the MSI shows a friendly progress UI
instead of the silent default.
-->
<ItemGroup>
<PackageReference Include="WixToolset.UI.wixext" Version="5.0.2" />
</ItemGroup>
</Project>