From e8d5c8024c183d8e6549e2e1bea2d7627302bfb6 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 1 May 2021 14:28:54 -0700 Subject: [PATCH 1/4] 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); From 712753d812aff22f57523cfca02bb6fa52d1ae19 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 1 May 2021 14:36:45 -0700 Subject: [PATCH 2/4] Add log linking to sandboxed steps if app isn't sandboxed at all --- InstallerLauncher/SUInstallerLauncher.m | 1 + 1 file changed, 1 insertion(+) diff --git a/InstallerLauncher/SUInstallerLauncher.m b/InstallerLauncher/SUInstallerLauncher.m index 7d59b6fa..f3bc48a2 100644 --- a/InstallerLauncher/SUInstallerLauncher.m +++ b/InstallerLauncher/SUInstallerLauncher.m @@ -427,6 +427,7 @@ static BOOL SPUNeedsSystemAuthorizationAccess(NSString *path, NSString *installa } } else if (installerStatus == SUInstallerLauncherFailure) { SULog(SULogLevelError, @"Failed to submit installer job"); + SULog(SULogLevelError, @"If your application is sandboxed please follow steps at: https://sparkle-project.org/documentation/sandboxing/"); } if (installerStatus == SUInstallerLauncherCanceled) { From 9b8756d824f765cb5bc2f0913f6a34ffeb7dc7ea Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 1 May 2021 14:46:34 -0700 Subject: [PATCH 3/4] Add sandbox log if connection to installer fails --- Sparkle/SPUInstallerDriver.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sparkle/SPUInstallerDriver.m b/Sparkle/SPUInstallerDriver.m index 737a7526..09212511 100644 --- a/Sparkle/SPUInstallerDriver.m +++ b/Sparkle/SPUInstallerDriver.m @@ -123,7 +123,7 @@ NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while running the updater. Please try again later.", nil), - NSLocalizedFailureReasonErrorKey:@"The remote port connection was invalidated from the updater. For additional details, please check Console logs for "@SPARKLE_RELAUNCH_TOOL_NAME + NSLocalizedFailureReasonErrorKey:@"The remote port connection was invalidated from the updater. For additional details, please check Console logs for "@SPARKLE_RELAUNCH_TOOL_NAME". If your application is sandboxed, please also ensure Installer Connection & Status entitlements are correctly set up: https://sparkle-project.org/documentation/sandboxing/" }]; NSError *installerError = strongSelf.installerError; From 79a6bb13184ee730eeac06a72de3d1a81315e873 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 1 May 2021 14:48:31 -0700 Subject: [PATCH 4/4] Disable unused debugging options in test app scheme --- .../xcshareddata/xcschemes/Sparkle Test App.xcscheme | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle Test App.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle Test App.xcscheme index 42120a39..a783d078 100644 --- a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle Test App.xcscheme +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle Test App.xcscheme @@ -37,9 +37,11 @@ launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" - debugDocumentVersioning = "YES" + debugDocumentVersioning = "NO" debugServiceExtension = "internal" - allowLocationSimulation = "YES"> + enableGPUFrameCaptureMode = "3" + enableGPUValidationMode = "1" + allowLocationSimulation = "NO">