Using the Sparkle Framework in a Sandboxed App
Sparkle is a framework that simplifies updating Mac apps that are not on the Mac App Store. There is a guide for using Sparkle in a sandboxed app, but I found parts of it unclear so I’m writing about it in this article.
It is very important to set things up correctly with the initial version of your app. If you forget to add something to either the entitlements file or the Info.plist
file, people will see the following alert when they try to install an update for your app:
Overview
You have to perform one or more of the following steps to properly add Sparkle support to a sandboxed app:
- Add the Installer Service (required)
- Add the Installer Connection and Status Services (probably required)
- Add the Downloader Service (maybe)
Most sandboxed apps only need to perform the first two steps. You may have to do more if you have more complex update requirements. See the sandboxing guide for those cases.
Add the Installer Service
To add the Installer Service to your app, you must add the following entry to the Info.plist
file:
Key: SUEnableInstallerLauncherService
Type: Boolean
Value: YES
Add the Installer Connection and Status Services
To add the Installer Connection and Status Services to your app, you must add the following entry to your app’s entitlements file:
Key: com.apple.security.temporary-exception.mach-lookup.global-name
Type: Array
Key: Item 0
Type: String
Value: $(PRODUCT_BUNDLE_IDENTIFIER)-spks
Key: Item 1
Type: String
Value: $(PRODUCT_BUNDLE_IDENTIFIER)-spki
The entry is an array with two string items.
Add the Downloader Service
If you have the Outgoing Connections checkbox selected in the App Sandbox settings, you can skip this section. You’re done.
If your app does not allow outgoing connections (the Outgoing Connections checkbox is not selected), you must add the Downloader Service to update your app with Sparkle. Add the following entry to the Info.plist
file:
Key: SUEnableDownloaderService
Type: Boolean
Value: YES