From 2a693e62bfffa1df95d3b38014de99d9657934f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesi=C5=84ski?= Date: Thu, 4 Feb 2016 23:57:25 +0000 Subject: [PATCH 01/11] v1.13.1 --- Configurations/ConfigCommon.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index 3f751fdc..4ba80bc0 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -16,7 +16,7 @@ SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0 SPARKLE_VERSION_MAJOR = 1 SPARKLE_VERSION_MINOR = 13 -SPARKLE_VERSION_PATCH = 0 +SPARKLE_VERSION_PATCH = 1 SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH) CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION) From c315a66151ad655a54633379271826cc118891e4 Mon Sep 17 00:00:00 2001 From: Frantisek Erben Date: Wed, 10 Feb 2016 22:57:54 +0100 Subject: [PATCH 02/11] Czech localizations update --- Sparkle/cs.lproj/SUAutomaticUpdateAlert.xib | 64 ++++++++----------- Sparkle/cs.lproj/SUUpdateAlert.xib | 25 ++------ Sparkle/cs.lproj/SUUpdatePermissionPrompt.xib | 28 ++------ Sparkle/cs.lproj/Sparkle.strings | 6 +- 4 files changed, 43 insertions(+), 80 deletions(-) diff --git a/Sparkle/cs.lproj/SUAutomaticUpdateAlert.xib b/Sparkle/cs.lproj/SUAutomaticUpdateAlert.xib index 1b2be43d..0c30faaa 100644 --- a/Sparkle/cs.lproj/SUAutomaticUpdateAlert.xib +++ b/Sparkle/cs.lproj/SUAutomaticUpdateAlert.xib @@ -1,7 +1,7 @@ - + - + @@ -24,7 +24,6 @@ - @@ -33,7 +32,6 @@ - @@ -46,7 +44,6 @@ - @@ -57,10 +54,9 @@ + + - - - diff --git a/Sparkle/cs.lproj/SUUpdateAlert.xib b/Sparkle/cs.lproj/SUUpdateAlert.xib index afa0cf85..417f2517 100644 --- a/Sparkle/cs.lproj/SUUpdateAlert.xib +++ b/Sparkle/cs.lproj/SUUpdateAlert.xib @@ -1,8 +1,8 @@ - + - - + + @@ -26,7 +26,7 @@ - + @@ -40,7 +40,6 @@ - @@ -51,7 +50,6 @@ - @@ -61,13 +59,12 @@ - + - @@ -88,7 +85,6 @@ - @@ -101,7 +97,6 @@ - @@ -110,7 +105,6 @@ - @@ -127,7 +121,6 @@ - @@ -150,14 +143,12 @@ - - @@ -149,13 +140,12 @@ Gw - - Informace z anonymního systémového profilu pomáhají vývojářům lépe plánovat budoucí vývoj aplikace -Obraťte se na nás v případě, že budete mít k němu nějaký dotaz. + Informace z anonymního systémového profilu pomáhají vývojářům lépe plánovat budoucí vývoj aplikace. +Budete-li mít nějaký dotaz, obraťte se na nás. -Tyto informace by měli být odeslány: +Tyto informace by měly být odeslány: @@ -165,12 +155,11 @@ Tyto informace by měli být odeslány: - + - @@ -210,23 +199,18 @@ Tyto informace by měli být odeslány: - - - diff --git a/Sparkle/cs.lproj/Sparkle.strings b/Sparkle/cs.lproj/Sparkle.strings index 0cf3adb4..251d007f 100644 --- a/Sparkle/cs.lproj/Sparkle.strings +++ b/Sparkle/cs.lproj/Sparkle.strings @@ -1,6 +1,6 @@ "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ byl instalován a je připraven k použití po příštím spuštění. Přejete si aplikaci %1$@ nyní nainstalovat a znovu spustit?"; -"%1$@ can't be updated when it's running from a read-only volume like a disk image or an optical drive. Move %1$@ to your Applications folder, relaunch it from there, and try again." = "Aplikace %1$@ nemůže být aktualizována, protože je spuštěna z nezapisovatelného média. Může to být CD/DVD-ROM, obraz disku nebo jen nemáte právo zápisu na disk. Přesuňte aplikaci %1$@ do vaší složky Aplikace, spusťte ji z tohoto umístěni znovu."; +"%1$@ can't be updated when it's running from a read-only volume like a disk image or an optical drive. Move %1$@ to your Applications folder, relaunch it from there, and try again." = "Aplikace %1$@ nemůže být aktualizována, protože je spuštěna z média na které nelze zapisovat. Může to být CD/DVD-ROM, obraz disku nebo jen nemáte právo zápisu na disk. Přesuňte aplikaci %1$@ do vaší složky Aplikace, spusťte ji z tohoto umístěni znovu."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ je nejnovější dostupná verze"; @@ -8,7 +8,7 @@ "%@ %@ is now available--you have %@. Would you like to download it now?" = "Je k dispozici %1$@ %2$@ - máte %3$@. Přejete si nyní zkopírovat aktualizaci?"; /* Description text for SUUpdateAlert when the update informational with no download. */ -"%@ %@ is now available--you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ is now available--you have %3$@. Would you like to learn more about this update on the web?"; +"%@ %@ is now available--you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ je nyní k dispozici – vy máte %3$@. Přejete si zobrazit o této aktualizaci další informace?"; "%@ downloaded" = "zkopírováno %@"; @@ -24,7 +24,7 @@ "An error occurred while extracting the archive. Please try again later." = "Při rozbalování archivu se vyskytla chyba. Zkuste to prosím později."; -"An error occurred while installing the update. Please try again later." = "Při instalování aktualizace se vyskytla chyba. Zkuste to prosím později."; +"An error occurred while installing the update. Please try again later." = "Při instalaci aktualizace se vyskytla chyba. Zkuste to prosím později."; "An error occurred while parsing the update feed." = "Při zpracovávání údajů o aktualizaci se vyskytla chyba. Zkuste to prosím později."; From b29bbdd14b335dd23c61fb1d3c0024ca51caf828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Fri, 5 Feb 2016 09:49:06 +0000 Subject: [PATCH 03/11] Refactored error handling in appcast parsing --- Sparkle/SUAppcast.m | 263 +++++++++++++++++----------------- Sparkle/SUBasicUpdateDriver.m | 12 +- 2 files changed, 136 insertions(+), 139 deletions(-) diff --git a/Sparkle/SUAppcast.m b/Sparkle/SUAppcast.m index 7690028c..63f746e6 100644 --- a/Sparkle/SUAppcast.m +++ b/Sparkle/SUAppcast.m @@ -93,151 +93,140 @@ - (void)downloadDidFinish:(NSURLDownload *)__unused aDownload { NSError *error = nil; + NSArray *appcastItems = [self parseAppcastItemsFromXMLFile:[NSURL fileURLWithPath:self.downloadFilename] error:&error]; - NSXMLDocument *document = nil; - BOOL failed = NO; - NSArray *xmlItems = nil; + [[NSFileManager defaultManager] removeItemAtPath:self.downloadFilename error:nil]; + self.downloadFilename = nil; + + if (appcastItems) { + self.items = appcastItems; + self.completionBlock(nil); + self.completionBlock = nil; + } else { + NSMutableDictionary *userInfo = [NSMutableDictionary + dictionaryWithObject: SULocalizedString(@"An error occurred while parsing the update feed.", nil) + forKey: NSLocalizedDescriptionKey]; + if (error) { + userInfo[NSUnderlyingErrorKey] = error; + } + [self reportError:[NSError errorWithDomain:SUSparkleErrorDomain + code:SUAppcastParseError + userInfo:userInfo]]; + } +} + +-(NSArray *)parseAppcastItemsFromXMLFile:(NSURL *)appcastFile error:(NSError *__autoreleasing*)errorp { + if (errorp) { + *errorp = nil; + } + + if (!appcastFile) { + return nil; + } + + NSUInteger options = NSXMLNodeLoadExternalEntitiesNever; // Prevent inclusion from file:// + NSXMLDocument *document = [[NSXMLDocument alloc] initWithContentsOfURL:appcastFile options:options error:errorp]; + if (nil == document) { + return nil; + } + + NSArray *xmlItems = [document nodesForXPath:@"/rss/channel/item" error:errorp]; + if (nil == xmlItems) { + return nil; + } + + NSEnumerator *nodeEnum = [xmlItems objectEnumerator]; + + NSXMLNode *node; + NSMutableDictionary *nodesDict = [NSMutableDictionary dictionary]; + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; NSMutableArray *appcastItems = [NSMutableArray array]; - if (self.downloadFilename) - { - NSUInteger options = 0; - options = NSXMLNodeLoadExternalEntitiesNever; // Prevent inclusion from file:// - document = [[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:self.downloadFilename] options:options error:&error]; - - [[NSFileManager defaultManager] removeItemAtPath:self.downloadFilename error:nil]; - self.downloadFilename = nil; - } - else - { - failed = YES; - } - - if (nil == document) - { - failed = YES; - } - else - { - xmlItems = [document nodesForXPath:@"/rss/channel/item" error:&error]; - if (nil == xmlItems) - { - failed = YES; + while((node = [nodeEnum nextObject])) { + // First, we'll "index" all the first-level children of this appcast item so we can pick them out by language later. + if ([[node children] count]) { + node = [node childAtIndex:0]; + while (nil != node) { + NSString *name = [node name]; + if (name) { + NSMutableArray *nodes = nodesDict[name]; + if (nodes == nil) { + nodes = [NSMutableArray array]; + nodesDict[name] = nodes; + } + [nodes addObject:node]; + } + node = [node nextSibling]; + } } - } - if (failed == NO) - { - - NSEnumerator *nodeEnum = [xmlItems objectEnumerator]; - NSXMLNode *node; - NSMutableDictionary *nodesDict = [NSMutableDictionary dictionary]; - NSMutableDictionary *dict = [NSMutableDictionary dictionary]; - - while (failed == NO && (node = [nodeEnum nextObject])) - { - // First, we'll "index" all the first-level children of this appcast item so we can pick them out by language later. - if ([[node children] count]) - { - node = [node childAtIndex:0]; - while (nil != node) - { - NSString *name = [node name]; - if (name) - { - NSMutableArray *nodes = nodesDict[name]; - if (nodes == nil) - { - nodes = [NSMutableArray array]; - nodesDict[name] = nodes; - } - [nodes addObject:node]; - } - node = [node nextSibling]; - } - } - - for (NSString *name in nodesDict) - { - node = [self bestNodeInNodes:nodesDict[name]]; - if ([name isEqualToString:SURSSElementEnclosure]) - { - // enclosure is flattened as a separate dictionary for some reason - NSDictionary *encDict = [(NSXMLElement *)node attributesAsDictionary]; - dict[name] = encDict; - - } - else if ([name isEqualToString:SURSSElementPubDate]) - { - // pubDate is expected to be an NSDate by SUAppcastItem, but the RSS class was returning an NSString - NSString *string = node.stringValue; - if (string) { - NSDate *date = [NSDate dateWithNaturalLanguageString:string]; - if (date) - dict[name] = date; - } - } - else if ([name isEqualToString:SUAppcastElementDeltas]) - { - NSMutableArray *deltas = [NSMutableArray array]; - NSEnumerator *childEnum = [[node children] objectEnumerator]; - for (NSXMLNode *child in childEnum) { - if ([[child name] isEqualToString:SURSSElementEnclosure]) - [deltas addObject:[(NSXMLElement *)child attributesAsDictionary]]; - } - dict[name] = deltas; - } - else if ([name isEqualToString:SUAppcastElementTags]) { - NSMutableArray *tags = [NSMutableArray array]; - NSEnumerator *childEnum = [[node children] objectEnumerator]; - for (NSXMLNode *child in childEnum) { - NSString *childName = child.name; - if (childName) - [tags addObject:childName]; - } - dict[name] = tags; - } - else if (name != nil) - { - // add all other values as strings - NSString *theValue = [[node stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - if (theValue != nil) { - dict[name] = theValue; - } - } - } - - NSString *errString; - SUAppcastItem *anItem = [[SUAppcastItem alloc] initWithDictionary:dict failureReason:&errString]; - if (anItem) - { - [appcastItems addObject:anItem]; + for (NSString *name in nodesDict) { + node = [self bestNodeInNodes:nodesDict[name]]; + if ([name isEqualToString:SURSSElementEnclosure]) { + // enclosure is flattened as a separate dictionary for some reason + NSDictionary *encDict = [(NSXMLElement *)node attributesAsDictionary]; + dict[name] = encDict; } - else - { - SULog(@"Sparkle Updater: Failed to parse appcast item: %@.\nAppcast dictionary was: %@", errString, dict); + else if ([name isEqualToString:SURSSElementPubDate]) { + // pubDate is expected to be an NSDate by SUAppcastItem, but the RSS class was returning an NSString + NSString *string = node.stringValue; + if (string) { + NSDate *date = [NSDate dateWithNaturalLanguageString:string]; + if (date) { + dict[name] = date; + } + } + } + else if ([name isEqualToString:SUAppcastElementDeltas]) { + NSMutableArray *deltas = [NSMutableArray array]; + NSEnumerator *childEnum = [[node children] objectEnumerator]; + for (NSXMLNode *child in childEnum) { + if ([[child name] isEqualToString:SURSSElementEnclosure]) { + [deltas addObject:[(NSXMLElement *)child attributesAsDictionary]]; + } + } + dict[name] = deltas; + } + else if ([name isEqualToString:SUAppcastElementTags]) { + NSMutableArray *tags = [NSMutableArray array]; + NSEnumerator *childEnum = [[node children] objectEnumerator]; + for (NSXMLNode *child in childEnum) { + NSString *childName = child.name; + if (childName) { + [tags addObject:childName]; + } + } + dict[name] = tags; } - [nodesDict removeAllObjects]; - [dict removeAllObjects]; + else if (name != nil) { + // add all other values as strings + NSString *theValue = [[node stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if (theValue != nil) { + dict[name] = theValue; + } + } + } + + NSString *errString; + SUAppcastItem *anItem = [[SUAppcastItem alloc] initWithDictionary:dict failureReason:&errString]; + if (anItem) { + [appcastItems addObject:anItem]; + } + else { + SULog(@"Sparkle Updater: Failed to parse appcast item: %@.\nAppcast dictionary was: %@", errString, dict); + if (errorp) *errorp = [NSError errorWithDomain:SUSparkleErrorDomain + code:SUAppcastParseError + userInfo:@{NSLocalizedDescriptionKey: errString}]; + return nil; } } if ([appcastItems count]) { NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"date" ascending:NO]; [appcastItems sortUsingDescriptors:@[sort]]; - self.items = appcastItems; } - if (failed) { - [self reportError:[NSError errorWithDomain:SUSparkleErrorDomain - code:SUAppcastParseError - userInfo:@{ - NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while parsing the update feed.", nil), - NSUnderlyingErrorKey: error ? error : [NSNull null]}]]; - } else { - self.completionBlock(nil); - self.completionBlock = nil; - } + return appcastItems; } - (void)download:(NSURLDownload *)__unused aDownload didFailWithError:(NSError *)error @@ -257,14 +246,18 @@ - (void)reportError:(NSError *)error { - NSURL *failingUrl = error.userInfo[NSURLErrorFailingURLErrorKey]; - - self.completionBlock([NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastError userInfo:@{ + NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred in retrieving update information. Please try again later.", nil), NSLocalizedFailureReasonErrorKey: [error localizedDescription], NSUnderlyingErrorKey: error, - NSURLErrorFailingURLErrorKey: failingUrl ? failingUrl : [NSNull null], - }]); + }]; + + NSURL *failingUrl = error.userInfo[NSURLErrorFailingURLErrorKey]; + if (failingUrl) { + userInfo[NSURLErrorFailingURLErrorKey] = failingUrl; + } + + self.completionBlock([NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastError userInfo:userInfo]); self.completionBlock = nil; } diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 56bef1b3..a219eaee 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -325,18 +325,22 @@ if (!failingUrl) { failingUrl = [self.updateItem fileURL]; } - + if ([[self.updater delegate] respondsToSelector:@selector(updater:failedToDownloadUpdate:error:)]) { [[self.updater delegate] updater:self.updater failedToDownloadUpdate:self.updateItem error:error]; } - [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:@{ + NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while downloading the update. Please try again later.", nil), NSUnderlyingErrorKey: error, - NSURLErrorFailingURLErrorKey: failingUrl ? failingUrl : [NSNull null], - }]]; + }]; + if (failingUrl) { + userInfo[NSURLErrorFailingURLErrorKey] = failingUrl; + } + + [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:userInfo]]; } - (BOOL)download:(NSURLDownload *)__unused download shouldDecodeSourceDataOfMIMEType:(NSString *)encodingType From 3163b6a7299b95544a3037407cfe80704cdf5487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesi=C5=84ski?= Date: Mon, 15 Feb 2016 21:01:25 +0100 Subject: [PATCH 04/11] 1.14.0rc2 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 4f500418..b514cb8d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,9 @@ * Add some Japanese lozalized strings (1024jp) * Made test app available in all languages #695 (LIU Dongyuan / 柳东原) * Removed a test resource from the framework bundle (Karl Moskowski) +* Czech localizations update (Frantisek Erben) +* Test if the updated app is the frontmost one (Zorg) +* UI Tests for the Test Application (Zorg) # 1.13.1 (Jan 31, 2016) From b64cee8055ad9d29736a53d84bafb10527fdeb0f Mon Sep 17 00:00:00 2001 From: Zorg Date: Tue, 16 Feb 2016 23:03:47 -0500 Subject: [PATCH 05/11] Disable javascript by default and make it opt-in To opt-in to enabling Javascript, set SUEnableJavaScript to true in the app's info.plist --- Sparkle/SUConstants.h | 1 + Sparkle/SUConstants.m | 1 + Sparkle/SUUpdateAlert.m | 1 + 3 files changed, 3 insertions(+) diff --git a/Sparkle/SUConstants.h b/Sparkle/SUConstants.h index b717d843..ae9beae1 100644 --- a/Sparkle/SUConstants.h +++ b/Sparkle/SUConstants.h @@ -50,6 +50,7 @@ extern NSString *const SULastProfileSubmitDateKey; extern NSString *const SUPromptUserOnFirstLaunchKey; extern NSString *const SUKeepDownloadOnFailedInstallKey; extern NSString *const SUDefaultsDomainKey; +extern NSString *const SUEnableJavaScriptKey; extern NSString *const SUFixedHTMLDisplaySizeKey __attribute__((deprecated("This key is obsolete and has no effect."))); extern NSString *const SUAppendVersionNumberKey __attribute__((deprecated("This key is obsolete. See SPARKLE_APPEND_VERSION_NUMBER."))); extern NSString *const SUEnableAutomatedDowngradesKey __attribute__((deprecated("This key is obsolete. See SPARKLE_AUTOMATED_DOWNGRADES."))); diff --git a/Sparkle/SUConstants.m b/Sparkle/SUConstants.m index 31c80ca3..dbaefe13 100644 --- a/Sparkle/SUConstants.m +++ b/Sparkle/SUConstants.m @@ -42,6 +42,7 @@ NSString *const SUEnableAutomaticChecksKeyOld = @"SUCheckAtStartup"; NSString *const SUSendProfileInfoKey = @"SUSendProfileInfo"; NSString *const SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate"; NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch"; +NSString *const SUEnableJavaScriptKey = @"SUEnableJavaScript"; NSString *const SUFixedHTMLDisplaySizeKey = @"SUFixedHTMLDisplaySize"; NSString *const SUKeepDownloadOnFailedInstallKey = @"SUKeepDownloadOnFailedInstall"; NSString *const SUDefaultsDomainKey = @"SUDefaultsDomain"; diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 3433299d..d7b6702a 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -122,6 +122,7 @@ self.releaseNotesView.preferencesIdentifier = SUBundleIdentifier; WebPreferences *prefs = [self.releaseNotesView preferences]; prefs.plugInsEnabled = NO; + prefs.javaScriptEnabled = [self.host boolForInfoDictionaryKey:SUEnableJavaScriptKey]; self.releaseNotesView.frameLoadDelegate = self; self.releaseNotesView.policyDelegate = self; From 4eb2e9af0023e6fc0cbc657a8490441a7310670a Mon Sep 17 00:00:00 2001 From: Zorg Date: Tue, 16 Feb 2016 23:07:26 -0500 Subject: [PATCH 06/11] Disable Java in the web view too Plug-ins have already been disabled but I'm not sure if that encompasses Java or not. May as well be explicit in either case and disable it. --- Sparkle/SUUpdateAlert.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index d7b6702a..08ccc755 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -122,6 +122,7 @@ self.releaseNotesView.preferencesIdentifier = SUBundleIdentifier; WebPreferences *prefs = [self.releaseNotesView preferences]; prefs.plugInsEnabled = NO; + prefs.javaEnabled = NO; prefs.javaScriptEnabled = [self.host boolForInfoDictionaryKey:SUEnableJavaScriptKey]; self.releaseNotesView.frameLoadDelegate = self; self.releaseNotesView.policyDelegate = self; From 625f229a65ce17390e2af87ca17b48a13863706c Mon Sep 17 00:00:00 2001 From: Zorg Date: Thu, 18 Feb 2016 00:40:14 -0500 Subject: [PATCH 07/11] Don't terminate the app if we're already terminating --- Sparkle/SUAutomaticUpdateDriver.m | 16 ++++++++++++++++ Sparkle/SUBasicUpdateDriver.m | 2 ++ 2 files changed, 18 insertions(+) diff --git a/Sparkle/SUAutomaticUpdateDriver.m b/Sparkle/SUAutomaticUpdateDriver.m index 562f2d05..b4f2b78a 100644 --- a/Sparkle/SUAutomaticUpdateDriver.m +++ b/Sparkle/SUAutomaticUpdateDriver.m @@ -26,6 +26,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 @property (assign) BOOL postponingInstallation; @property (assign) BOOL showErrors; @property (assign) BOOL willUpdateOnTermination; +@property (assign) BOOL isTerminating; @property (strong) SUAutomaticUpdateAlert *alert; @property (strong) NSTimer *showUpdateAlertTimer; @@ -36,6 +37,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 @synthesize postponingInstallation; @synthesize showErrors; @synthesize willUpdateOnTermination; +@synthesize isTerminating; @synthesize alert; @synthesize showUpdateAlertTimer; @@ -131,6 +133,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 - (void)abortUpdate { + self.isTerminating = NO; [self stopUpdatingOnTermination]; [self invalidateShowUpdateAlertTimer]; [super abortUpdate]; @@ -185,9 +188,22 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 - (void)applicationWillTerminate:(NSNotification *)__unused note { + // We don't want to terminate the app if the user or someone else initiated a termination + // Use a property instead of passing an argument to installWithToolAndRelaunch: + // because we give the delegate an invocation to our install methods and + // this code was added later :| + self.isTerminating = YES; + [self installWithToolAndRelaunch:NO]; } +- (void)terminateApp +{ + if (!self.isTerminating) { + [super terminateApp]; + } +} + - (void)abortUpdateWithError:(NSError *)error { if (self.showErrors) { diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index a219eaee..3df60455 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -511,6 +511,7 @@ if ([updaterDelegate respondsToSelector:@selector(pathToRelaunchForUpdater:)]) { pathToRelaunch = [updaterDelegate pathToRelaunchForUpdater:self.updater]; } + [NSTask launchedTaskWithLaunchPath:relaunchToolPath arguments:@[[self.host bundlePath], pathToRelaunch, [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], @@ -520,6 +521,7 @@ [self terminateApp]; } +// Note: this is overridden by the automatic update driver to not terminate in some cases - (void)terminateApp { [NSApp terminate:self]; From a11b1209a97bafd713189f9b0fa14584ba6e100a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesi=C5=84ski?= Date: Thu, 18 Feb 2016 13:50:05 +0100 Subject: [PATCH 08/11] Unit test for appcast parsing --- Sparkle.xcodeproj/project.pbxproj | 38 +++++++++++++--------- Sparkle/SUAppcast.m | 4 +++ Tests/Resources/testappcast.xml | 17 ++++++++++ Tests/SUAppcastTest.swift | 38 ++++++++++++++++++++++ Tests/Sparkle Unit Tests-Bridging-Header.h | 12 +++++++ 5 files changed, 94 insertions(+), 15 deletions(-) create mode 100644 Tests/Resources/testappcast.xml create mode 100644 Tests/SUAppcastTest.swift diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 8b9ac634..e20a16f3 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -72,8 +72,10 @@ 55C14F9A136F045400649790 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; }; 55C14FC7136F05E100649790 /* Sparkle.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8220A321A7F00D8810D /* Sparkle.strings */; }; 55E6F33319EC9F6C00005E76 /* SUErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 55E6F33219EC9F6C00005E76 /* SUErrors.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AA4DCD01C73E5510078F128 /* SUAppcastTest.swift */; }; 5A6D31EE1BF53245009C5157 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; }; 5A6D31EF1BF5325F009C5157 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; }; + 5AD0FA7F1C73F2E2004BCEFF /* testappcast.xml in Resources */ = {isa = PBXBuildFile; fileRef = 5AD0FA7E1C73F2E2004BCEFF /* testappcast.xml */; }; 5AF6C74F1AEA46D10014A3AB /* test.sparkle_guided.pkg in Resources */ = {isa = PBXBuildFile; fileRef = 5AF6C74E1AEA46D10014A3AB /* test.sparkle_guided.pkg */; }; 5AF6C7541AEA49840014A3AB /* SUInstallerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF6C74C1AEA40760014A3AB /* SUInstallerTest.m */; }; 5AF9DC3C1981DBEE001EA135 /* SUDSAVerifierTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF9DC3B1981DBEE001EA135 /* SUDSAVerifierTest.m */; }; @@ -443,6 +445,8 @@ 55C14F05136EF6DB00649790 /* SULog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SULog.m; sourceTree = ""; }; 55C14F31136EFC2400649790 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 55E6F33219EC9F6C00005E76 /* SUErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUErrors.h; sourceTree = ""; }; + 5AA4DCD01C73E5510078F128 /* SUAppcastTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUAppcastTest.swift; sourceTree = ""; }; + 5AD0FA7E1C73F2E2004BCEFF /* testappcast.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testappcast.xml; sourceTree = ""; }; 5AEF45D9189D1CC90030D7DC /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Sparkle.strings; sourceTree = ""; }; 5AF6C74C1AEA40760014A3AB /* SUInstallerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstallerTest.m; sourceTree = ""; }; 5AF6C74E1AEA46D10014A3AB /* test.sparkle_guided.pkg */ = {isa = PBXFileReference; lastKnownFileType = file; path = test.sparkle_guided.pkg; sourceTree = ""; }; @@ -844,6 +848,7 @@ F8761EB21ADC50EB000C9034 /* SparkleTestCodeSignApp.zip */, 14958C6C19AEBC610061B14F /* test-pubkey.pem */, 5AF6C74E1AEA46D10014A3AB /* test.sparkle_guided.pkg */, + 5AD0FA7E1C73F2E2004BCEFF /* testappcast.xml */, ); path = Resources; sourceTree = ""; @@ -894,6 +899,7 @@ 14958C7019AEBE350061B14F /* Resources */, 72AFC6121B9A944200F6B565 /* Sparkle Unit Tests-Bridging-Header.h */, 612279DA0DB5470200AB99EA /* SparkleTests-Info.plist */, + 5AA4DCD01C73E5510078F128 /* SUAppcastTest.swift */, 142E0E0819A83AAC00E4312B /* SUBinaryDeltaTest.m */, F8761EB01ADC5068000C9034 /* SUCodeSigningVerifierTest.m */, 5AF9DC3B1981DBEE001EA135 /* SUDSAVerifierTest.m */, @@ -968,10 +974,10 @@ 14652F8319A9759F00959E44 /* SUExport.h */, 61EF67580E25C5B400F754E0 /* SUHost.h */, 61EF67550E25B58D00F754E0 /* SUHost.m */, - 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */, - 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */, 55C14F04136EF6DB00649790 /* SULog.h */, 55C14F05136EF6DB00649790 /* SULog.m */, + 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */, + 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */, ); includeInIndex = 1; name = "Other Sources"; @@ -987,10 +993,10 @@ 72E45CFB1B641961005C701A /* sparkletestcast.xml */, 72E45CF11B640CDD005C701A /* SUTestApplicationDelegate.h */, 72E45CF21B640CDD005C701A /* SUTestApplicationDelegate.m */, - 72E45CF41B640DAE005C701A /* SUUpdateSettingsWindowController.h */, - 72E45CF51B640DAE005C701A /* SUUpdateSettingsWindowController.m */, A5BF4F1B1BC7668B007A052A /* SUTestWebServer.h */, A5BF4F1C1BC7668B007A052A /* SUTestWebServer.m */, + 72E45CF41B640DAE005C701A /* SUUpdateSettingsWindowController.h */, + 72E45CF51B640DAE005C701A /* SUUpdateSettingsWindowController.m */, 72E45CF61B640DAE005C701A /* SUUpdateSettingsWindowController.xib */, 72E45CFD1B641D0D005C701A /* test_app_only_dsa_priv_dont_ever_do_this_for_real.pem */, 14732BBF1960F0AC00593899 /* test_app_only_dsa_pub.pem */, @@ -1269,8 +1275,8 @@ isa = PBXProject; attributes = { CLASSPREFIX = SU; - LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0710; + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; ORGANIZATIONNAME = "Sparkle Project"; TargetAttributes = { 612279D80DB5470200AB99EA = { @@ -1356,6 +1362,7 @@ F8761EB31ADC50EB000C9034 /* SparkleTestCodeSignApp.zip in Resources */, 14958C6F19AEBC980061B14F /* test-pubkey.pem in Resources */, 5AF6C74F1AEA46D10014A3AB /* test.sparkle_guided.pkg in Resources */, + 5AD0FA7F1C73F2E2004BCEFF /* testappcast.xml in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1471,7 +1478,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 726F2CE71BC9C3E2001971A4 /* SUOperatingSystem.m in Sources */, 55C14BD4136EEFCE00649790 /* Autoupdate.m in Sources */, F8761EB61ADC5E7A000C9034 /* SUCodeSigningVerifier.m in Sources */, 55C14F00136EF6B700649790 /* SUConstants.m in Sources */, @@ -1480,6 +1486,7 @@ 55C14F0C136EF6EA00649790 /* SUHost.m in Sources */, 55C14F0D136EF6F200649790 /* SUInstaller.m in Sources */, 55C14F08136EF6DB00649790 /* SULog.m in Sources */, + 726F2CE71BC9C3E2001971A4 /* SUOperatingSystem.m in Sources */, 55C14F24136EF86F00649790 /* SUPackageInstaller.m in Sources */, 55C14F21136EF84D00649790 /* SUPlainInstaller.m in Sources */, 55C14F22136EF86000649790 /* SUStandardVersionComparator.m in Sources */, @@ -1493,9 +1500,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 726F2CE91BC9C499001971A4 /* SUOperatingSystem.m in Sources */, - 726F2CE81BC9C48F001971A4 /* SUConstants.m in Sources */, - 726F2CDE1BC9BE5B001971A4 /* SUFileManager.m in Sources */, 5D06E8E90FD68CDB005AE3F6 /* bsdiff.c in Sources */, 14652F7E19A9728A00959E44 /* bspatch.c in Sources */, 7223E7631AD1AEFF008E3161 /* sais.c in Sources */, @@ -1503,6 +1507,9 @@ 14652F7C19A9725300959E44 /* SUBinaryDeltaCommon.m in Sources */, 7268AC631AD634C200C3E0C1 /* SUBinaryDeltaCreate.m in Sources */, 5D06E8EA0FD68CDB005AE3F6 /* SUBinaryDeltaTool.m in Sources */, + 726F2CE81BC9C48F001971A4 /* SUConstants.m in Sources */, + 726F2CDE1BC9BE5B001971A4 /* SUFileManager.m in Sources */, + 726F2CE91BC9C499001971A4 /* SUOperatingSystem.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1513,6 +1520,7 @@ 721CF1A71AD7643600D9AC09 /* bsdiff.c in Sources */, 721CF1A81AD7644100D9AC09 /* bspatch.c in Sources */, 721CF1A91AD7644C00D9AC09 /* sais.c in Sources */, + 5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */, 72D4DAA11AD7632900B211E2 /* SUBinaryDeltaCreate.m in Sources */, 142E0E0919A83AAC00E4312B /* SUBinaryDeltaTest.m in Sources */, F8761EB11ADC5068000C9034 /* SUCodeSigningVerifierTest.m in Sources */, @@ -1529,12 +1537,12 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 726F2CEB1BC9C733001971A4 /* SUConstants.m in Sources */, - 5A6D31EF1BF5325F009C5157 /* SUOperatingSystem.m in Sources */, - 5A6D31EE1BF53245009C5157 /* SUFileManager.m in Sources */, 61B5F93009C4CFDC00B25A18 /* main.m in Sources */, - A5BF4F1D1BC7668B007A052A /* SUTestWebServer.m in Sources */, + 726F2CEB1BC9C733001971A4 /* SUConstants.m in Sources */, + 5A6D31EE1BF53245009C5157 /* SUFileManager.m in Sources */, + 5A6D31EF1BF5325F009C5157 /* SUOperatingSystem.m in Sources */, 72E45CF31B640CDD005C701A /* SUTestApplicationDelegate.m in Sources */, + A5BF4F1D1BC7668B007A052A /* SUTestWebServer.m in Sources */, 72E45CF71B640DAE005C701A /* SUUpdateSettingsWindowController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1562,12 +1570,12 @@ 61EF67560E25B58D00F754E0 /* SUHost.m in Sources */, 618FA5020DAE88B40026945C /* SUInstaller.m in Sources */, 55C14F07136EF6DB00649790 /* SULog.m in Sources */, + 726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */, 618FA5230DAE8E8A0026945C /* SUPackageInstaller.m in Sources */, 61D85D6D0E10B2ED00F9B4A9 /* SUPipedUnarchiver.m in Sources */, 618FA5060DAE8AB80026945C /* SUPlainInstaller.m in Sources */, 6101347C0DD2541A0049ACDF /* SUProbingUpdateDriver.m in Sources */, 61B93C0A0DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m in Sources */, - 726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */, 61A225A50D1C4AC000430CCD /* SUStandardVersionComparator.m in Sources */, 6196CFFA09C72149000DC222 /* SUStatusController.m in Sources */, 61A2279D0D1CEE7600430CCD /* SUSystemProfiler.m in Sources */, diff --git a/Sparkle/SUAppcast.m b/Sparkle/SUAppcast.m index 42254148..eec78666 100644 --- a/Sparkle/SUAppcast.m +++ b/Sparkle/SUAppcast.m @@ -92,6 +92,10 @@ - (void)downloadDidFinish:(NSURLDownload *)__unused aDownload { + [self parse]; +} + +- (void) parse { NSError *error = nil; NSXMLDocument *document = nil; diff --git a/Tests/Resources/testappcast.xml b/Tests/Resources/testappcast.xml new file mode 100644 index 00000000..0023508e --- /dev/null +++ b/Tests/Resources/testappcast.xml @@ -0,0 +1,17 @@ + + + + For unit test only + + Version 2.0 + desc + Sat, 26 Jul 2014 15:20:11 +0000 + + + + Version 3.0 + Sat, 26 Jul 2014 15:20:12 +0000 + + + + diff --git a/Tests/SUAppcastTest.swift b/Tests/SUAppcastTest.swift new file mode 100644 index 00000000..570745d0 --- /dev/null +++ b/Tests/SUAppcastTest.swift @@ -0,0 +1,38 @@ +// +// SUAppcastTest.swift +// Sparkle +// +// Created by Kornel on 17/02/2016. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +import XCTest +import Sparkle; + +class SUAppcastTest: XCTestCase { + + func testExample() { + let appcast = SUAppcast(); + let testFile = NSBundle(forClass: SUAppcastTest.self).pathForResource("testappcast", ofType: "xml")!; + let testFileUrl = NSURL(fileURLWithPath: testFile); + XCTAssertNotNil(testFileUrl); + + do { + appcast.completionBlock = {err -> () in}; + appcast.downloadFilename = testFile; + + appcast.parse(); + let items = appcast.items as! [SUAppcastItem]; + + XCTAssertEqual(2, items.count); + XCTAssertEqual("Version 3.0", items[0].title); + XCTAssertNil(items[0].itemDescription); + + XCTAssertEqual("Version 2.0", items[1].title); + XCTAssertEqual("desc", items[1].itemDescription); + } catch let err as NSError { + NSLog("%@", err); + XCTFail(err.localizedDescription); + } + } +} diff --git a/Tests/Sparkle Unit Tests-Bridging-Header.h b/Tests/Sparkle Unit Tests-Bridging-Header.h index ab678027..49507f83 100644 --- a/Tests/Sparkle Unit Tests-Bridging-Header.h +++ b/Tests/Sparkle Unit Tests-Bridging-Header.h @@ -6,6 +6,8 @@ #import "SUPipedUnarchiver.h" #import "SUBinaryDeltaCommon.h" #import "SUFileManager.h" +#import "SUAppcast.h" +#import "SUAppcastItem.h" // Duplicated to avoid exporting a private symbol from SUFileManager static const char *SUAppleQuarantineIdentifier = "com.apple.quarantine"; @@ -20,3 +22,13 @@ static const char *SUAppleQuarantineIdentifier = "com.apple.quarantine"; - (BOOL)_makeDirectoryAtURL:(NSURL *)url error:(NSError * __autoreleasing *)error; @end + + +@interface SUAppcast (Private) +@property (strong) void (^completionBlock)(NSError *); +@property (copy) NSString *downloadFilename; +@property (readonly, copy) NSArray *items; + +- (void)parse; +@end + From 2668d182664e7d8325ab7e286561fd67c68d393a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesi=C5=84ski?= Date: Wed, 17 Feb 2016 18:34:28 +0100 Subject: [PATCH 09/11] Appcast test --- Tests/SUAppcastTest.swift | 6 +----- Tests/Sparkle Unit Tests-Bridging-Header.h | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Tests/SUAppcastTest.swift b/Tests/SUAppcastTest.swift index 570745d0..5f39f795 100644 --- a/Tests/SUAppcastTest.swift +++ b/Tests/SUAppcastTest.swift @@ -18,11 +18,7 @@ class SUAppcastTest: XCTestCase { XCTAssertNotNil(testFileUrl); do { - appcast.completionBlock = {err -> () in}; - appcast.downloadFilename = testFile; - - appcast.parse(); - let items = appcast.items as! [SUAppcastItem]; + let items = try appcast.parseAppcastItemsFromXMLFile(testFileUrl) as! [SUAppcastItem]; XCTAssertEqual(2, items.count); XCTAssertEqual("Version 3.0", items[0].title); diff --git a/Tests/Sparkle Unit Tests-Bridging-Header.h b/Tests/Sparkle Unit Tests-Bridging-Header.h index 49507f83..512f4a58 100644 --- a/Tests/Sparkle Unit Tests-Bridging-Header.h +++ b/Tests/Sparkle Unit Tests-Bridging-Header.h @@ -25,10 +25,6 @@ static const char *SUAppleQuarantineIdentifier = "com.apple.quarantine"; @interface SUAppcast (Private) -@property (strong) void (^completionBlock)(NSError *); -@property (copy) NSString *downloadFilename; -@property (readonly, copy) NSArray *items; - -- (void)parse; +- (NSArray *)parseAppcastItemsFromXMLFile:(NSURL *)appcastFile error:(NSError *__autoreleasing*)errorp; @end From 9671f7f52df2425bfa922e8057e4116efb93d1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesi=C5=84ski?= Date: Thu, 18 Feb 2016 19:28:03 +0100 Subject: [PATCH 10/11] Fixed duplicated appcast item properties Corrected scope of per-node objects --- Sparkle/SUAppcast.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sparkle/SUAppcast.m b/Sparkle/SUAppcast.m index 63f746e6..ac1c43bb 100644 --- a/Sparkle/SUAppcast.m +++ b/Sparkle/SUAppcast.m @@ -135,14 +135,14 @@ return nil; } - NSEnumerator *nodeEnum = [xmlItems objectEnumerator]; - - NSXMLNode *node; - NSMutableDictionary *nodesDict = [NSMutableDictionary dictionary]; - NSMutableDictionary *dict = [NSMutableDictionary dictionary]; NSMutableArray *appcastItems = [NSMutableArray array]; + NSEnumerator *nodeEnum = [xmlItems objectEnumerator]; + NSXMLNode *node; while((node = [nodeEnum nextObject])) { + NSMutableDictionary *nodesDict = [NSMutableDictionary dictionary]; + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + // First, we'll "index" all the first-level children of this appcast item so we can pick them out by language later. if ([[node children] count]) { node = [node childAtIndex:0]; From c3ffd7f73946353880550bc1169a8fd9659c6312 Mon Sep 17 00:00:00 2001 From: Zorg Date: Fri, 19 Feb 2016 09:38:42 -0500 Subject: [PATCH 11/11] Don't register for termination notifications more than once. Fixes #757 These notifications are already added by -unarchiverDidFinish: which is always invoked before -showUpdateAlert --- Sparkle/SUAutomaticUpdateDriver.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sparkle/SUAutomaticUpdateDriver.m b/Sparkle/SUAutomaticUpdateDriver.m index b4f2b78a..6727d0d9 100644 --- a/Sparkle/SUAutomaticUpdateDriver.m +++ b/Sparkle/SUAutomaticUpdateDriver.m @@ -156,8 +156,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 case SUInstallLaterChoice: self.postponingInstallation = YES; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:nil]; - [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(systemWillPowerOff:) name:NSWorkspaceWillPowerOffNotification object:nil]; // We're already waiting on quit, just indicate that we're idle. self.interruptible = YES; break; @@ -169,6 +167,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 } } + - (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI { if (relaunch) {