Skip to content

Commit ad265db

Browse files
committed
fix: remove Sparkle XPC services so auto-update installer launches
Sparkle 2's XPC services (Downloader.xpc, Installer.xpc) exist to let sandboxed apps perform privileged install steps out-of-process. Our app is not sandboxed, and per Sparkle's own docs non-sandboxed apps MUST remove the XPC services — shipping them in a non-sandboxed bundle causes launchd to reject the XPC launch and Sparkle reports "An error occurred while launching the installer". Changes: - Delete Frameworks/Sparkle.framework/Versions/B/XPCServices (and the top-level symlink) immediately after copying the framework in both the CI workflow and the local build.sh. - Drop the corresponding XPC signing commands from the Sign step — the services are no longer present to sign. With XPCs removed, Sparkle falls back to its in-process + Autoupdate installer path, which is the supported path for non-sandboxed apps. Applies to v1.0.7 and later; v1.0.5 and v1.0.6 already shipped with the broken XPC services baked into their bundles, so users on those versions will need to download v1.0.7+ manually.
1 parent 169e31d commit ad265db

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

‎.github/workflows/build-release.yml‎

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ jobs:
5757
SPARKLE_FW="$SPARKLE_XCFRAMEWORK/macos-arm64_x86_64/Sparkle.framework"
5858
cp -R "$SPARKLE_FW" "$APP_BUNDLE/Contents/Frameworks/"
5959
60+
# Non-sandboxed apps MUST remove Sparkle's XPC services. Per Sparkle
61+
# docs, XPC services are only for sandboxed apps; shipping them in a
62+
# non-sandboxed app causes "error launching the installer" on update
63+
# because Sparkle tries to use them but launchd rejects the XPC launch.
64+
rm -rf "$APP_BUNDLE/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices"
65+
rm -f "$APP_BUNDLE/Contents/Frameworks/Sparkle.framework/XPCServices"
66+
6067
# Fix rpath so the binary finds the embedded framework
6168
install_name_tool \
6269
-add_rpath "@executable_path/../Frameworks" \
@@ -143,8 +150,8 @@ jobs:
143150
144151
# Sign inside-out: every nested Mach-O / bundle in Sparkle.framework
145152
# must be re-signed with our Developer ID before the framework itself.
146-
# Preserve original entitlements on Sparkle's XPC services — stripping
147-
# them causes Apple notarization to reject with "Invalid".
153+
# XPC services are removed above (non-sandboxed app), so only
154+
# Updater.app, Autoupdate, and Sparkle itself need re-signing.
148155
# --timestamp forces codesign to embed a secure timestamp from Apple's
149156
# TSA, which notarization requires (default behavior is unreliable in CI).
150157
@@ -154,27 +161,15 @@ jobs:
154161
codesign --force --timestamp --options runtime --sign "$IDENTITY" \
155162
"$SPARKLE/Updater.app"
156163
157-
# 2. XPC services: inner binaries first, then bundles (preserve entitlements on bundles)
158-
codesign --force --timestamp --options runtime --sign "$IDENTITY" \
159-
"$SPARKLE/XPCServices/Downloader.xpc/Contents/MacOS/Downloader"
160-
codesign --force --timestamp --options runtime \
161-
--preserve-metadata=entitlements \
162-
--sign "$IDENTITY" "$SPARKLE/XPCServices/Downloader.xpc"
163-
codesign --force --timestamp --options runtime --sign "$IDENTITY" \
164-
"$SPARKLE/XPCServices/Installer.xpc/Contents/MacOS/Installer"
165-
codesign --force --timestamp --options runtime \
166-
--preserve-metadata=entitlements \
167-
--sign "$IDENTITY" "$SPARKLE/XPCServices/Installer.xpc"
168-
169-
# 3. Standalone Autoupdate helper binary
164+
# 2. Standalone Autoupdate helper binary
170165
codesign --force --timestamp --options runtime --sign "$IDENTITY" \
171166
"$SPARKLE/Autoupdate"
172167
173-
# 4. Sparkle.framework itself
168+
# 3. Sparkle.framework itself
174169
codesign --force --timestamp --options runtime --sign "$IDENTITY" \
175170
"$APP_BUNDLE/Contents/Frameworks/Sparkle.framework"
176171
177-
# 5. Main app binary + bundle
172+
# 4. Main app binary + bundle
178173
codesign \
179174
--force \
180175
--timestamp \

‎build.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ if [ -z "$SPARKLE_FW" ]; then
2525
fi
2626
cp -R "$SPARKLE_FW" "$APP_BUNDLE/Contents/Frameworks/"
2727

28+
# Non-sandboxed apps MUST remove Sparkle's XPC services (per Sparkle docs).
29+
# Shipping them causes "error launching the installer" on auto-update because
30+
# Sparkle tries to use them but launchd rejects the XPC launch.
31+
rm -rf "$APP_BUNDLE/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices"
32+
rm -f "$APP_BUNDLE/Contents/Frameworks/Sparkle.framework/XPCServices"
33+
2834
# Fix rpath so the binary can find the embedded framework at runtime
2935
install_name_tool \
3036
-add_rpath "@executable_path/../Frameworks" \

0 commit comments

Comments
 (0)