luochang212/skill-zoo/tauri-updater
Claude Code and agent skill by luochang212/skill-zoo
- community
Checking that the SKILL.md file is still in the repository.
Use when adding software auto-update to a Tauri 2 desktop app, or when users ask about tauri-plugin-updater integration, app update checking, distinguishing installer vs portable builds for updates, or generating update manifests for GitHub Releases.
Install
npx vskill@latest install luochang212/skill-zoo/tauri-updaterSKILL.md
Tauri Updater
Overview
Add self-update to a Tauri 2 desktop app using tauri-plugin-updater. Covers macOS DMG, Windows NSIS (auto-install), and Windows portable (manual download link). Uses a GitHub Releases-hosted latest.json manifest with signed artifacts.
When to Use
- User asks to add "auto-update", "software update", "check for updates" to a Tauri app
- User asks about
tauri-plugin-updaterintegration - User wants to distinguish installer vs portable builds for update behavior
- User needs to generate update manifests for CI
Don't use for:
- Tauri 1.x apps (different updater API)
- Mobile apps (different update mechanisms)
- Apps distributed only via app stores (use store update mechanisms)
Architecture
Installer vs Portable
Tauri updater only works with installers (NSIS, MSI, DMG). Portable builds need a different path.
| Build | Update method | Implementation | |
|---|---|---|---|
| macOS DMG | Auto-download + install | tauri-plugin-updater full flow | |
| Windows NSIS | Auto-download + install | tauri-plugin-updater full flow | |
| Windows Portable | Link to GitHub Releases | Button opens releases page |
Detecting portable at runtime: Use a Cargo feature flag:
Normal build: cargo build --release Portable build: cargo build --release --features portable
In lib.rs, conditionally register the updater plugin and skip it when the portable feature is active:
When is_portable_build() returns true, the frontend shows a GitHub Releases link instead of the auto-update flow.
Implementation Steps
1. Generate Signing Key (one-time)
Hit enter twice for empty password. Produces:
~/.tauri/<app-name>.keyis the private key → store as GitHub SecretTAURI_SIGNING_PRIVATE_KEY~/.tauri/<app-name>.key.pubis the public key → paste intotauri.conf.json
Empty password is fine because the key lives in encrypted GitHub Secrets. Adding a password means also managing TAURI_SIGNING_PRIVATE_KEY_PASSWORD in CI.
2. Rust Backend
`src-tauri/Cargo.toml`:
`src-tauri/src/lib.rs`:
Register is_portable_build as a Tauri command in the invoke handler.
Command file (e.g. commands/settings.rs):
3. Tauri Configuration
`src-tauri/tauri.conf.json`:
The releases/latest/download/ URL pattern uses GitHub's redirect to always serve the latest release's asset.
Update CSP connect-src to allow GitHub release asset domains:
`src-tauri/capabilities/default.json`. Add these permissions:
4. Frontend
Install:
State machine:
| State | UI | Action | |
|---|---|---|---|
idle | "Check for Updates" button | check() | |
checking | Spinner, disabled button | Wait | |
up-to-date | "Up to date" | None | |
downloading | Version number + cumulative byte progress | Wait | |
available | Version number + "Download & Install" | Retry downloadAndInstall() after a download failure | |
ready-to-restart | "Restart Now" button | relaunch() | |
error | Friendly message + Retry | check() |
Key API details:
check()returnsnullwhen up-to-date (not an error)check()throws on network failure or 404 (manifest doesn't exist yet), so show a friendly message, not the raw errordownloadAndInstall()progress callback: useevent.data.chunkLength(notposition/length). Track cumulative bytes with a state updater.- Store the
Updateobject in auseRefto avoid stale closure in the progress callback.
Error handling pattern. Never expose raw errors:
5. CI Pipeline
Build job. Pass the signing key:
Rename updater artifacts (after build, before upload):
Windows portable rebuild:
The --features portable flag compiles a binary where is_portable_build() returns true and the updater plugin is not registered.
Generate `latest.json` (in release job, after all artifacts are available):
macOS universal binary: Both darwin-x86_64 and darwin-aarch64 point to the same .app.tar.gz with the same signature.
Platform Artifacts Summary
| Build | Standard output | Updater artifact | Updater uses? | |
|---|---|---|---|---|
| macOS universal | <App>-*.dmg | <App>-*.app.tar.gz + .sig | Yes (tar.gz) | |
| Windows NSIS | <App>-*.exe | <App>-*.exe + .sig | Yes (exe re-used) | |
| Windows Portable | <App>-*-Portable.zip | N/A | No (releases link) |
Common Mistakes
| Mistake | Fix | |
|---|---|---|
| Pushing tag before main | Always push main first. Tag on unpushed commit won't trigger CI on correct SHA | |
Forgetting createUpdaterArtifacts | No .app.tar.gz or .sig files will be generated | |
| CSP blocking download | Add objects.githubusercontent.com and github-releases.githubusercontent.com to connect-src | |
Missing process:allow-restart | relaunch() fails silently | |
| Showing raw errors to user | Catch and show friendly message. The first release won't have latest.json yet. That's a 404, not a bug | |
| Wrong progress event fields | Tauri 2 uses event.data.chunkLength, not position/length | |
Treating check() null as error | null = no update available, it's a success case | |
| Stale closure in download callback | Store Update in useRef, not just useState | |
| Manifest URL case mismatch | latest.json in endpoints must match the uploaded filename exactly | |
| Not cleaning up unused i18n keys | When replacing a manual releases button with updater UI, remove old translation keys |
Post-Release Notes
- First release: Existing users won't have the updater code, so they must download this release manually. After that, updates are automatic.
- Homebrew: The
.app.tar.gzand.sigare separate from the DMG. Homebrew cask formulas are unaffected. - Signature errors: If the updater reports signature verification failure, the pubkey in
tauri.conf.jsonlikely doesn't match the private key used in CI. Regenerate and redeploy. - Testing: Build a newer version to test the full download-and-install flow end-to-end.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/tauri-updater/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 31 Oct 2026, yesterday.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/luochang212/skill-zoo/tauri-updater)