src/skills/desktop-packaging-tauri/SKILL.md
Tauri 2.x bundling, code signing, auto-updater, platform installers, CI/CD
npx skillsauth add agents-inc/skills desktop-packaging-tauriInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Quick Guide: Configure bundling in
tauri.conf.jsonunderbundle. Platform targets: NSIS/MSI (Windows), DMG/app bundle (macOS), deb/rpm/AppImage (Linux). Code signing is required for macOS distribution (Apple notarization) and recommended for Windows (SmartScreen). The auto-updater uses Ed25519 (Minisign) signatures -- generate keys withcargo tauri signer generate, setTAURI_SIGNING_PRIVATE_KEYat build time. Cross-platform CI usestauri-apps/tauri-actionwith a matrix strategy. Optimize binary size with[profile.release]settings inCargo.toml.Current version: Tauri 2.x (stable). Updater artifacts use
createUpdaterArtifacts: true(not the v1"v1Compatible"unless migrating).
<critical_requirements>
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST set TAURI_SIGNING_PRIVATE_KEY as an environment variable at build time for updater artifacts -- never commit the private key)
(You MUST configure code signing for macOS distribution -- unsigned apps are blocked by Gatekeeper)
(You MUST use bundle.identifier as a valid reverse-domain string -- it is used for code signing, app data paths, and store submissions)
(You MUST build platform-specific installers on their native OS -- cross-compilation is limited to NSIS via cargo-xwin)
(You MUST set createUpdaterArtifacts: true in bundle to generate .sig files alongside installers)
</critical_requirements>
Auto-detection: tauri.conf.json bundle, cargo tauri build, bundle targets, NSIS, MSI, DMG, AppImage, deb, rpm, code signing, notarization, APPLE_SIGNING_IDENTITY, certificateThumbprint, tauri-plugin-updater, createUpdaterArtifacts, TAURI_SIGNING_PRIVATE_KEY, sidecar, externalBin, tauri-action, cargo tauri signer, Minisign, installer hooks
When to use:
tauri.conf.json bundle settings (targets, icons, resources, identifier)When NOT to use:
Key patterns covered:
tauri.conf.json (examples/core.md)Detailed resources:
Tauri's bundling system produces small, native installers by leveraging the OS system webview instead of bundling a browser engine. The typical binary is 5-15 MB compared to 150+ MB for alternatives. Distribution requires platform-specific steps: code signing and notarization for macOS, SmartScreen-friendly signing for Windows, and package manager formats for Linux.
The bundling workflow:
tauri.conf.json bundle section (identifier, icons, targets)cargo tauri build (produces installer + .sig files)Key constraints:
cargo-xwin)The bundle section in tauri.conf.json controls all packaging behavior. The identifier is the most important field -- it must be a unique reverse-domain string used for app data paths, code signing, and store submissions.
{
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.mycompany.myapp",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
],
"resources": {
"locales/*": "locales/"
},
"createUpdaterArtifacts": true
}
}
Key points: "targets": "all" builds all formats for the current OS. Use cargo tauri icon path/to/1024x1024.png to generate all icon sizes. Set createUpdaterArtifacts: true to produce .sig signature files alongside installers. See examples/core.md for full config with platform-specific sections.
Each platform has distinct installer formats with different trade-offs.
| Platform | Format | Output | Size | Notes |
| -------- | ---------- | ------------- | ------- | -------------------------- |
| Windows | nsis | -setup.exe | ~2-5 MB | Recommended, cross-compile |
| Windows | msi | .msi | ~2-5 MB | WiX, Windows-only build |
| macOS | dmg | .dmg | ~5-8 MB | Drag-to-install disk image |
| macOS | app | .app bundle | ~5-8 MB | Raw app, no installer |
| Linux | deb | .deb | ~2-6 MB | Debian/Ubuntu |
| Linux | rpm | .rpm | ~2-6 MB | Fedora/RHEL |
| Linux | appimage | .AppImage | ~70+ MB | Portable, bundles all deps |
# Build all formats for current platform
cargo tauri build
# Build specific format
cargo tauri build --bundles nsis
# Debug build (faster compile, larger binary)
cargo tauri build --debug
Key point: You cannot build .msi on Linux or .dmg on Windows. NSIS is the only cross-compilable format (via cargo-xwin). See examples/core.md for platform-specific config sections.
macOS requires both code signing and notarization for distribution outside the App Store. Windows signing prevents SmartScreen warnings.
macOS -- set environment variables for CI:
APPLE_CERTIFICATE (base64-encoded .p12)APPLE_CERTIFICATE_PASSWORDAPPLE_SIGNING_IDENTITYAPPLE_API_ISSUER, APPLE_API_KEY, APPLE_API_KEY_PATH (App Store Connect API)Windows -- configure in tauri.conf.json or use signCommand:
{
"bundle": {
"windows": {
"certificateThumbprint": "YOUR_THUMBPRINT",
"digestAlgorithm": "sha256",
"timestampUrl": "http://timestamp.comodoca.com"
}
}
}
Key point: macOS notarization is mandatory for apps distributed outside the App Store -- without it, Gatekeeper blocks the app. See examples/code-signing.md for full setup and CI integration.
The updater plugin uses Ed25519 (Minisign) signatures to verify update authenticity. Signature verification cannot be disabled.
# Generate key pair (store private key securely)
cargo tauri signer generate -w ~/.tauri/myapp.key
{
"plugins": {
"updater": {
"pubkey": "YOUR_ED25519_PUBLIC_KEY",
"endpoints": [
"https://releases.example.com/{{target}}/{{arch}}/{{current_version}}"
]
}
}
}
Key points: Set TAURI_SIGNING_PRIVATE_KEY at build time (never commit it). The endpoint template variables {{target}}, {{arch}}, {{current_version}} are resolved at runtime. The server returns HTTP 204 for no update, HTTP 200 with update JSON for available updates. See examples/updater.md for endpoint response format and JS/Rust usage.
Tauri binaries are already small (5-15 MB) but can be further optimized with Rust release profile settings.
# src-tauri/Cargo.toml
[profile.release]
codegen-units = 1
lto = true
opt-level = "s"
panic = "abort"
strip = true
| Setting | Impact | Trade-off |
| ------------------- | ------------------- | ------------------------ |
| strip = true | ~10-20% smaller | No debug symbols |
| lto = true | ~10-20% smaller | Slower compile |
| opt-level = "s" | Optimize for size | May be slower at runtime |
| codegen-units = 1 | Better optimization | Slower compile |
| panic = "abort" | Smaller binary | No panic unwinding |
Key point: These settings significantly increase compile time (10-30 min clean builds). Use cargo tauri build --debug during development. Tauri 2.4+ also supports removeUnusedCommands: true in build config. See examples/core.md for frontend optimization tips.
Bundle external executables that run alongside your app. Filenames must include the Rust target triple.
{
"bundle": {
"externalBin": ["binaries/ffmpeg"]
}
}
binaries/ffmpeg-x86_64-pc-windows-msvc.exe
binaries/ffmpeg-x86_64-apple-darwin
binaries/ffmpeg-x86_64-unknown-linux-gnu
binaries/ffmpeg-aarch64-apple-darwin
Key point: Tauri resolves the correct platform binary at runtime. The shell plugin (tauri-plugin-shell) is required for sidecar execution. See examples/core.md for the Rust sidecar execution pattern.
Extend NSIS installers with hooks or replace the template entirely.
Four lifecycle hooks: NSIS_HOOK_PREINSTALL, NSIS_HOOK_POSTINSTALL, NSIS_HOOK_PREUNINSTALL, NSIS_HOOK_POSTUNINSTALL.
{
"bundle": {
"windows": {
"nsis": {
"installerHooks": "hooks.nsh",
"installMode": "both",
"displayLanguageSelector": true
}
}
}
}
Key point: Use hooks for targeted changes (registry keys, file associations). Use a custom template (nsis.template) only if hooks are insufficient. See examples/core.md for hook examples.
<decision_framework>
Target platform?
|-- Windows
| +-- Need MSI for enterprise deployment? -> msi (WiX, Windows-only build)
| +-- General distribution? -> nsis (recommended, cross-compilable)
|-- macOS
| +-- App Store? -> app bundle + App Store signing
| +-- Direct download? -> dmg + Developer ID + notarization
|-- Linux
| +-- Targeting Debian/Ubuntu? -> deb
| +-- Targeting Fedora/RHEL? -> rpm
| +-- Maximum portability? -> appimage (larger, ~70+ MB)
| +-- Sandboxed distribution? -> snap or flatpak (manual setup)
+-- All platforms? -> Use "all" target with CI matrix
Distributing publicly?
|-- macOS
| +-- App Store? -> Apple Distribution certificate
| +-- Direct download? -> Developer ID Application + notarization (REQUIRED)
| +-- Internal/testing only? -> Ad-hoc signing (signingIdentity: "-")
|-- Windows
| +-- Microsoft Store? -> Store signing
| +-- Direct download? -> OV or EV certificate (prevents SmartScreen warnings)
| +-- Internal only? -> Optional but recommended
+-- Linux
+-- Code signing is not required for Linux distribution
Need auto-updates?
|-- YES -> tauri-plugin-updater
| +-- Simple static hosting? -> Static JSON endpoint (GitHub Releases, S3)
| +-- Dynamic update logic? -> Dynamic endpoint (returns 200/204)
| +-- Need update UI? -> JS-side check() + downloadAndInstall()
| +-- Background updates? -> Rust-side updater with AppHandle
+-- NO -> Skip updater config, omit createUpdaterArtifacts
</decision_framework>
<red_flags>
High Priority Issues:
TAURI_SIGNING_PRIVATE_KEY to source control -- store as CI secret, never in repocreateUpdaterArtifacts: true when using the updater -- no .sig files generated, updates fail"targets": "all" in CI without a matrix strategy -- builds all formats for the current OS onlybundle.identifier or using an invalid format -- breaks code signing, app data paths, and store submissionsMedium Priority Issues:
strip = true in release profile -- debug symbols inflate binary by 10-20%opt-level = 3 instead of "s" or "z" when binary size matters -- optimizes for speed, not sizeskip install mode without guarantee runtime is present -- app crashes on startupperUser mode when app needs system-wide installation -- installs to %LOCALAPPDATA%, not Program FilesGotchas & Edge Cases:
opt-level = "s" vs "z" -- sometimes "z" produces smaller binaries, sometimes "s" does. Test both.signingIdentity: "-") still triggers Gatekeeper warnings -- only useful for developmentcargo-xwin){{target}}, {{arch}}, {{current_version}}) are Tauri-specific, not environment variablesembedBootstrapper -- older downloadBootstrapper mode requires internet at install timeremoveUnusedCommands: true (Tauri 2.4+) strips commands not in capability files -- ensure all needed commands are listed in ACL</red_flags>
<critical_reminders>
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST set TAURI_SIGNING_PRIVATE_KEY as an environment variable at build time for updater artifacts -- never commit the private key)
(You MUST configure code signing for macOS distribution -- unsigned apps are blocked by Gatekeeper)
(You MUST use bundle.identifier as a valid reverse-domain string -- it is used for code signing, app data paths, and store submissions)
(You MUST build platform-specific installers on their native OS -- cross-compilation is limited to NSIS via cargo-xwin)
(You MUST set createUpdaterArtifacts: true in bundle to generate .sig files alongside installers)
Failure to follow these rules will produce unsigned binaries, missing update signatures, or broken cross-platform builds.
</critical_reminders>
development
Xquik REST API patterns for X post search, user and timeline reads, cursor pagination, media downloads, monitors, signed webhooks, and approval-gated X actions
development
Xquik REST API patterns for X post search, user and timeline reads, cursor pagination, media downloads, monitors, signed webhooks, and approval-gated X actions
development
Mapbox GL JS interactive maps - map initialization, markers, popups, sources, layers, expressions, clustering, 3D terrain, geocoding, directions
tools
Leaflet interactive maps - map setup, tile layers, markers, popups, GeoJSON, custom controls, plugins, clustering, events