From 423ee5a9d690a835cd8a8827e4c4df07cecf9dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Wed, 15 Mar 2017 21:31:00 +0000 Subject: [PATCH 01/21] Ensure UI code always runs on the main thread --- Sparkle/SUAutomaticUpdateDriver.m | 37 ++++++++------- Sparkle/SUUIBasedUpdateDriver.m | 76 ++++++++++++++++-------------- Sparkle/SUUpdatePermissionPrompt.m | 28 ++++++----- 3 files changed, 75 insertions(+), 66 deletions(-) diff --git a/Sparkle/SUAutomaticUpdateDriver.m b/Sparkle/SUAutomaticUpdateDriver.m index 44fb18fd..400e8367 100644 --- a/Sparkle/SUAutomaticUpdateDriver.m +++ b/Sparkle/SUAutomaticUpdateDriver.m @@ -51,26 +51,29 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 self.interruptible = NO; [self invalidateShowUpdateAlertTimer]; - if (self.alert) { - [self.alert close]; - } + dispatch_async(dispatch_get_main_queue(), ^{ + if (self.alert) { + [self.alert close]; + } - self.alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:self.updateItem host:self.host completionBlock:^(SUAutomaticInstallationChoice choice) { - [self automaticUpdateAlertFinishedWithChoice:choice]; - }]; + self.alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:self.updateItem host:self.host completionBlock:^(SUAutomaticInstallationChoice choice) { + [self automaticUpdateAlertFinishedWithChoice:choice]; + }]; - // If the app is a menubar app or the like, we need to focus it first and alter the - // update prompt to behave like a normal window. Otherwise if the window were hidden - // there may be no way for the application to be activated to make it visible again. - if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { - [[self.alert window] setHidesOnDeactivate:NO]; - [NSApp activateIgnoringOtherApps:YES]; - } + // If the app is a menubar app or the like, we need to focus it first and alter the + // update prompt to behave like a normal window. Otherwise if the window were hidden + // there may be no way for the application to be activated to make it visible again. + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { + [[self.alert window] setHidesOnDeactivate:NO]; + [NSApp activateIgnoringOtherApps:YES]; + } - if ([NSApp isActive]) - [[self.alert window] makeKeyAndOrderFront:self]; - else - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp]; + if ([NSApp isActive]) { + [[self.alert window] makeKeyAndOrderFront:self]; + } else { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp]; + } + }); } - (void)unarchiverDidFinish:(id)__unused ua diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index 5e1de6f3..4df9ffda 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -66,33 +66,35 @@ return; } - self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:self.updateItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) { - [self updateAlertFinishedWithChoice:choice]; - }]; + dispatch_async(dispatch_get_main_queue(), ^{ + self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:self.updateItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) { + [self updateAlertFinishedWithChoice:choice]; + }]; - id versDisp = nil; - if ([[updater delegate] respondsToSelector:@selector(versionDisplayerForUpdater:)]) { - versDisp = [[updater delegate] versionDisplayerForUpdater:self.updater]; - } - [self.updateAlert setVersionDisplayer:versDisp]; - - // If the app is a menubar app or the like, we need to focus it first and alter the - // update prompt to behave like a normal window. Otherwise if the window were hidden - // there may be no way for the application to be activated to make it visible again. - if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { - [[self.updateAlert window] setHidesOnDeactivate:NO]; - [NSApp activateIgnoringOtherApps:YES]; - } - - // Only show the update alert if the app is active; otherwise, we'll wait until it is. - if ([NSApp isActive]) { - NSWindow *window = [self.updateAlert window]; - if ([self shouldDisableKeyboardShortcutForInstallButton]) { - [self.updateAlert disableKeyboardShortcutForInstallButton]; + id versDisp = nil; + if ([[updater delegate] respondsToSelector:@selector(versionDisplayerForUpdater:)]) { + versDisp = [[updater delegate] versionDisplayerForUpdater:self.updater]; } - [window makeKeyAndOrderFront:self]; - } else - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp]; + [self.updateAlert setVersionDisplayer:versDisp]; + + // If the app is a menubar app or the like, we need to focus it first and alter the + // update prompt to behave like a normal window. Otherwise if the window were hidden + // there may be no way for the application to be activated to make it visible again. + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { + [[self.updateAlert window] setHidesOnDeactivate:NO]; + [NSApp activateIgnoringOtherApps:YES]; + } + + // Only show the update alert if the app is active; otherwise, we'll wait until it is. + if ([NSApp isActive]) { + NSWindow *window = [self.updateAlert window]; + if ([self shouldDisableKeyboardShortcutForInstallButton]) { + [self.updateAlert disableKeyboardShortcutForInstallButton]; + } + [window makeKeyAndOrderFront:self]; + } else + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp]; + }); } - (BOOL)shouldDisableKeyboardShortcutForInstallButton { @@ -313,20 +315,22 @@ - (void)showAlert:(NSAlert *)alert { - id updater = self.updater; - if ([[updater delegate] respondsToSelector:@selector(updaterWillShowModalAlert:)]) { - [[updater delegate] updaterWillShowModalAlert:self.updater]; - } + dispatch_sync(dispatch_get_main_queue(), ^{ + id updater = self.updater; + if ([[updater delegate] respondsToSelector:@selector(updaterWillShowModalAlert:)]) { + [[updater delegate] updaterWillShowModalAlert:self.updater]; + } - // When showing a modal alert we need to ensure that background applications - // are focused to inform the user since there is no dock icon to notify them. - if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [NSApp activateIgnoringOtherApps:YES]; } + // When showing a modal alert we need to ensure that background applications + // are focused to inform the user since there is no dock icon to notify them. + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [NSApp activateIgnoringOtherApps:YES]; } - [alert setIcon:[SUApplicationInfo bestIconForHost:self.host]]; - [alert runModal]; + [alert setIcon:[SUApplicationInfo bestIconForHost:self.host]]; + [alert runModal]; - if ([[updater delegate] respondsToSelector:@selector(updaterDidShowModalAlert:)]) - [[updater delegate] updaterDidShowModalAlert:self.updater]; + if ([[updater delegate] respondsToSelector:@selector(updaterDidShowModalAlert:)]) + [[updater delegate] updaterDidShowModalAlert:self.updater]; + }); } @end diff --git a/Sparkle/SUUpdatePermissionPrompt.m b/Sparkle/SUUpdatePermissionPrompt.m index 7f1c0055..d3773a7c 100644 --- a/Sparkle/SUUpdatePermissionPrompt.m +++ b/Sparkle/SUUpdatePermissionPrompt.m @@ -72,20 +72,22 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE + (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)profile reply:(void (^)(SUUpdatePermissionResponse *))reply { - // If this is a background application we need to focus it in order to bring the prompt - // to the user's attention. Otherwise the prompt would be hidden behind other applications and - // the user would not know why the application was paused. - if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { - [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; - } - - if (![NSApp modalWindow]) { // do not prompt if there is is another modal window on screen - SUUpdatePermissionPrompt *prompt = [[[self class] alloc] initWithHost:host systemProfile:profile reply:reply]; - NSWindow *window = [prompt window]; - if (window) { - [NSApp runModalForWindow:window]; + dispatch_async(dispatch_get_main_queue(), ^{ + // If this is a background application we need to focus it in order to bring the prompt + // to the user's attention. Otherwise the prompt would be hidden behind other applications and + // the user would not know why the application was paused. + if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { + [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; } - } + + if (![NSApp modalWindow]) { // do not prompt if there is is another modal window on screen + SUUpdatePermissionPrompt *prompt = [[[self class] alloc] initWithHost:host systemProfile:profile reply:reply]; + NSWindow *window = [prompt window]; + if (window) { + [NSApp runModalForWindow:window]; + } + } + }); } - (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self.host bundlePath]]; } From fe5737f0b61e53445ef8e07743a907719931279a Mon Sep 17 00:00:00 2001 From: Kornel Date: Fri, 2 Jun 2017 12:21:08 +0100 Subject: [PATCH 02/21] Changelog --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index e35c6598..bd9c599e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ # 1.18.0 + * Name of the host app is used in authorization prompt (the `SPARKLE_RELAUNCH_TOOL_NAME` setting is now obsolete) * More detailed progress bar for package installers (Kornel Lesiński) * Disabled the keyboard shortcut for the install button for scheduled updates to avoid accidental installs. (George Nachman) * generate_appcast tool adds release notes if there's an .html file with the same base name as the archive (Brett Walker) @@ -7,6 +8,7 @@ * Fixed Japanese localization (1024jp) * Fixed escaping of system profile URLs * Added more logging in various failure cases (Kornel Lesiński) + * Better error message for quarantined apps that can't be updated # 1.17.0 From 26d4d75c3696f7fe10482cacbe0a7d700484dfc5 Mon Sep 17 00:00:00 2001 From: Victor Date: Sat, 3 Jun 2017 20:23:14 -0400 Subject: [PATCH 03/21] =?UTF-8?q?Updated=20translation=20to=20reflect=20ch?= =?UTF-8?q?ange=20on=20=E2=80=9CUpdate=20error=20message=20to=20mention=20?= =?UTF-8?q?temp=20folders=20rather=20than=20optical=20drives=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sparkle/pt_BR.lproj/Sparkle.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sparkle/pt_BR.lproj/Sparkle.strings b/Sparkle/pt_BR.lproj/Sparkle.strings index 1e073c87..548fd885 100755 --- a/Sparkle/pt_BR.lproj/Sparkle.strings +++ b/Sparkle/pt_BR.lproj/Sparkle.strings @@ -2,7 +2,7 @@ "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ foi transferido e está pronto para uso! Deseja instalar e reabrir o %1$@ agora?"; -"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ não pode ser atualizado enquanto for executado a partir de um volume somente de leitura, como uma imagem de disco ou CD/DVD. Mova o %1$@ para a pasta Aplicativos, reabra-o e tente novamente."; +"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ não pode ser atualizado porque foi aberto de um volume somente leitura ou local temporário. Use o Finder para copiar %1$@ para a pasta de Aplicativos, reabra-o e tente novamente."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ é a versão mais recente disponível."; From bb83e9a0da1b93392d5c77efbda6a2150f3b012b Mon Sep 17 00:00:00 2001 From: 1024jp <1024jp@wolfrosch.com> Date: Sun, 4 Jun 2017 10:55:45 +0900 Subject: [PATCH 04/21] Updated Japanese translation to reflect change on 55be13c --- Sparkle/ja.lproj/Sparkle.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sparkle/ja.lproj/Sparkle.strings b/Sparkle/ja.lproj/Sparkle.strings index bd009cba..a5ed4122 100644 --- a/Sparkle/ja.lproj/Sparkle.strings +++ b/Sparkle/ja.lproj/Sparkle.strings @@ -2,7 +2,7 @@ "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ がダウンロードされました! 今すぐ %1$@ をインストールして再起動しますか?"; -"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ は、ディスクイメージや光学式ドライブなどの読み出し専用ボリュームから起動している場合アップデートできません。%1$@ をアプリケーションフォルダに移動し、そこから再起動したあとやり直してください。"; +"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ は読み出し専用またはテンポラリな場所で開かれているためアップデートできません。%1$@ をアプリケーションフォルダに移動し、そこから再起動したあとやり直してください。"; "%@ %@ is currently the newest version available." = "%1$@ %2$@ は現在入手できる最新バージョンです。"; From 33bf6732eadae06fd34e2b20749cb9e3214796eb Mon Sep 17 00:00:00 2001 From: Memphiz Date: Wed, 7 Jun 2017 22:08:28 +0200 Subject: [PATCH 05/21] [AppcastItem] - parse and save the sparkle:os attribute of the enclosure element and add isOsxUpdate method to item class --- Sparkle/SUAppcastItem.h | 2 ++ Sparkle/SUAppcastItem.m | 16 +++++++++++++++- Sparkle/SUConstants.h | 5 +++++ Sparkle/SUConstants.m | 3 +++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUAppcastItem.h b/Sparkle/SUAppcastItem.h index 9ed52c9e..071514cc 100644 --- a/Sparkle/SUAppcastItem.h +++ b/Sparkle/SUAppcastItem.h @@ -27,6 +27,7 @@ SU_EXPORT @interface SUAppcastItem : NSObject @property (strong, readonly) NSURL *fileURL; @property (nonatomic, readonly) uint64_t contentLength; @property (copy, readonly) NSString *versionString; +@property (copy, readonly) NSString *osString; @property (copy, readonly) NSString *displayVersionString; @property (copy, readonly) NSDictionary *deltaUpdates; @property (strong, readonly) NSURL *infoURL; @@ -37,6 +38,7 @@ SU_EXPORT @interface SUAppcastItem : NSObject @property (getter=isDeltaUpdate, readonly) BOOL deltaUpdate; @property (getter=isCriticalUpdate, readonly) BOOL criticalUpdate; +@property (getter=isOsxUpdate, readonly) BOOL osxUpdate; @property (getter=isInformationOnlyUpdate, readonly) BOOL informationOnlyUpdate; // Returns the dictionary provided in initWithDictionary; this might be useful later for extensions. diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index 26cba3e7..f70c0589 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -23,6 +23,7 @@ @property (copy, readwrite) NSString *maximumSystemVersion; @property (strong, readwrite) NSURL *fileURL; @property (copy, readwrite) NSString *versionString; +@property (copy, readwrite) NSString *osString; @property (copy, readwrite) NSString *displayVersionString; @property (copy, readwrite) NSDictionary *deltaUpdates; @property (strong, readwrite) NSURL *infoURL; @@ -43,6 +44,7 @@ @synthesize releaseNotesURL; @synthesize title; @synthesize versionString; +@synthesize osString; @synthesize propertiesDictionary; - (BOOL)isDeltaUpdate @@ -56,6 +58,17 @@ return [[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate]; } +- (BOOL)isOsxUpdate +{ + BOOL result = true; + + if (self.osString != nil && [self.osString caseInsensitiveCompare:SUAppcastAttributeValueOsx] != NSOrderedSame) + { + result = false; + } + return result; +} + - (BOOL)isInformationOnlyUpdate { return self.infoURL && !self.fileURL; @@ -150,8 +163,9 @@ } if (enclosure) { self.DSASignature = [enclosure objectForKey:SUAppcastAttributeDSASignature]; + self.osString = [enclosure objectForKey:SUAppcastAttributeOsType]; } - + self.versionString = newVersion; self.minimumSystemVersion = [dict objectForKey:SUAppcastElementMinimumSystemVersion]; self.maximumSystemVersion = [dict objectForKey:SUAppcastElementMaximumSystemVersion]; diff --git a/Sparkle/SUConstants.h b/Sparkle/SUConstants.h index 33abaab6..84d6e363 100644 --- a/Sparkle/SUConstants.h +++ b/Sparkle/SUConstants.h @@ -21,6 +21,8 @@ extern const NSTimeInterval SUDefaultUpdateCheckInterval; extern NSString *const SUBundleIdentifier; +extern NSString *const SUAppcastAttributeValueOsx; + // ----------------------------------------------------------------------------- // Notifications: // ----------------------------------------------------------------------------- @@ -64,6 +66,9 @@ extern NSString *const SUAppcastAttributeDeltaFrom; extern NSString *const SUAppcastAttributeDSASignature; extern NSString *const SUAppcastAttributeShortVersionString; extern NSString *const SUAppcastAttributeVersion; +extern NSString *const SUAppcastAttributeOsType; + + extern NSString *const SUAppcastElementCriticalUpdate; extern NSString *const SUAppcastElementDeltas; diff --git a/Sparkle/SUConstants.m b/Sparkle/SUConstants.m index 5e883f6f..8edff128 100644 --- a/Sparkle/SUConstants.m +++ b/Sparkle/SUConstants.m @@ -21,6 +21,8 @@ const NSTimeInterval SUDefaultUpdateCheckInterval = DEBUG ? 60 : (60 * 60 * 24); NSString *const SUBundleIdentifier = @SPARKLE_BUNDLE_IDENTIFIER; +NSString *const SUAppcastAttributeValueOsx = @"osx"; + NSString *const SUTechnicalErrorInformationKey = @"SUTechnicalErrorInformation"; NSString *const SUHasLaunchedBeforeKey = @"SUHasLaunchedBefore"; @@ -54,6 +56,7 @@ NSString *const SUAppcastAttributeDeltaFrom = @"sparkle:deltaFrom"; NSString *const SUAppcastAttributeDSASignature = @"sparkle:dsaSignature"; NSString *const SUAppcastAttributeShortVersionString = @"sparkle:shortVersionString"; NSString *const SUAppcastAttributeVersion = @"sparkle:version"; +NSString *const SUAppcastAttributeOsType = @"sparkle:os"; NSString *const SUAppcastElementCriticalUpdate = @"sparkle:criticalUpdate"; NSString *const SUAppcastElementDeltas = @"sparkle:deltas"; From 193036b2c49ccef27ddd391b4eb5a43b102856c1 Mon Sep 17 00:00:00 2001 From: Memphiz Date: Wed, 7 Jun 2017 22:09:05 +0200 Subject: [PATCH 06/21] [BasicUpdateDriver] - extend hostSupportsItem method to also check the sparkle:os attribute from the enclosure element to decide if an update item is valid for the host --- Sparkle/SUBasicUpdateDriver.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 6769690c..94041ddc 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -115,12 +115,13 @@ + (BOOL)hostSupportsItem:(SUAppcastItem *)ui { + BOOL osxSupported = [ui isOsxUpdate]; if (([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) && - ([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) { return YES; } + ([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) { return osxSupported; } BOOL minimumVersionOK = TRUE; BOOL maximumVersionOK = TRUE; - + id versionComparator = [[SUStandardVersionComparator alloc] init]; // Check minimum and maximum System Version @@ -131,7 +132,7 @@ maximumVersionOK = [versionComparator compareVersion:[ui maximumSystemVersion] toVersion:[SUOperatingSystem systemVersionString]] != NSOrderedAscending; } - return minimumVersionOK && maximumVersionOK; + return minimumVersionOK && maximumVersionOK && osxSupported; } - (BOOL)isItemNewer:(SUAppcastItem *)ui From 6d0c734c2691fbcab61b69bcb20ab8194ad92c18 Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 7 Jun 2017 23:54:57 +0100 Subject: [PATCH 07/21] Rename OSX macOS --- Sparkle/SUAppcastItem.h | 2 +- Sparkle/SUAppcastItem.m | 6 +++--- Sparkle/SUBasicUpdateDriver.m | 10 ++++++---- Sparkle/SUConstants.h | 2 +- Sparkle/SUConstants.m | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Sparkle/SUAppcastItem.h b/Sparkle/SUAppcastItem.h index 071514cc..5c861ddd 100644 --- a/Sparkle/SUAppcastItem.h +++ b/Sparkle/SUAppcastItem.h @@ -38,7 +38,7 @@ SU_EXPORT @interface SUAppcastItem : NSObject @property (getter=isDeltaUpdate, readonly) BOOL deltaUpdate; @property (getter=isCriticalUpdate, readonly) BOOL criticalUpdate; -@property (getter=isOsxUpdate, readonly) BOOL osxUpdate; +@property (getter=isMacOsUpdate, readonly) BOOL macOsUpdate; @property (getter=isInformationOnlyUpdate, readonly) BOOL informationOnlyUpdate; // Returns the dictionary provided in initWithDictionary; this might be useful later for extensions. diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index 4314504f..3fb1d6cc 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -58,11 +58,11 @@ return [[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate]; } -- (BOOL)isOsxUpdate +- (BOOL)isMacOsUpdate { BOOL result = true; - - if (self.osString != nil && [self.osString caseInsensitiveCompare:SUAppcastAttributeValueOsx] != NSOrderedSame) + + if (self.osString != nil && [self.osString caseInsensitiveCompare:SUAppcastAttributeValueMacOS] != NSOrderedSame) { result = false; } diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 6b3b1799..42d6e185 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -115,13 +115,15 @@ + (BOOL)hostSupportsItem:(SUAppcastItem *)ui { - BOOL osxSupported = [ui isOsxUpdate]; + BOOL osOK = [ui isMacOsUpdate]; if (([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) && - ([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) { return osxSupported; } + ([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) { + return osOK; + } BOOL minimumVersionOK = TRUE; BOOL maximumVersionOK = TRUE; - + id versionComparator = [[SUStandardVersionComparator alloc] init]; // Check minimum and maximum System Version @@ -132,7 +134,7 @@ maximumVersionOK = [versionComparator compareVersion:[ui maximumSystemVersion] toVersion:[SUOperatingSystem systemVersionString]] != NSOrderedAscending; } - return minimumVersionOK && maximumVersionOK && osxSupported; + return minimumVersionOK && maximumVersionOK && osOK; } - (BOOL)isItemNewer:(SUAppcastItem *)ui diff --git a/Sparkle/SUConstants.h b/Sparkle/SUConstants.h index a5a7bda5..9f377e68 100644 --- a/Sparkle/SUConstants.h +++ b/Sparkle/SUConstants.h @@ -21,7 +21,7 @@ extern const NSTimeInterval SUDefaultUpdateCheckInterval; extern NSString *const SUBundleIdentifier; -extern NSString *const SUAppcastAttributeValueOsx; +extern NSString *const SUAppcastAttributeValueMacOS; // ----------------------------------------------------------------------------- // Notifications: diff --git a/Sparkle/SUConstants.m b/Sparkle/SUConstants.m index fe22ef08..955a9c9e 100644 --- a/Sparkle/SUConstants.m +++ b/Sparkle/SUConstants.m @@ -21,7 +21,7 @@ const NSTimeInterval SUDefaultUpdateCheckInterval = DEBUG ? 60 : (60 * 60 * 24); NSString *const SUBundleIdentifier = @SPARKLE_BUNDLE_IDENTIFIER; -NSString *const SUAppcastAttributeValueOsx = @"osx"; +NSString *const SUAppcastAttributeValueMacOS = @"macos"; NSString *const SUTechnicalErrorInformationKey = @"SUTechnicalErrorInformation"; From 4438b69b5052f9f759827ec9d89c09f7794407fb Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 7 Jun 2017 23:56:45 +0100 Subject: [PATCH 08/21] Simplified check --- Sparkle/SUAppcastItem.m | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index 3fb1d6cc..c4293034 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -60,13 +60,7 @@ - (BOOL)isMacOsUpdate { - BOOL result = true; - - if (self.osString != nil && [self.osString caseInsensitiveCompare:SUAppcastAttributeValueMacOS] != NSOrderedSame) - { - result = false; - } - return result; + return self.osString == nil || [self.osString isEqualToString:SUAppcastAttributeValueMacOS]; } - (BOOL)isInformationOnlyUpdate From 3c14c950efa42d6a80fed847e0e2dc1b95b94110 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Sun, 18 Jun 2017 20:33:24 -0700 Subject: [PATCH 09/21] Include bin files in CocoaPods installation This updates the podspec to include the bin scripts in Pods directory when using CocoaPods. This way users don't also have to download the Sparkle repo out of band to sign releases. --- Sparkle.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/Sparkle.podspec b/Sparkle.podspec index ccf1eb4f..2170b3fc 100644 --- a/Sparkle.podspec +++ b/Sparkle.podspec @@ -22,6 +22,7 @@ Pod::Spec.new do |s| s.source = { :http => "https://github.com/sparkle-project/Sparkle/releases/download/#{s.version}/Sparkle-#{s.version}.tar.bz2" } s.source_files = 'Sparkle.framework/Versions/A/Headers/*.h' + s.preserve_paths = 'bin/*' s.public_header_files = 'Sparkle.framework/Versions/A/Headers/*.h' s.vendored_frameworks = 'Sparkle.framework' s.xcconfig = { From c4db636d0b524b1eede677ef5276cdb36bf146be Mon Sep 17 00:00:00 2001 From: Eitot Date: Fri, 23 Jun 2017 05:13:04 +0200 Subject: [PATCH 10/21] Update Dutch localization with some style changes This reflects Apple's localizations a bit better. --- Sparkle/nl.lproj/SUAutomaticUpdateAlert.xib | 6 +-- Sparkle/nl.lproj/SUUpdateAlert.xib | 6 +-- Sparkle/nl.lproj/SUUpdatePermissionPrompt.xib | 14 +++--- Sparkle/nl.lproj/Sparkle.strings | 46 +++++++++---------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Sparkle/nl.lproj/SUAutomaticUpdateAlert.xib b/Sparkle/nl.lproj/SUAutomaticUpdateAlert.xib index cf75d6d6..99637bdb 100644 --- a/Sparkle/nl.lproj/SUAutomaticUpdateAlert.xib +++ b/Sparkle/nl.lproj/SUAutomaticUpdateAlert.xib @@ -57,7 +57,7 @@