diff --git a/Configurations/ConfigFrameworkRelease.xcconfig b/Configurations/ConfigFrameworkRelease.xcconfig index b8265609..47fd2cbe 100644 --- a/Configurations/ConfigFrameworkRelease.xcconfig +++ b/Configurations/ConfigFrameworkRelease.xcconfig @@ -2,8 +2,4 @@ #include "ConfigCommonRelease.xcconfig" #include "ConfigFramework.xcconfig" -STRIP_INSTALLED_PRODUCT = YES -DEPLOYMENT_POSTPROCESSING = YES -STRIPFLAGS = -u -r -STRIP_STYLE = non-global -SEPARATE_STRIP = YES + diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index 5c0f5f6a..4d9efc38 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -100,6 +100,9 @@ { if ([[updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)]) [[updater delegate] updater:updater didFinishLoadingAppcast:ac]; + + NSDictionary *userInfo = (ac != nil) ? @{SUUpdaterAppcastNotificationKey : ac} : nil; + [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:updater userInfo:userInfo]; SUAppcastItem *item = nil; @@ -145,6 +148,8 @@ { if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) [[updater delegate] updater:updater didFindValidUpdate:updateItem]; + NSDictionary *userInfo = (updateItem != nil) ? @{SUUpdaterAppcastItemNotificationKey : updateItem} : nil; + [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:updater userInfo:userInfo]; [self downloadUpdate]; } @@ -152,6 +157,8 @@ { if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) [[updater delegate] updaterDidNotFindUpdate:updater]; + [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:updater]; + [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUNoUpdateError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", nil), [host name]] forKey:NSLocalizedDescriptionKey]]]; } diff --git a/SUBinaryDeltaCommon.m b/SUBinaryDeltaCommon.m index 4315d95d..d0241234 100644 --- a/SUBinaryDeltaCommon.m +++ b/SUBinaryDeltaCommon.m @@ -44,7 +44,7 @@ NSString *temporaryFilename(NSString *base) NSString *template = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.XXXXXXXXXX", base]]; char buffer[MAXPATHLEN]; strcpy(buffer, [template fileSystemRepresentation]); - return [NSString stringWithUTF8String:mktemp(buffer)]; + return [NSString stringWithUTF8String:mkstemp(buffer)]; } static void _hashOfBuffer(unsigned char *hash, const char* buffer, size_t bufferLength) diff --git a/SUHost.m b/SUHost.m index e12af606..71ba84d5 100644 --- a/SUHost.m +++ b/SUHost.m @@ -256,7 +256,7 @@ OSErr err3 = Gestalt(gestaltSystemVersionBugFix, &bugfix); if (!err1 && !err2 && !err3) { - verStr = [NSString stringWithFormat:@"%ld.%ld.%ld", (long)major, (long)minor, (long)bugfix]; + verStr = [NSString stringWithFormat:@"%ld.%ld.%ld", (long) major, (long) minor, (long) bugfix]; } else #endif diff --git a/SUPipedUnarchiver.m b/SUPipedUnarchiver.m index e70f0797..44160eaa 100644 --- a/SUPipedUnarchiver.m +++ b/SUPipedUnarchiver.m @@ -51,7 +51,7 @@ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; FILE *fp = NULL, *cmdFP = NULL; - char *oldDestinationString = NULL; + char *oldDestinationString = NULL; SULog(@"Extracting %@ using '%@'",archivePath,command); @@ -61,6 +61,7 @@ #else NSNumber *fs = [[[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:nil] objectForKey:NSFileSize]; #endif + if (fs == nil) goto reportError; // Thank you, Allan Odgaard! @@ -68,7 +69,7 @@ fp = fopen([archivePath fileSystemRepresentation], "r"); if (!fp) goto reportError; - oldDestinationString = getenv("DESTINATION"); + oldDestinationString = getenv("DESTINATION"); setenv("DESTINATION", [[archivePath stringByDeletingLastPathComponent] fileSystemRepresentation], 1); cmdFP = popen([command fileSystemRepresentation], "w"); size_t written; diff --git a/SUPlainInstallerInternals.m b/SUPlainInstallerInternals.m index edcc57d2..ffcd5059 100644 --- a/SUPlainInstallerInternals.m +++ b/SUPlainInstallerInternals.m @@ -465,7 +465,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza { err = FSPathMakeRef((UInt8 *)[[tmpPath stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); if (err != noErr) - err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); + FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL); } err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &dstDirRef, NULL); @@ -505,7 +505,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza { // We better move the old version back to its old location if( hadFileAtDest ) - success = [manager moveItemAtPath:tmpPath toPath:dst error:error]; + [manager moveItemAtPath:tmpPath toPath:dst error:error]; if (error != NULL) *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]]; return NO; @@ -534,7 +534,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza // new home in case it's moved across filesystems: if that // happens, the move is actually a copy, and it may result // in the application being quarantined. - if ([NSThread isMultiThreaded]) + if ([NSThread isMultiThreaded] == YES && [NSThread isMainThread] == NO) [self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:dst waitUntilDone:YES]; else [self releaseFromQuarantine:dst]; diff --git a/SUProbingUpdateDriver.m b/SUProbingUpdateDriver.m index 64bd5b56..28ed6a7a 100644 --- a/SUProbingUpdateDriver.m +++ b/SUProbingUpdateDriver.m @@ -17,6 +17,8 @@ { if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) [[updater delegate] updater:updater didFindValidUpdate:updateItem]; + NSDictionary *userInfo = (updateItem != nil) ? @{SUUpdaterAppcastItemNotificationKey : updateItem} : nil; + [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification object:updater userInfo:userInfo]; [self abortUpdate]; } @@ -24,6 +26,8 @@ { if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) [[updater delegate] updaterDidNotFindUpdate:updater]; + [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:updater]; + [self abortUpdate]; } diff --git a/SUScheduledUpdateDriver.m b/SUScheduledUpdateDriver.m index 2d4b0750..2fc51a49 100644 --- a/SUScheduledUpdateDriver.m +++ b/SUScheduledUpdateDriver.m @@ -25,6 +25,8 @@ { if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) [[updater delegate] updaterDidNotFindUpdate:updater]; + [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:updater]; + [self abortUpdate]; // Don't tell the user that no update was found; this was a scheduled update. } diff --git a/SUUIBasedUpdateDriver.m b/SUUIBasedUpdateDriver.m index fffdfd40..722bf523 100644 --- a/SUUIBasedUpdateDriver.m +++ b/SUUIBasedUpdateDriver.m @@ -50,6 +50,7 @@ { if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) [[updater delegate] updaterDidNotFindUpdate:updater]; + [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:updater]; NSAlert *alert = [NSAlert alertWithMessageText:SULocalizedString(@"You're up-to-date!", nil) defaultButton:SULocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [host name], [host displayVersion]]; [self showModalAlert:alert]; diff --git a/SUUpdater.h b/SUUpdater.h index cd795667..1d064d11 100644 --- a/SUUpdater.h +++ b/SUUpdater.h @@ -75,6 +75,20 @@ @end +// ----------------------------------------------------------------------------- +// SUUpdater Notifications for events that might be interesting to more than just the delegate +// The updater will be the notification object +// ----------------------------------------------------------------------------- +extern NSString *const SUUpdaterDidFinishLoadingAppCastNotification; +extern NSString *const SUUpdaterDidFindValidUpdateNotification; +extern NSString *const SUUpdaterDidNotFindUpdateNotification; +extern NSString *const SUUpdaterWillInstallUpdateNotification; +extern NSString *const SUUpdaterWillRelaunchApplicationNotification; + +// Key for the SUAppcastItem object in the SUUpdaterDidFindValidUpdateNotification & SUUpdaterWillInstallUpdateNotification userInfos +extern NSString *const SUUpdaterAppcastItemNotificationKey; +// Key for the SUAppcast object in the SUUpdaterDidFinishLoadingAppCastNotification userInfo +extern NSString *const SUUpdaterAppcastNotificationKey; // ----------------------------------------------------------------------------- // SUUpdater Delegate: diff --git a/SUUpdater.m b/SUUpdater.m index 7b8c81b6..c40e9a2b 100644 --- a/SUUpdater.m +++ b/SUUpdater.m @@ -20,6 +20,13 @@ #import "SUCodeSigningVerifier.h" #include +NSString *const SUUpdaterDidFinishLoadingAppCastNotification = @"SUUpdaterDidFinishLoadingAppCastNotification"; +NSString *const SUUpdaterDidFindValidUpdateNotification = @"SUUpdaterDidFindValidUpdateNotification"; +NSString *const SUUpdaterDidNotFindUpdateNotification = @"SUUpdaterDidNotFindUpdateNotification"; +NSString *const SUUpdaterWillInstallUpdateNotification = @"SUUpdaterWillInstallUpdateNotification"; +NSString *const SUUpdaterWillRelaunchApplicationNotification = @"SUUpdaterWillRelaunchApplicationNotification"; +NSString *const SUUpdaterAppcastItemNotificationKey = @"SUUpdaterAppcastItemNotificationKey"; +NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotificationKey"; @interface SUUpdater (Private) - (id)initForBundle:(NSBundle *)bundle; @@ -462,7 +469,7 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault - (BOOL)sendsSystemProfile { - return [host boolForUserDefaultsKey:SUSendProfileInfoKey]; + return [host boolForKey:SUSendProfileInfoKey]; } - (NSURL *)parameterizedFeedURL diff --git a/SUXPC.m b/SUXPC.m index ccf94de7..28dc72e0 100644 --- a/SUXPC.m +++ b/SUXPC.m @@ -16,7 +16,7 @@ xpc_connection_t connection = xpc_connection_create("com.andymatuschak.Sparkle.SandboxService", NULL); xpc_connection_set_event_handler(connection, ^(xpc_object_t event) { xpc_dictionary_apply(event, ^bool(const char *key, xpc_object_t value) { - NSLog(@"XPC %s: %s", key, xpc_string_get_string_ptr(value)); + NSLog(@"Sparkle Copy XPC %s: %s", key, xpc_string_get_string_ptr(value)); return true; }); }); @@ -41,7 +41,7 @@ xpc_connection_t connection = xpc_connection_create("com.andymatuschak.Sparkle.SandboxService", NULL); xpc_connection_set_event_handler(connection, ^(xpc_object_t event) { xpc_dictionary_apply(event, ^bool(const char *key, xpc_object_t value) { - NSLog(@"XPC %s: %s", key, xpc_string_get_string_ptr(value)); + NSLog(@"Sparkle Launch XPC %s: %s", key, xpc_string_get_string_ptr(value)); return true; }); }); diff --git a/Sparkle.icns b/Sparkle.icns index 8e56d45c..e690be2a 100644 Binary files a/Sparkle.icns and b/Sparkle.icns differ diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 5e87c6a6..68d1e674 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -300,7 +300,6 @@ 6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUDiskImageUnarchiver.m; sourceTree = ""; }; 6102FE590E08C7EC00F85D09 /* SUUnarchiver_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiver_Private.h; sourceTree = ""; }; 6102FE5A0E08C7EC00F85D09 /* SUUnarchiver_Private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUnarchiver_Private.m; sourceTree = ""; }; - 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigFrameworkReleaseGCSupport.xcconfig; sourceTree = ""; }; 610EC1BF0CF3914D00AE239E /* NTSynchronousTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NTSynchronousTask.m; sourceTree = ""; }; 610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NTSynchronousTask.h; sourceTree = ""; }; 611142E810FB1BE5009810AA /* bspatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bspatch.h; sourceTree = ""; }; @@ -828,7 +827,6 @@ FA1941D10D94A70100DD942E /* ConfigFramework.xcconfig */, FA1941CA0D94A70100DD942E /* ConfigFrameworkDebug.xcconfig */, FA1941D50D94A70100DD942E /* ConfigFrameworkRelease.xcconfig */, - 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */, FA1941CD0D94A70100DD942E /* ConfigTestApp.xcconfig */, FA1941CB0D94A70100DD942E /* ConfigTestAppDebug.xcconfig */, FA1941D20D94A70100DD942E /* ConfigTestAppRelease.xcconfig */, @@ -1523,7 +1521,6 @@ baseConfigurationReference = FA1941CA0D94A70100DD942E /* ConfigFrameworkDebug.xcconfig */; buildSettings = { COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; INSTALL_PATH = "@rpath"; }; name = Debug; @@ -1533,7 +1530,6 @@ baseConfigurationReference = FA1941D50D94A70100DD942E /* ConfigFrameworkRelease.xcconfig */; buildSettings = { COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; INSTALL_PATH = "@rpath"; }; @@ -1600,27 +1596,6 @@ }; name = Release; }; - 55C14BBD136EEF1500649790 /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA1941D40D94A70100DD942E /* ConfigRelaunchRelease.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COMBINE_HIDPI_IMAGES = YES; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = finish_installation.pch; - INFOPLIST_FILE = "finish_installation-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PRODUCT_NAME = finish_installation; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; 5D06E8D20FD68C7D005AE3F6 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D06E8F20FD68D21005AE3F6 /* ConfigBinaryDeltaDebug.xcconfig */; @@ -1635,46 +1610,6 @@ }; name = Release; }; - 5D06E8D40FD68C7D005AE3F6 /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5D06E8F30FD68D21005AE3F6 /* ConfigBinaryDeltaRelease.xcconfig */; - buildSettings = { - }; - name = "Release (GC dual-mode; 10.5+)"; - }; - 61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - buildSettings = { - }; - name = "Release (GC dual-mode; 10.5+)"; - }; - 61072EAE0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - INSTALL_PATH = "@rpath"; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; - 61072EAF0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 615409A8103BA09100125AF1 /* ConfigTestAppReleaseGCSupport.xcconfig */; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; - 61072EB10DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA302AFD109D13190060F891 /* ConfigUnitTestReleaseGCSupport.xcconfig */; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; 612279DB0DB5470300AB99EA /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = FA3AAF3A1050B273004B3130 /* ConfigUnitTestDebug.xcconfig */; @@ -1730,17 +1665,6 @@ }; name = Release; }; - 8B887B6D1517F3AC000BB292 /* Release (GC dual-mode; 10.5+) */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8B887B721517F447000BB292 /* ConfigServiceRelease.xcconfig */; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - INFOPLIST_FILE = SandboxService.plist; - VALID_ARCHS = x86_64; - }; - name = "Release (GC dual-mode; 10.5+)"; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1749,7 +1673,6 @@ buildConfigurations = ( 1DEB91AE08733DA50010E9CD /* Debug */, 1DEB91AF08733DA50010E9CD /* Release */, - 61072EAE0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1759,7 +1682,6 @@ buildConfigurations = ( 1DEB91B208733DA50010E9CD /* Debug */, 1DEB91B308733DA50010E9CD /* Release */, - 61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1769,7 +1691,6 @@ buildConfigurations = ( 55C14BBB136EEF1500649790 /* Debug */, 55C14BBC136EEF1500649790 /* Release */, - 55C14BBD136EEF1500649790 /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1779,7 +1700,6 @@ buildConfigurations = ( 5D06E8D20FD68C7D005AE3F6 /* Debug */, 5D06E8D30FD68C7D005AE3F6 /* Release */, - 5D06E8D40FD68C7D005AE3F6 /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1789,7 +1709,6 @@ buildConfigurations = ( 612279DB0DB5470300AB99EA /* Debug */, 612279DC0DB5470300AB99EA /* Release */, - 61072EB10DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1799,7 +1718,6 @@ buildConfigurations = ( 61B5F90609C4CEE300B25A18 /* Debug */, 61B5F90709C4CEE300B25A18 /* Release */, - 61072EAF0DF263BD008FE88B /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1809,7 +1727,6 @@ buildConfigurations = ( 8B887B6B1517F3AC000BB292 /* Debug */, 8B887B6C1517F3AC000BB292 /* Release */, - 8B887B6D1517F3AC000BB292 /* Release (GC dual-mode; 10.5+) */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Sparkle.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Sparkle.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 192f7326..00000000 --- a/Sparkle.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle (Debug).xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle (Debug).xcscheme new file mode 100644 index 00000000..2badfbe5 --- /dev/null +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle (Debug).xcscheme @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle (Release).xcscheme similarity index 99% rename from Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme rename to Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle (Release).xcscheme index 97bff55a..317d8d3d 100644 --- a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle (Release).xcscheme @@ -79,7 +79,7 @@ - - - - diff --git a/finish_installation.m b/finish_installation.m index 9956d782..81748073 100644 --- a/finish_installation.m +++ b/finish_installation.m @@ -119,7 +119,9 @@ appPath = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:executablepath length:strlen(executablepath)]; else appPath = [host installationPath]; - [[NSWorkspace sharedWorkspace] openFile: appPath]; + + NSRunningApplication *relaunchedApplication = [[NSWorkspace sharedWorkspace] launchApplicationAtURL:[NSURL fileURLWithPath:appPath] options:NSWorkspaceLaunchDefault configuration:nil error:NULL]; + [relaunchedApplication activateWithOptions:NSApplicationActivateIgnoringOtherApps]; } if (folderpath) @@ -146,7 +148,7 @@ // Perhaps a poor assumption but: if we're not relaunching, we assume we shouldn't be showing any UI either. Because non-relaunching installations are kicked off without any user interaction, we shouldn't be interrupting them. if (shouldRelaunch) { - SUStatusController* statusCtl = [[SUStatusController alloc] initWithHost: host]; // We quit anyway after we've installed, so leak this for now. + SUStatusController* statusCtl = [[[SUStatusController alloc] initWithHost: host] autorelease]; // We quit anyway after we've installed, so leak this for now. [statusCtl setButtonTitle: SULocalizedString(@"Cancel Update",@"") target: nil action: Nil isDefault: NO]; [statusCtl beginActionWithTitle: SULocalizedString(@"Installing update...",@"") maxProgressValue: 0 statusText: @""]; @@ -184,6 +186,7 @@ int main (int argc, const char * argv[]) //ProcessSerialNumber psn = { 0, kCurrentProcess }; //TransformProcessType( &psn, kProcessTransformToForegroundApplication ); + [[NSApplication sharedApplication] setActivationPolicy:NSApplicationActivationPolicyRegular]; [[NSApplication sharedApplication] activateIgnoringOtherApps: YES]; #if 0 // Cmdline tool diff --git a/sandbox_service.m b/sandbox_service.m index 101c66a5..a4fa01d1 100644 --- a/sandbox_service.m +++ b/sandbox_service.m @@ -60,8 +60,10 @@ static void peer_event_handler(xpc_connection_t peer, xpc_object_t event) [arguments addObject: [NSString stringWithUTF8String:xpc_array_get_string(array, i)]]; } - - [NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:arguments]; + + NSError *launchError = nil; + NSRunningApplication *runningApplication = [[NSWorkspace sharedWorkspace] launchApplicationAtURL:[NSURL fileURLWithPath:relaunchToolPath] options:NSWorkspaceLaunchNewInstance configuration:@{NSWorkspaceLaunchConfigurationArguments:arguments} error:&launchError]; + [runningApplication activateWithOptions:NSApplicationActivateIgnoringOtherApps]; // send response to indicate ok xpc_object_t reply = xpc_dictionary_create_reply(event);