Skip to content

Automate releases with a WiX installer and GitHub Actions - #15

Merged
GoldenTadpole merged 6 commits into
masterfrom
release-automation
Nov 8, 2026
Merged

GoldenTadpole merged 6 commits into
masterfrom
release-automation

Conversation

@GoldenTadpole

@GoldenTadpole GoldenTadpole commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Replaces the manual release process with one button: Actions → Release → Run workflow → 1.4.0.

Until now a release meant building the setup in Visual Studio, renaming and zipping the MSI, creating the GitHub release by hand, editing and uploading the update XML to the bucket, editing and redeploying the website, and bumping the version in the csproj and the .vdproj.

What changed

  • Installer. Mapee.Gui.Setup.vdproj built only in Visual Studio and listed 182 files by hand. Mapee.Installer/ (WiX v5) builds with dotnet build and installs the whole publish folder, so new resource files need no installer changes.
  • Scripts. scripts/build-installer.ps1 (publish → MSI → zip) and scripts/write-release-manifests.ps1 (updater XML and website info). CI and local builds use the same scripts.
  • Build workflow. Runs on every push to master and every PR. It builds the app and the installer, so a broken build fails on the PR, and uploads the portable app as an artifact, versioned 0.0.<run>. The MSI isn't uploaded: a 0.0.N MSI won't install over a released Mapee, and the release builds its own.
  • Window title. It still shows v1.4.0, not the four-part 1.4.0.0 that .NET now writes into the exe.
  • Release workflow. Checks the version, builds, creates the tag and GitHub release (msi + zip, generated notes), then uploads the updater XML and the website info to the bucket. It signs in to Google Cloud through Workload Identity Federation, so no key is stored. Users see nothing until that last step succeeds, and the last two jobs are safe to re-run.
  • Versioning. The hardcoded AssemblyVersion, FileVersion and Version are removed. The csproj stays at 0.0.0, the release injects the real version, and UpdateChecker skips the update check for 0.x builds.
  • Update file. It now includes the MSI's SHA256, which AutoUpdater.NET verifies before installing.
  • Solution. Mapee.sln is now Mapee.slnx, generated by dotnet sln migrate with the same projects, folders and platform mappings.
  • Docs. README links are fixed, and RELEASING.md covers how to release and the one-time setup.

Worth a careful look

  • Upgrading from 1.3.0. The old installer installs per-user (no ALLUSERS) but elevated, into Program Files. Windows only upgrades a product installed in the same context, so the WiX package uses Scope="perUser", and a post-build step (Set-MsiRequiresElevation.ps1) clears the summary bit that says no elevation is needed. The UpgradeCode is unchanged.
  • Cleaning up older installs. Mapee 1.0.0 (D8483D2E-…) and 1.1.0–1.2.0 (9C606522-…) used different UpgradeCodes, so 1.3.0 never replaced them, and users who updated still have a stale "Mapee" entry sharing the install folder. The installer now removes those too. All old versions installed per-user, like this package.
  • ReadyToRun is on. With it, the exe is byte-for-byte the same size as 1.3.0's (187,554,360 bytes), so it matches the old publish settings.
  • WiX is pinned to v5 because it's MS-RL licensed. WiX v6 and later ship under the OSMF EULA.

Testing

  • Built 1.4.0 locally and compared its tables with the published 1.3.0 MSI: the same 170 install paths, UpgradeCode, shortcuts and per-user elevated context (Word Count 2, no ALLUSERS). WiX's ICE validation passes.
  • Every build now checks the MSI that ships: Windows Installer must be able to open it, and its version, Word Count (compressed, needs elevation) and file count (publish folder plus Icon.ico) must be right.
  • A local test install exposed two bugs, now fixed. Building twice without cleaning reused WiX's stale output (WiX misses version-only changes), and the elevation patch then emptied the summary information, so msiexec refused the package with error 1620. The installer is now always built from scratch, and the patch only writes when it saves. CI was never affected because every run starts from a fresh checkout.
  • Checked the update XML against AutoUpdater.NET's checksum code: the comparison is case-insensitive and the algorithm name is SHA256.
  • Both workflow files parse, but neither has run on GitHub yet. This PR triggers the Build workflow.
  • Real upgrade: a 1.3.1 test build installed over an installed 1.3.0. Windows Installer found and removed 1.3.0 and installed 1.3.1 per-user (status 0). The shortcuts point at the new exe, and the app starts with "v1.3.1" in its title bar. That same machine still had a stale 1.2.0 entry, which led to the legacy UpgradeCode fix above.
  • Legacy cleanup: a 1.3.2 test build installed on that machine (1.2.0 and 1.3.1 both registered) removed both. Only "Mapee 1.3.2" remains in Apps, the install folder holds exactly the MSI's 170 files (down from 208, so the 38 leftover 1.2.0 files are gone), and the shortcuts and app work.

Setup status

  • Google Cloud: done. A service account limited to the bucket, identity federation restricted to Voxelview/Mapee on master, and CORS for mapee.net.
  • Repository variables: GCP_WORKLOAD_IDENTITY_PROVIDER, GCP_SERVICE_ACCOUNT and GCS_PREDEFINED_ACL=publicRead are set.
  • Website: Read release info from the bucket and deploy on merge mapee.net#1 is merged and deployed by its new Deploy workflow. The download page reads the installer info from the bucket, falling back to the bundled copy until the first release.

Before the first release

🤖 Generated with Claude Code

GoldenTadpole and others added 4 commits November 8, 2026 16:25
Replace the manual release process (build the setup in Visual Studio,
create the GitHub release, edit and upload the update XML, edit the
website, bump the version in code) with a single Release workflow.

- Replace Mapee.Gui.Setup.vdproj with a WiX v5 installer that installs
  the whole publish folder. It keeps the same UpgradeCode and the same
  per-user, elevated install context, so 1.3.0 installs upgrade in place.
- Add scripts/build-installer.ps1 (publish + MSI + zip) and
  scripts/write-release-manifests.ps1 (updater XML with SHA256, website
  installer info), shared by CI and local builds.
- Add a Build workflow that uploads the installer and the portable app as
  artifacts on every push and pull request.
- Add a Release workflow: enter a version, and it builds, creates the tag
  and GitHub release, and uploads the update files to the bucket.
- Take the version from the release instead of the csproj. Local builds
  are 0.0.0 and skip the update check.
- Fix README links and add RELEASING.md with the one-time setup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The csproj used to hardcode FileVersion as 1.3.0. Now that the version
comes from the release, the SDK sets FileVersion to the four-part
1.4.0.0, which the title would have shown as "v1.4.0.0". Build the title
from the numeric version parts instead, so it keeps showing "v1.4.0".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test MSI is numbered 0.0.N, so Windows refuses to install it over a
released Mapee, and the Release workflow builds its own MSI anyway. Keep
building it in CI (so a broken installer still fails the pull request),
but upload only the portable app, which testers can run directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated with `dotnet sln Mapee.sln migrate`. It keeps the same
projects, solution folders and platform mappings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GoldenTadpole and others added 2 commits November 8, 2026 17:02
Two bugs combined when building twice without cleaning:

- WiX's incremental build doesn't notice a version-only change, and it
  hard-links its obj\ output into the output folder. The second build
  reused the previous, already-patched MSI, labelled with the wrong
  version.
- Set-MsiRequiresElevation.ps1 opened the summary information for
  writing even when nothing changed. Releasing it without Persist()
  empties it, and Windows Installer then refuses the package (error 1620).

Always build the installer from scratch (delete obj\ and bin\, pass
--no-incremental), only open the summary for writing when saving, and
read the Word Count back afterwards.

build-installer.ps1 now also checks the MSI that ships: Windows Installer
must be able to open it, and its version, Word Count and file count must
be right.

CI and the Release workflow always start from a fresh checkout, so CI
builds were not affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mapee 1.0.0 used UpgradeCode D8483D2E-... and 1.1.0-1.2.0 used
9C606522-..., so the 1.3.0 installer didn't replace them. Users who
updated from those versions still have an old "Mapee" entry in Apps,
whose files share the install folder (uninstalling it would delete files
the current version uses).

Add both retired UpgradeCodes to the Upgrade table so the installer
removes those installs too. All old versions installed per-user like
this package, so Windows Installer finds them.

Found while testing an upgrade on a machine with both 1.2.0 and 1.3.0
registered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GoldenTadpole
GoldenTadpole merged commit bd7d53d into master Nov 8, 2026
1 check passed
@GoldenTadpole
GoldenTadpole deleted the release-automation branch November 8, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant