Skip to content

Commit

Permalink
Merge pull request #1847 from sparkle-project/sandbox-errors
Browse files Browse the repository at this point in the history
Log more sandbox errors
  • Loading branch information
zorgiepoo authored May 2, 2021
2 parents e179443 + 79a6bb1 commit 5da8199
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
11 changes: 10 additions & 1 deletion InstallerLauncher/SUInstallerLauncher.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -419,6 +427,7 @@ - (void)launchInstallerWithHostBundlePath:(NSString *)hostBundlePath updaterIden
}
} 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugDocumentVersioning = "NO"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
enableGPUFrameCaptureMode = "3"
enableGPUValidationMode = "1"
allowLocationSimulation = "NO">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/SPUInstallerDriver.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ - (void)setUpConnection

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;
Expand Down

0 comments on commit 5da8199

Please sign in to comment.