Skip to content

fix(bundler): notarize and staple the DMG after signing it - #15824

Open
RawNuke wants to merge 1 commit into
tauri-apps:devfrom
RawNuke:fix/notarize-dmg
Open

fix(bundler): notarize and staple the DMG after signing it#15824
RawNuke wants to merge 1 commit into
tauri-apps:devfrom
RawNuke:fix/notarize-dmg

Conversation

@RawNuke

@RawNuke RawNuke commented Aug 4, 2026

Copy link
Copy Markdown

Closes #15822

The bug

The .app bundle is notarized before the DMG is created (app.rs), but the DMG itself is only signed — never submitted to Apple for notarization and never stapled (dmg/mod.rs). The build reports success, so a developer ships a DMG that Gatekeeper rejects on first open while believing the distribution is fully notarized. The issue's reproduction confirms: xcrun stapler validate App.dmg exits 65 while the inner .app validates.

The fix

After signing the DMG, submit it for notarization and staple the ticket — mirroring the app path in app.rs exactly:

  • notarize_auth() gates the whole block, same as the app path.
  • settings.macos().skip_stapling is honored: notarize_without_stapling when set, full notarize (submit + staple) otherwise.
  • A missing team ID is a hard error (same as the app path); any other auth error logs skipping dmg notarization, {e} and continues, so builds without notarization credentials keep working with a visible warning.

This does not double-notarize the .app: it notarizes the outer container, which is the artifact users actually download.

Verification

  • cargo check on tauri-bundler: clean.
  • cargo test on tauri-bundler: 20/20 pass.
  • cargo clippy: no new warnings (the one warning in this file pre-exists on the base branch).
  • cargo fmt --check: clean.
  • Notarization itself requires Apple credentials and a Developer ID, so the runtime path is verified by code parity with the tested app.rs flow.

The .app bundle was notarized before the DMG was created, but the DMG
itself was signed and returned without ever being submitted to Apple
or stapled. The build reported success for a file Gatekeeper rejects,
so a user downloading the DMG hit the untrusted-download path while the
developer believed the distribution was signed and notarized.

Mirror the app notarization path exactly: after signing the DMG, submit
it for notarization and staple the ticket, honoring the skip_stapling
opt-out and keeping the missing-team-id hard error consistent with the
app path.

Closes tauri-apps#15822
@RawNuke
RawNuke requested a review from a team as a code owner August 4, 2026 23:35
@Legend-Master Legend-Master added the ai-slop Low effort content, see https://github.com/tauri-apps/tauri?tab=contributing-ov-file#ai-tool-policy label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-slop Low effort content, see https://github.com/tauri-apps/tauri?tab=contributing-ov-file#ai-tool-policy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] macOS DMG not notarized or stapled

2 participants