diff --git a/.travis.yml b/.travis.yml index 2267c6ec..bfec1ffe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode8.2 +osx_image: xcode9 before_install: - brew update script: make ci diff --git a/CHANGELOG b/CHANGELOG index e35c6598..6e472e0a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,18 @@ -# 1.18.0 +# 1.18.1 + * Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115) (App Tyrant) + * Implemented sparkle:os attribute as documented (Memphiz) + * Additional termination detection in case kpoll fails. (fujisoft) + * Included bin files in CocoaPods installation (Keith Smiley) + * Updated Dutch localization (Eitot) + * Updated German localization (Eitot) + * Updated Japanese translation (1024jp) + * Updated Portuguese translation (Victor) + * Updated to Xcode 9/Swift 4 + + # 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 +20,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 diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index 357c6b99..971c8b9b 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -17,7 +17,7 @@ SPARKLE_ICON_NAME = AppIcon SPARKLE_VERSION_MAJOR = 1 SPARKLE_VERSION_MINOR = 18 -SPARKLE_VERSION_PATCH = 0 +SPARKLE_VERSION_PATCH = 1 SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH) CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION) diff --git a/Configurations/ConfigSwift.xcconfig b/Configurations/ConfigSwift.xcconfig index 8e0862f9..95c45171 100644 --- a/Configurations/ConfigSwift.xcconfig +++ b/Configurations/ConfigSwift.xcconfig @@ -1 +1,2 @@ -SWIFT_VERSION = 3.0 +SWIFT_VERSION = 4.0 +SWIFT_SWIFT3_OBJC_INFERENCE = Off; diff --git a/Sparkle.podspec b/Sparkle.podspec index ccf1eb4f..9235af49 100644 --- a/Sparkle.podspec +++ b/Sparkle.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Sparkle" - s.version = "1.18.0" + s.version = "1.18.1" s.summary = "A software update framework for macOS" s.description = "Sparkle is an easy-to-use software update framework for Cocoa developers." s.homepage = "http://sparkle-project.org" @@ -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 = { diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index e58d6cde..4d533684 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXAggregateTarget section */ @@ -2524,13 +2524,13 @@ }; 726E07AC1CAF08D6001A286B = { CreatedOnToolsVersion = 7.3; - }; + }; 726E07EE1CAF37BD001A286B = { CreatedOnToolsVersion = 7.3; SystemCapabilities = { com.apple.Sandbox = { enabled = 1; - }; + }; }; }; 726E4A151C86C88F00C57C6A = { @@ -2553,7 +2553,7 @@ }; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Sparkle" */; - compatibilityVersion = "Xcode 3.2"; + compatibilityVersion = "Xcode 6.3"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( diff --git a/Sparkle/Autoupdate/TerminationListener.m b/Sparkle/Autoupdate/TerminationListener.m index 8c20fd07..5948fb51 100644 --- a/Sparkle/Autoupdate/TerminationListener.m +++ b/Sparkle/Autoupdate/TerminationListener.m @@ -116,6 +116,11 @@ if ([self terminated]) { [self invokeCompletionWithSuccess:YES]; } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + if ([self terminated]) { + [self invokeCompletionWithSuccess:YES]; + } + }); } static void noteExitKQueueCallback(CFFileDescriptorRef file, CFOptionFlags __unused callBackTypes, void *info) diff --git a/Sparkle/SUAppcastItem.h b/Sparkle/SUAppcastItem.h index 9d7ef34a..f4a6a323 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; @@ -38,6 +39,7 @@ SU_EXPORT @interface SUAppcastItem : NSObject @property (getter=isDeltaUpdate, readonly) BOOL deltaUpdate; @property (getter=isCriticalUpdate, readonly) BOOL criticalUpdate; +@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 1b0f95f2..ef3ddb04 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -151,6 +151,11 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT return [[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate]; } +- (BOOL)isMacOsUpdate +{ + return self.osString == nil || [self.osString isEqualToString:SUAppcastAttributeValueMacOS]; +} + - (BOOL)isInformationOnlyUpdate { return self.infoURL && !self.fileURL; diff --git a/Sparkle/SUConstants.h b/Sparkle/SUConstants.h index 05cc54d2..02725898 100644 --- a/Sparkle/SUConstants.h +++ b/Sparkle/SUConstants.h @@ -23,6 +23,8 @@ extern const NSTimeInterval SUImpatientUpdateCheckInterval; extern NSString *const SUBundleIdentifier; +extern NSString *const SUAppcastAttributeValueMacOS; + // ----------------------------------------------------------------------------- // Notifications: // ----------------------------------------------------------------------------- @@ -35,6 +37,7 @@ extern NSString *const SUTechnicalErrorInformationKey; extern NSString *const SUFeedURLKey; extern NSString *const SUHasLaunchedBeforeKey; +extern NSString *const SUUpdateRelaunchingMarkerKey; extern NSString *const SUShowReleaseNotesKey; extern NSString *const SUSkippedVersionKey; extern NSString *const SUScheduledCheckIntervalKey; @@ -65,6 +68,7 @@ extern NSString *const SUAppcastAttributeDeltaFrom; extern NSString *const SUAppcastAttributeDSASignature; extern NSString *const SUAppcastAttributeShortVersionString; extern NSString *const SUAppcastAttributeVersion; +extern NSString *const SUAppcastAttributeOsType; extern NSString *const SUAppcastAttributeInstallationType; extern NSString *const SUAppcastElementCriticalUpdate; diff --git a/Sparkle/SUConstants.m b/Sparkle/SUConstants.m index f5b501b5..ef3a93dd 100644 --- a/Sparkle/SUConstants.m +++ b/Sparkle/SUConstants.m @@ -26,10 +26,13 @@ const NSTimeInterval SUImpatientUpdateCheckInterval = DEBUG ? (60 * 2) : (60 * 6 NSString *const SUBundleIdentifier = @SPARKLE_BUNDLE_IDENTIFIER; +NSString *const SUAppcastAttributeValueMacOS = @"macos"; + NSString *const SUTechnicalErrorInformationKey = @"SUTechnicalErrorInformation"; NSString *const SUFeedURLKey = @"SUFeedURL"; NSString *const SUHasLaunchedBeforeKey = @"SUHasLaunchedBefore"; +NSString *const SUUpdateRelaunchingMarkerKey = @"SUUpdateRelaunchingMarker"; NSString *const SUShowReleaseNotesKey = @"SUShowReleaseNotes"; NSString *const SUSkippedVersionKey = @"SUSkippedVersion"; NSString *const SUScheduledCheckIntervalKey = @"SUScheduledCheckInterval"; @@ -58,6 +61,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 SUAppcastAttributeInstallationType = @"sparkle:installationType"; NSString *const SUAppcastElementCriticalUpdate = @"sparkle:criticalUpdate"; diff --git a/Sparkle/SUHost.h b/Sparkle/SUHost.h old mode 100644 new mode 100755 diff --git a/Sparkle/SUHost.m b/Sparkle/SUHost.m old mode 100644 new mode 100755 diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index cd55526c..00941547 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -64,11 +64,11 @@ static NSMutableDictionary *sharedUpdaters = nil; id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]]; if (updater) - { + { self = updater; - } - else if (self) - { + } + else if (self) + { if (sharedUpdaters == nil) { sharedUpdaters = [[NSMutableDictionary alloc] init]; } @@ -224,7 +224,7 @@ static NSMutableDictionary *sharedUpdaters = nil; SULog(SULogLevelError, @"-[%@ installUpdatesIfAvailable] does not function anymore.. Instead a background scheduled update check will be done.", NSStringFromClass([self class])); self.loggedInstallUpdatesIfAvailableWarning = YES; - } + } [self checkForUpdatesInBackground]; } @@ -325,7 +325,7 @@ static NSMutableDictionary *sharedUpdaters = nil; { if ([self.delegate respondsToSelector:@selector(updater:willDownloadUpdate:withRequest:)]) { [self.delegate updater:self willDownloadUpdate:item withRequest:request]; - } + } } - (void)updater:(SPUUpdater *)__unused updater failedToDownloadUpdate:(SUAppcastItem *)item error:(NSError *)error diff --git a/Sparkle/SUUpdaterDelegate.h b/Sparkle/SUUpdaterDelegate.h index edbc970c..5e9b258e 100644 --- a/Sparkle/SUUpdaterDelegate.h +++ b/Sparkle/SUUpdaterDelegate.h @@ -195,6 +195,13 @@ __deprecated_msg("See SPUUpdaterDelegate instead") */ - (void)updaterWillRelaunchApplication:(SUUpdater *)updater; +/*! + Called immediately after relaunching. SUUpdater delegate must be set before applicationDidFinishLaunching: to catch this event. + + \param updater The SUUpdater instance. + */ +- (void)updaterDidRelaunchApplication:(SUUpdater *)updater; + /*! Returns an object that compares version numbers to determine their arithmetic relation to each other. diff --git a/Sparkle/de.lproj/SUUpdateAlert.xib b/Sparkle/de.lproj/SUUpdateAlert.xib index 9524bcbb..4818b9d1 100644 --- a/Sparkle/de.lproj/SUUpdateAlert.xib +++ b/Sparkle/de.lproj/SUUpdateAlert.xib @@ -22,7 +22,7 @@ - + @@ -190,7 +190,7 @@ DQ - + diff --git a/Sparkle/de.lproj/SUUpdatePermissionPrompt.xib b/Sparkle/de.lproj/SUUpdatePermissionPrompt.xib index 0f511a79..3b48fe33 100644 --- a/Sparkle/de.lproj/SUUpdatePermissionPrompt.xib +++ b/Sparkle/de.lproj/SUUpdatePermissionPrompt.xib @@ -60,7 +60,7 @@ Gw - + @@ -138,17 +138,17 @@ Gw - + - + - Das anonymisierte Systemprofil unterstützt uns bei der zukünftigen Entwicklung. Bitte kontaktieren Sie uns, wenn Sie Fragen hierzu haben. + Das anonymisierte Systemprofil unterstützt uns bei der zukünftigen Entwicklung. Bitte kontaktiere uns, wenn du Fragen hierzu hast. -Diese Informationen würden an uns gesendet: +Diese Informationen würden an uns gesendet werden: diff --git a/Sparkle/de.lproj/Sparkle.strings b/Sparkle/de.lproj/Sparkle.strings index f8c5cec2..140bb1a5 100644 --- a/Sparkle/de.lproj/Sparkle.strings +++ b/Sparkle/de.lproj/Sparkle.strings @@ -1,38 +1,38 @@ -"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde heruntergeladen und steht zur Verwendung bereit! Dies ist eine wichtige Aktualisierung. Möchten Sie %1$@ jetzt durch die neue Version ersetzen und neu starten?"; +"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde geladen und steht zur Installation bereit! Dies ist ein wichtiges Update. Möchtest du %1$@ jetzt durch die neue Version ersetzen und neu starten?"; -"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde heruntergeladen und steht zur Verwendung bereit! Möchten Sie %1$@ jetzt durch die neue Version ersetzen und neu starten?"; +"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ wurde geladen und steht zur Installation bereit! Möchtest du %1$@ jetzt durch die neue Version ersetzen und neu starten?"; -"%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$@ kann nicht aktualisiert werden, wenn es von einem Volumen ohne Schreibzugriff (z.B. Disk Image oder CD/DVD) gestartet wurde. Kopieren Sie %1$@ in den Programme Ordner, aktualisieren Sie es von dort."; +"%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$@ kann nicht aktualisiert werden, weil es von einem Ort ohne Schreibzugriff oder temporären Ort aus gestartet wurde. Kopiere %1$@ in den Programmeordner, starte es von dort aus und versuche es erneut zu aktualisieren."; -"%@ %@ is currently the newest version available." = "%1$@ %2$@ ist zur Zeit die neueste verfügbare Version."; +"%@ %@ is currently the newest version available." = "%1$@ %2$@ ist zurzeit die neueste verfügbare Version."; /* Description text for SUUpdateAlert when the update is downloadable. */ -"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ ist verfügbar (Sie verwenden Version %3$@). Möchten Sie die neue Version jetzt herunterladen?"; +"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ ist verfügbar – du verwendest Version %3$@. Möchtest du die neue Version jetzt laden?"; /* 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$@ ist verfügbar (Sie verwenden Version %3$@). Möchten Sie mehr über diese Aktualisierung erfahren?"; +"%@ %@ is now available--you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ ist verfügbar – du verwendest Version %3$@. Möchtest du mehr über dieses Update erfahren?"; -"%@ downloaded" = "%@ heruntergeladen"; +"%@ downloaded" = "%@ geladen"; "%@ of %@" = "%1$@ von %2$@"; "A new version of %@ is available!" = "Eine neue Version von %@ ist verfügbar!"; -"A new version of %@ is ready to install!" = "Eine neue Version von %@ ist zur Installation bereit!"; +"A new version of %@ is ready to install!" = "Eine neue Version von %@ steht zur Installation bereit!"; -"An error occurred in retrieving update information. Please try again later." = "Bei der Aktualisierung trat ein Fehler auf. Bitte versuchen Sie es später erneut."; +"An error occurred in retrieving update information. Please try again later." = "Beim Laden der Updateinformationen trat ein Fehler auf. Bitte versuche es später erneut."; -"An error occurred while downloading the update. Please try again later." = "Beim Herunterladen ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut."; +"An error occurred while downloading the update. Please try again later." = "Beim Laden des Updates ist ein Fehler aufgetreten. Bitte versuche es später erneut."; -"An error occurred while extracting the archive. Please try again later." = "Beim Entpacken der Daten ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut."; +"An error occurred while extracting the archive. Please try again later." = "Beim Entpacken des Archivs ist ein Fehler aufgetreten. Bitte versuche es später erneut."; -"An error occurred while installing the update. Please try again later." = "Bei der Installation der Aktualisierung ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut."; +"An error occurred while installing the update. Please try again later." = "Beim Installieren des Updates ist ein Fehler aufgetreten. Bitte versuche es später erneut."; -"An error occurred while parsing the update feed." = "Beim Lesen der Aktualisierungsinformationen ist ein Fehler aufgetreten."; +"An error occurred while parsing the update feed." = "Beim Lesen der Updateinformationen ist ein Fehler aufgetreten."; -"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@." = "Beim erneuten Starten von %1$@ ist ein Fehler aufgetreten. Die neue Version von %1$@ steht beim nächsten Programmstart zur Verfügung."; +"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@." = "Beim Neustart von %1$@ ist ein Fehler aufgetreten. Die neue Version von %1$@ steht beim nächsten Programmstart zur Verfügung."; -"An important update to %@ is ready to install" = "Eine wichtige Aktualisierung von %@ steht zur Installation bereit"; +"An important update to %@ is ready to install" = "Ein wichtiges Update von %@ steht zur Installation bereit"; /* the unit for bytes */ "B" = "B"; @@ -41,21 +41,21 @@ "Cancel Update" = "Aktualisierung abbrechen"; -"Checking for updates..." = "Suche nach Aktualisierungen …"; +"Checking for updates..." = "Nach Updates suchen …"; /* Take care not to overflow the status window. */ -"Downloading update..." = "Aktualisierung wird heruntergeladen …"; +"Downloading update..." = "Update laden …"; /* Take care not to overflow the status window. */ -"Extracting update..." = "Aktualisierung entpacken …"; +"Extracting update..." = "Update entpacken …"; /* the unit for gigabytes */ "GB" = "GB"; -"Install and Relaunch" = "Installieren und erneut starten"; +"Install and Relaunch" = "Installieren und neu starten"; /* Take care not to overflow the status window. */ -"Installing update..." = "Aktualisierung installieren …"; +"Installing update..." = "Update installieren …"; /* the unit for kilobytes */ "KB" = "KB"; @@ -67,17 +67,17 @@ "Ready to Install" = "Bereit zum Installieren"; -"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Soll %1$@ automatisch nach Aktualisierungen suchen? Sie können im %1$@-Menü auch manuell nach Aktualisierungen suchen."; +"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Soll %1$@ automatisch nach Updates suchen? Du kannst im %1$@-Menü auch manuell nach Updates suchen."; -"The update is improperly signed." = "Die Aktualisierung ist nicht ordnungsgemäß signiert."; +"The update is improperly signed." = "Das Update ist nicht ordnungsgemäß signiert."; "Update Error!" = "Fehler beim Aktualisieren!"; "Updating %@" = "Aktualisierung von %@"; -"You already have the newest version of %@." = "Sie haben bereits die neueste Version von %@."; +"You already have the newest version of %@." = "Du hast bereits die neueste Version von %@."; -"You're up-to-date!" = "Sie sind auf dem neuesten Stand!"; +"You're up-to-date!" = "Du bist auf dem neuesten Stand!"; /* Alternative name for "Install" button if we have a paid update or other update without a download but with a URL. */ 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$@ は現在入手できる最新バージョンです。"; diff --git a/Sparkle/nl.lproj/SUUpdateAlert.xib b/Sparkle/nl.lproj/SUUpdateAlert.xib index 62c2fece..0000ab96 100644 --- a/Sparkle/nl.lproj/SUUpdateAlert.xib +++ b/Sparkle/nl.lproj/SUUpdateAlert.xib @@ -143,11 +143,11 @@