From e8d5c8024c183d8e6549e2e1bea2d7627302bfb6 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 1 May 2021 14:28:54 -0700 Subject: [PATCH] Log error if developer sandboxes installer launcher service --- InstallerLauncher/SUInstallerLauncher.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/InstallerLauncher/SUInstallerLauncher.m b/InstallerLauncher/SUInstallerLauncher.m index c4449780..7d59b6fa 100644 --- a/InstallerLauncher/SUInstallerLauncher.m +++ b/InstallerLauncher/SUInstallerLauncher.m @@ -337,9 +337,17 @@ static BOOL SPUNeedsSystemAuthorizationAccess(NSString *path, NSString *installa - (void)launchInstallerWithHostBundlePath:(NSString *)hostBundlePath updaterIdentifier:(NSString *)updaterIdentifier authorizationPrompt:(NSString *)authorizationPrompt installationType:(NSString *)installationType allowingDriverInteraction:(BOOL)allowingDriverInteraction allowingUpdaterInteraction:(BOOL)allowingUpdaterInteraction completion:(void (^)(SUInstallerLauncherStatus, BOOL))completionHandler { dispatch_async(dispatch_get_main_queue(), ^{ - NSBundle *hostBundle = [NSBundle bundleWithPath:hostBundlePath]; BOOL needsSystemAuthorization = SPUNeedsSystemAuthorizationAccess(hostBundlePath, installationType); + NSBundle *hostBundle = [NSBundle bundleWithPath:hostBundlePath]; + if (hostBundle == nil) { + SULog(SULogLevelError, @"InstallerLauncher failed to create bundle at %@", hostBundlePath); + SULog(SULogLevelError, @"Please make sure InstallerLauncher is not sandboxed and do not sign your app by passing --deep. Check: codesign -d --entitlements :- \"%@\"", NSBundle.mainBundle.bundlePath); + SULog(SULogLevelError, @"More information regarding sandboxing: https://sparkle-project.org/documentation/sandboxing/"); + completionHandler(SUInstallerLauncherFailure, needsSystemAuthorization); + return; + } + if (needsSystemAuthorization && !allowingUpdaterInteraction) { SULog(SULogLevelError, @"Updater is not allowing interaction to the launcher."); completionHandler(SUInstallerLauncherFailure, needsSystemAuthorization);