diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index e1b37bd80..e647c9720 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -110,6 +110,7 @@ jobs: # Updater /usr/libexec/PlistBuddy -c "Set :SUPublicEDKey $SPARKLE_KEY_PUB" "macos/build/Release/Ghostty.app/Contents/Info.plist" + /usr/libexec/PlistBuddy -c "Delete :SUEnableAutomaticChecks" "macos/build/Release/Ghostty.app/Contents/Info.plist" - name: Codesign app bundle env: @@ -261,6 +262,7 @@ jobs: # Updater /usr/libexec/PlistBuddy -c "Set :SUPublicEDKey $SPARKLE_KEY_PUB" "macos/build/Release/Ghostty.app/Contents/Info.plist" + /usr/libexec/PlistBuddy -c "Delete :SUEnableAutomaticChecks" "macos/build/Release/Ghostty.app/Contents/Info.plist" - name: Codesign app bundle env: diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index a9aba4aa5..59be2a17c 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -172,6 +172,7 @@ jobs: # Updater /usr/libexec/PlistBuddy -c "Set :SUPublicEDKey $SPARKLE_KEY_PUB" "macos/build/Release/Ghostty.app/Contents/Info.plist" + /usr/libexec/PlistBuddy -c "Delete :SUEnableAutomaticChecks" "macos/build/Release/Ghostty.app/Contents/Info.plist" - name: Codesign app bundle env: diff --git a/.github/workflows/release-tip.yml b/.github/workflows/release-tip.yml index a6caa64ce..e239dda4f 100644 --- a/.github/workflows/release-tip.yml +++ b/.github/workflows/release-tip.yml @@ -205,6 +205,7 @@ jobs: # Updater /usr/libexec/PlistBuddy -c "Set :SUPublicEDKey $SPARKLE_KEY_PUB" "macos/build/Release/Ghostty.app/Contents/Info.plist" + /usr/libexec/PlistBuddy -c "Delete :SUEnableAutomaticChecks" "macos/build/Release/Ghostty.app/Contents/Info.plist" - name: Codesign app bundle env: @@ -419,6 +420,7 @@ jobs: # Updater /usr/libexec/PlistBuddy -c "Set :SUPublicEDKey $SPARKLE_KEY_PUB" "macos/build/Release/Ghostty.app/Contents/Info.plist" + /usr/libexec/PlistBuddy -c "Delete :SUEnableAutomaticChecks" "macos/build/Release/Ghostty.app/Contents/Info.plist" - name: Codesign app bundle env: @@ -593,6 +595,7 @@ jobs: # Updater /usr/libexec/PlistBuddy -c "Set :SUPublicEDKey $SPARKLE_KEY_PUB" "macos/build/Release/Ghostty.app/Contents/Info.plist" + /usr/libexec/PlistBuddy -c "Delete :SUEnableAutomaticChecks" "macos/build/Release/Ghostty.app/Contents/Info.plist" - name: Codesign app bundle env: diff --git a/macos/Ghostty-Info.plist b/macos/Ghostty-Info.plist index 914c6ed6b..dcce61373 100644 --- a/macos/Ghostty-Info.plist +++ b/macos/Ghostty-Info.plist @@ -96,6 +96,8 @@ + SUEnableAutomaticChecks + SUPublicEDKey wsNcGf5hirwtdXMVnYoxRIX/SqZQLMOsYlD3q3imeok= diff --git a/macos/Sources/App/macOS/AppDelegate.swift b/macos/Sources/App/macOS/AppDelegate.swift index 7b0ff6fc2..7ebf52d3d 100644 --- a/macos/Sources/App/macOS/AppDelegate.swift +++ b/macos/Sources/App/macOS/AppDelegate.swift @@ -484,11 +484,18 @@ class AppDelegate: NSObject, default: UserDefaults.standard.removeObject(forKey: "NSQuitAlwaysKeepsWindows") } - // Sync our auto-update settings - updaterController.updater.automaticallyChecksForUpdates = - config.autoUpdate == .check || config.autoUpdate == .download - updaterController.updater.automaticallyDownloadsUpdates = - config.autoUpdate == .download + // Sync our auto-update settings. If SUEnableAutomaticChecks (in our Info.plist) is + // explicitly false (NO), auto-updates are disabled. Otherwise, we use the behavior + // defined by our "auto-update" configuration. + if Bundle.main.infoDictionary?["SUEnableAutomaticChecks"] as? Bool != false { + updaterController.updater.automaticallyChecksForUpdates = + config.autoUpdate == .check || config.autoUpdate == .download + updaterController.updater.automaticallyDownloadsUpdates = + config.autoUpdate == .download + } else { + updaterController.updater.automaticallyChecksForUpdates = false + updaterController.updater.automaticallyDownloadsUpdates = false + } // Config could change keybindings, so update everything that depends on that syncMenuShortcuts(config)