Skip to main contentAuto-Update System
ClickOnce handles automatic updates for X21, ensuring users always run the latest approved version without manual intervention.
Versioning Strategy
Publish.ps1 reads the current ApplicationVersion from X21.csproj, increments the revision (for Dev/Internal builds), and writes the new version back.
- Each publish creates a tag (
v<version>-<environment>) and optionally commits the updated project file.
- The installer (
setup.exe) is renamed to x21-setup-v<version>.exe, making it clear which version a user has run.
Update Workflow
- On Excel startup, ClickOnce checks the deployment manifest hosted at the environment URL.
- If a newer version exists, the user is prompted to update (or it installs silently, depending on channel settings).
- The installer downloads only the files that changed since the previous version.
- After installation, X21 launches with the new binaries while preserving user settings and cached ports.
Forced Update Confirmation
- Before publishing to staging or production, the script calls
Confirm-InstallationForTesting to ensure the operator has installed the current production build. This is critical for validating auto-update behaviour.
- You can enforce mandatory updates by setting the ClickOnce deployment to “required” for a given version.
Handling Failures
- If an update fails, ClickOnce rolls back to the last working version automatically.
- Users can rerun
setup.exe to repair the installation.
- Logs for update activity reside in
%LOCALAPPDATA%\Apps\2.0\ and publish\publish.log.
Testing Updates
- After publishing, install the build from the new manifest, then run a
Publish.ps1 for a subsequent version. Launch Excel to ensure the update prompt appears and the new version installs correctly.
- Automation tip: keep a virtual machine snapshot of a “previous version” environment to test updates quickly.
Keeping the auto-update process healthy reduces support overhead and keeps all users aligned with the latest features and fixes.