Auto-Update macOS
Overview
Automatic update system for the Electron application on macOS, bringing feature parity with Windows. macOS users receive an update notification and can install with a single click.
How it works
setupAutoUpdater(window)configures the feed URL and IPC listeners at startup- Channel (beta/stable) is auto-detected from
app.getVersion()(presence of "beta" in version string) - Feed URL points to the nuts release API:
/download/channel/{beta|stable} - On error, the
update-errorevent resets UI state viasetUpdate(false)
Key files
index.js—setupAutoUpdater(window): feed URL configuration and channel detectionsrc/store/actions.ts—setUpdate(boolean): action to show/hide the update bannersrc/services/fileProtect/ipcRenderAction.ts—update-errorlistener for UI resetsrc/services/fileProtect/storeAction.ts—actionSetUpdatedispatchpackage.json—mac.target: ["dmg", "zip"]required for auto-update compatibility.gitlab-ci.yml— .zip and *-mac.yml artifacts included in pipeline
Technical decisions
- Nuts release API rather than GitHub Releases: self-hosted infrastructure, beta/stable channel control.
setupAutoUpdateras a dedicated function: isolates auto-update logic from the rest ofindex.js, easier to test and maintain.setUpdate(boolean)rather than two separate actions: simplifies reset on error.- Target
["dmg", "zip"]:.zipis required by Squirrel.Mac for automatic updates,.dmgfor initial installation.
Known issues
- No known issues currently
Next steps
- Silent notifications with install on next restart
- Update download progress bar