From e4821e045493597085fca0a8a1f0b004dfde5b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Tue, 24 Jan 2017 13:29:30 +0000 Subject: [PATCH 01/49] Ability to report installation progress --- Sparkle/Autoupdate/Autoupdate.m | 10 ++++++++-- Sparkle/SUGuidedPackageInstaller.m | 2 +- Sparkle/SUInstallerProtocol.h | 2 +- Sparkle/SUPackageInstaller.m | 2 +- Sparkle/SUPlainInstaller.m | 6 +++--- Tests/SUInstallerTest.m | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Sparkle/Autoupdate/Autoupdate.m b/Sparkle/Autoupdate/Autoupdate.m index 0849ba0d..44cf3a59 100644 --- a/Sparkle/Autoupdate/Autoupdate.m +++ b/Sparkle/Autoupdate/Autoupdate.m @@ -136,7 +136,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5; self.statusController = [[SUStatusController alloc] initWithHost:host]; [self.statusController setButtonTitle:SULocalizedString(@"Cancel Update", @"") target:nil action:Nil isDefault:NO]; [self.statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"") - maxProgressValue: 0 statusText: @""]; + maxProgressValue:100 statusText: @""]; [self.statusController showWindow:self]; } @@ -151,8 +151,14 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5; return; } + void(^progressBlock)(double) = ^(double progress){ + dispatch_async(dispatch_get_main_queue(), ^(){ + self.statusController.progressValue = progress * 100.0; + }); + }; + NSError *finalInstallationError = nil; - if (![installer performFinalInstallation:&finalInstallationError]) { + if (![installer performFinalInstallationProgressBlock:progressBlock error:&finalInstallationError]) { NSError *underlyingError = [finalInstallationError.userInfo objectForKey:NSUnderlyingErrorKey]; dispatch_async(dispatch_get_main_queue(), ^{ if (underlyingError == nil || underlyingError.code != SUInstallationCancelledError) { diff --git a/Sparkle/SUGuidedPackageInstaller.m b/Sparkle/SUGuidedPackageInstaller.m index cea993a2..bd753f1c 100644 --- a/Sparkle/SUGuidedPackageInstaller.m +++ b/Sparkle/SUGuidedPackageInstaller.m @@ -42,7 +42,7 @@ return YES; } -- (BOOL)performFinalInstallation:(NSError * __autoreleasing *)error +- (BOOL)performFinalInstallationProgressBlock:(nullable void(^)(double))progressBlock error:(NSError * __autoreleasing *)error { SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:self.fileOperationToolPath]; diff --git a/Sparkle/SUInstallerProtocol.h b/Sparkle/SUInstallerProtocol.h index 4e07bbd2..75312c47 100644 --- a/Sparkle/SUInstallerProtocol.h +++ b/Sparkle/SUInstallerProtocol.h @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN // Any installation work after the user application has been terminated. This is where the final installation work can be done. // After this stage is done, the user application may be relaunched. // Should be able to be called from non-main thread -- (BOOL)performFinalInstallation:(NSError **)error; +- (BOOL)performFinalInstallationProgressBlock:(nullable void(^)(double))cb error:(NSError **)error; // Indicates whether or not this installer can install the update silently in the background, without hindering the user // Should be thread safe diff --git a/Sparkle/SUPackageInstaller.m b/Sparkle/SUPackageInstaller.m index 92654742..251a0561 100644 --- a/Sparkle/SUPackageInstaller.m +++ b/Sparkle/SUPackageInstaller.m @@ -49,7 +49,7 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open"; return YES; } -- (BOOL)performFinalInstallation:(NSError * __autoreleasing *)error +- (BOOL)performFinalInstallationProgressBlock:(nullable void(^)(double))__unused cb error:(NSError *__autoreleasing*)error { // Run installer using the "open" command to ensure it is launched in front of current application. // -W = wait until the app has quit. diff --git a/Sparkle/SUPlainInstaller.m b/Sparkle/SUPlainInstaller.m index 81ee5cfd..74a480b1 100644 --- a/Sparkle/SUPlainInstaller.m +++ b/Sparkle/SUPlainInstaller.m @@ -61,7 +61,7 @@ return trimmedVersion.length > 0 ? trimmedVersion : nil; } -- (BOOL)performInstallationToURL:(NSURL *)installationURL fromUpdateAtURL:(NSURL *)newURL withHost:(SUHost *)host fileOperationToolPath:(NSString *)fileOperationToolPath error:(NSError * __autoreleasing *)error +- (BOOL)performInstallationToURL:(NSURL *)installationURL fromUpdateAtURL:(NSURL *)newURL withHost:(SUHost *)host fileOperationToolPath:(NSString *)fileOperationToolPath progressBlock:(nullable void(^)(double))progress error:(NSError * __autoreleasing *)error { if (installationURL == nil || newURL == nil) { // this really shouldn't happen but just in case @@ -207,9 +207,9 @@ return YES; } -- (BOOL)performFinalInstallation:(NSError * __autoreleasing *)error +- (BOOL)performFinalInstallationProgressBlock:(nullable void(^)(double))cb error:(NSError *__autoreleasing*)error { - return [self performInstallationToURL:[NSURL fileURLWithPath:self.installationPath] fromUpdateAtURL:[NSURL fileURLWithPath:self.bundlePath] withHost:self.host fileOperationToolPath:self.fileOperationToolPath error:error]; + return [self performInstallationToURL:[NSURL fileURLWithPath:self.installationPath] fromUpdateAtURL:[NSURL fileURLWithPath:self.bundlePath] withHost:self.host fileOperationToolPath:self.fileOperationToolPath progressBlock:cb error:error]; } - (BOOL)canInstallSilently diff --git a/Tests/SUInstallerTest.m b/Tests/SUInstallerTest.m index f5790a72..c750c042 100644 --- a/Tests/SUInstallerTest.m +++ b/Tests/SUInstallerTest.m @@ -71,7 +71,7 @@ } NSError *finalInstallationError = nil; - if (![installer performFinalInstallation:&finalInstallationError]) { + if (![installer performFinalInstallationProgressBlock:nil error:&finalInstallationError]) { XCTFail(@"Failed to perform final installation with underlying error = %@ ; error = %@", [finalInstallationError.userInfo objectForKey:NSUnderlyingErrorKey], finalInstallationError); } From 81e71844d6c5eafbed0909bee99eab053e167ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Tue, 24 Jan 2017 13:30:46 +0000 Subject: [PATCH 02/49] Report plain install progress --- Sparkle/SUPlainInstaller.m | 39 +++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/Sparkle/SUPlainInstaller.m b/Sparkle/SUPlainInstaller.m index 74a480b1..2f326767 100644 --- a/Sparkle/SUPlainInstaller.m +++ b/Sparkle/SUPlainInstaller.m @@ -71,7 +71,9 @@ } return NO; } - + + progress(1/10.0); + SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:fileOperationToolPath]; // Create a temporary directory for our new app that resides on our destination's volume @@ -82,7 +84,9 @@ SULog(SULogLevelError, @"Failed to make new temp directory"); return NO; } - + + progress(2/10.0); + // Move the new app to our temporary directory NSString *newURLLastPathComponent = newURL.lastPathComponent; NSURL *newTempURL = [tempNewDirectoryURL URLByAppendingPathComponent:newURLLastPathComponent]; @@ -91,7 +95,9 @@ [fileManager removeItemAtURL:tempNewDirectoryURL error:NULL]; return NO; } - + + progress(3/10.0); + // Release our new app from quarantine, fix its owner and group IDs, and update its modification time while it's at our temporary destination // We must leave moving the app to its destination as the final step in installing it, so that // it's not possible our new app can be left in an incomplete state at the final destination @@ -101,7 +107,9 @@ // Not big enough of a deal to fail the entire installation SULog(SULogLevelError, @"Failed to release quarantine at %@ with error %@", newTempURL.path, quarantineError); } - + + progress(4/10.0); + NSURL *oldURL = [NSURL fileURLWithPath:host.bundlePath]; if (oldURL == nil) { // this really shouldn't happen but just in case @@ -119,11 +127,16 @@ return NO; } + + progress(5/10.0); + if (![fileManager updateModificationAndAccessTimeOfItemAtURL:newTempURL error:error]) { // Not a fatal error, but a pretty unfortunate one SULog(SULogLevelError, @"Failed to update modification and access time of new app at %@", newTempURL.path); } - + + progress(6/10.0); + // Decide on a destination name we should use for the older app when we move it around the file system NSString *oldDestinationName = nil; if (SPARKLE_APPEND_VERSION_NUMBER) { @@ -145,7 +158,9 @@ [fileManager removeItemAtURL:tempNewDirectoryURL error:NULL]; return NO; } - + + progress(7/10.0); + // Move the old app to the temporary directory NSURL *oldTempURL = [tempOldDirectoryURL URLByAppendingPathComponent:oldDestinationNameWithPathExtension]; if (![fileManager moveItemAtURL:oldURL toURL:oldTempURL error:error]) { @@ -157,7 +172,9 @@ return NO; } - + + progress(8/10.0); + // Move the new app to its final destination if (![fileManager moveItemAtURL:newTempURL toURL:installationURL error:error]) { SULog(SULogLevelError, @"Failed to move new app at %@ to final destination %@", newTempURL.path, installationURL.path); @@ -171,14 +188,18 @@ return NO; } - + + progress(9/10.0); + // From here on out, we don't really need to bring up authorization if we haven't done so prior SUFileManager *constrainedFileManager = [fileManager fileManagerByPreservingAuthorizationRights]; // Cleanup [constrainedFileManager removeItemAtURL:tempOldDirectoryURL error:NULL]; [constrainedFileManager removeItemAtURL:tempNewDirectoryURL error:NULL]; - + + progress(10/10.0); + return YES; } From 2a644672ca7939c50466507f28d4ee9f349edc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Tue, 24 Jan 2017 13:45:11 +0000 Subject: [PATCH 03/49] Report installer progress --- Sparkle/SUFileManager.h | 3 ++- Sparkle/SUFileManager.m | 41 +++++++++++++++++++++++++++--- Sparkle/SUGuidedPackageInstaller.m | 2 +- fileop/fileop.m | 8 +++--- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/Sparkle/SUFileManager.h b/Sparkle/SUFileManager.h index 9434566b..817bad9d 100644 --- a/Sparkle/SUFileManager.h +++ b/Sparkle/SUFileManager.h @@ -146,6 +146,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Runs an installer package (pkg) in a headless mode using /usr/sbin/installer * @param packageURL A URL pointing to the package to execute. The item at this URL must exist. + * @param progressBlock Callback that takes double value (0..1 range) notifying how far the installation has progressed * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. * @return YES if the installer ran the package successfully, otherwise NO with a populated error object * @@ -153,7 +154,7 @@ NS_ASSUME_NONNULL_BEGIN * an initial authorization prompt if the calling process does not have root privileges. In other words, root privileges are required to use this method, and the file manager instance must have been created by allowing authorization. * An error can occur if the package is unable to be ran by the installer, or if the installer reports a non-zero exit status code. */ -- (BOOL)executePackageAtURL:(NSURL *)packageURL error:(NSError *_Nullable*_Nullable)error; +- (BOOL)executePackageAtURL:(NSURL *)packageURL progressBlock:(nullable void(^)(double))progressBlock error:(NSError *_Nullable*_Nullable)error; NS_ASSUME_NONNULL_END diff --git a/Sparkle/SUFileManager.m b/Sparkle/SUFileManager.m index 98800e3a..5be0ae03 100644 --- a/Sparkle/SUFileManager.m +++ b/Sparkle/SUFileManager.m @@ -143,7 +143,11 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return YES; } -- (BOOL)_authorizeAndExecuteCommand:(char *)command sourcePath:(char *)sourcePath destinationPath:(char *)destinationPath error:(NSError * __autoreleasing *)error +- (BOOL)_authorizeAndExecuteCommand:(char *)command sourcePath:(char *)sourcePath destinationPath:(char *)destinationPath error:(NSError * __autoreleasing *)error { + return [self _authorizeAndExecuteCommand:command sourcePath:sourcePath destinationPath:destinationPath lineCallback:nil error:error]; +} + +- (BOOL)_authorizeAndExecuteCommand:(char *)command sourcePath:(char *)sourcePath destinationPath:(char *)destinationPath lineCallback:(void(^)(NSString*))lineCallback error:(NSError * __autoreleasing *)error { NSError *acquireError = nil; if (![self _acquireAuthorizationWithError:&acquireError]) { @@ -183,6 +187,11 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return NO; } + if (lineCallback) { + NSFileHandle *pipeHandle = [[NSFileHandle alloc] initWithFileDescriptor:fileno(pipe) closeOnDealloc:NO]; + [self parseLines:pipeHandle lineCallback:lineCallback]; + } + pid_t childPid = (int32_t)CFSwapInt32LittleToHost(pidData); int status = 0; @@ -203,6 +212,28 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return YES; } +- (void)parseLines:(NSFileHandle *)pipeHandle lineCallback:(void(^)(NSString *))lineCallback { + __block NSMutableData *line = [NSMutableData new]; + pipeHandle.readabilityHandler = ^(NSFileHandle *handle){ + NSData *data = handle.availableData; + NSUInteger length = data.length; + if (!length) { + return; + } + const char *bytes = data.bytes; + for(NSUInteger i = 0; i < length; i++) { + if (bytes[i] == '\n') { + NSData *dataToEOL = [data subdataWithRange:NSMakeRange(0, i)]; + [line appendData:dataToEOL]; + NSString *fullLine = [[NSString alloc] initWithData:line encoding:NSUTF8StringEncoding]; + lineCallback(fullLine); + line = [[data subdataWithRange:NSMakeRange(i+1, length-i-1)] mutableCopy]; + break; + } + } + }; +} + - (void)dealloc { if (_auth != NULL) { @@ -923,7 +954,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { } // Unlike other methods, authorization is required to execute this method successfully -- (BOOL)executePackageAtURL:(NSURL *)packageURL error:(NSError * __autoreleasing *)error +- (BOOL)executePackageAtURL:(NSURL *)packageURL progressBlock:(void(^)(double))progressBlock error:(NSError * __autoreleasing *)error { if (![self _itemExistsAtURL:packageURL]) { if (error != NULL) { @@ -941,7 +972,11 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { } NSError *executeError = nil; - BOOL success = [self _authorizeAndExecuteCommand:SUFileOpInstallCommand sourcePath:path destinationPath:NULL error:&executeError]; + BOOL success = [self _authorizeAndExecuteCommand:SUFileOpInstallCommand sourcePath:path destinationPath:NULL lineCallback:^(NSString *line){ + if ([line hasPrefix:@"installer:%"]) { + progressBlock([[line substringFromIndex:11] doubleValue]/100.0); + } + } error:&executeError]; if (!success && error != NULL) { NSString* errorMessage = @"Failed to execute package installer."; diff --git a/Sparkle/SUGuidedPackageInstaller.m b/Sparkle/SUGuidedPackageInstaller.m index bd753f1c..9c8e6e50 100644 --- a/Sparkle/SUGuidedPackageInstaller.m +++ b/Sparkle/SUGuidedPackageInstaller.m @@ -46,7 +46,7 @@ { SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:self.fileOperationToolPath]; - return [fileManager executePackageAtURL:[NSURL fileURLWithPath:self.packagePath] error:error]; + return [fileManager executePackageAtURL:[NSURL fileURLWithPath:self.packagePath] progressBlock:progressBlock error:error]; } - (BOOL)canInstallSilently diff --git a/fileop/fileop.m b/fileop/fileop.m index 9bb54411..397ccb79 100644 --- a/fileop/fileop.m +++ b/fileop/fileop.m @@ -131,10 +131,12 @@ int main(int argc, const char *argv[]) NSTask *task = [[NSTask alloc] init]; task.launchPath = installerPath; - task.arguments = @[@"-pkg", filepath, @"-target", @"/"]; - // Output won't show up anyway, so we may as well ignore it + task.arguments = @[@"-verboseR", + @"-pkg", filepath, + @"-target", @"/"]; task.standardError = [NSPipe pipe]; - task.standardOutput = [NSPipe pipe]; + // Pass through verbose output from the installer, so the caller can parse it + task.standardOutput = [NSFileHandle fileHandleWithStandardOutput]; @try { [task launch]; From c623480f72fc2adc5f061708d96fc0e5d5ef924e Mon Sep 17 00:00:00 2001 From: Brett Walker Date: Wed, 8 Mar 2017 10:57:59 +0100 Subject: [PATCH 04/49] when generating the appcast, if an .html file exists of the same name as the archive, then it will be linked in as the releaseNotesLink --- generate_appcast/ArchiveItem.swift | 16 ++++++++++++++++ generate_appcast/FeedXML.swift | 13 +++++++++++++ 2 files changed, 29 insertions(+) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 2152bcd2..c172a5af 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -118,6 +118,22 @@ class ArchiveItem: CustomStringConvertible { var fileSize : Int64 { return (self.archiveFileAttributes[.size] as! NSNumber).int64Value; } + + var releaseNotesPath : URL { + let basename = self.archivePath.deletingPathExtension(); + let releaseNotes = basename.appendingPathExtension("html"); + return releaseNotes; + } + + var releaseNotesURL : URL? { + guard let escapedFilename = self.releaseNotesPath.lastPathComponent.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) else { + return nil; + } + if let relative = self.feedURL { + return URL(string: escapedFilename, relativeTo: relative) + } + return URL(string: escapedFilename) + } let mimeType = "application/octet-stream"; } diff --git a/generate_appcast/FeedXML.swift b/generate_appcast/FeedXML.swift index 4492a999..64a064e4 100644 --- a/generate_appcast/FeedXML.swift +++ b/generate_appcast/FeedXML.swift @@ -110,6 +110,19 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws { } minVer?.setChildren([text(update.minimumSystemVersion)]); + let relElement = findElement(name: "sparkle:releaseNotesLink", parent: item); + if nil == relElement { + if FileManager.default.fileExists(atPath: update.releaseNotesPath.path) { + linebreak(item); + item.addChild(XMLElement.element(withName:"sparkle:releaseNotesLink", stringValue: (update.releaseNotesURL?.absoluteString)!) as! XMLElement); + } + } else { + if !FileManager.default.fileExists(atPath: update.releaseNotesPath.path) { + let childIndex = relElement?.index; + item.removeChild(at: childIndex!); + } + } + var enclosure = findElement(name: "enclosure", parent: item); if nil == enclosure { enclosure = XMLElement.element(withName: "enclosure") as? XMLElement; From 3809da20bfc7a4106ea5fc02a1e7e849ba34ee28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Thu, 9 Mar 2017 13:13:29 +0000 Subject: [PATCH 05/49] Warn against abusing installUpdatesIfAvailable --- Sparkle/SUUpdater.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Sparkle/SUUpdater.h b/Sparkle/SUUpdater.h index 679f1b79..a4744755 100644 --- a/Sparkle/SUUpdater.h +++ b/Sparkle/SUUpdater.h @@ -179,15 +179,30 @@ SU_EXPORT @interface SUUpdater : NSObject @property (nonatomic, copy) NSString *decryptionPassword; /*! - Checks for updates and, if available, immediately downloads and installs them. + This function ignores normal update schedule, ignores user preferences, + and interrupts users with an unwanted immediate app update. + + WARNING: this function should not be used in regular apps. This function + is a user-unfriendly hack only for very special cases, like unstable + rapidly-changing beta builds that would not run correctly if they were + even one day out of date. + + Instead of this function you should set `SUAutomaticallyUpdate` to `YES`, + which will gracefully install updates when the app quits. + + For UI-less/daemon apps that aren't usually quit, instead of this function, + you can use the delegate method + SUUpdaterDelegate::updater:willInstallUpdateOnQuit:immediateInstallationInvocation: + to immediately start installation when an update was found. + A progress dialog is shown but the user will never be prompted to read the release notes. + This function will cause update to be downloaded twice if automatic updates are + enabled. + You may want to respond to the userDidCancelDownload delegate method in case the user clicks the "Cancel" button while the update is downloading. - - If you are writing a UI-less background application, you probably want to instead use - SUUpdaterDelegate::updater:willInstallUpdateOnQuit:immediateInstallationInvocation: */ - (void)installUpdatesIfAvailable; From 3098afc90bfb6306af2c776b4a37503d7ed57ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Thu, 9 Mar 2017 13:32:05 +0000 Subject: [PATCH 06/49] Updated swift --- Sparkle/CheckLocalizations.swift | 58 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/Sparkle/CheckLocalizations.swift b/Sparkle/CheckLocalizations.swift index 431e8348..0f8e4e82 100755 --- a/Sparkle/CheckLocalizations.swift +++ b/Sparkle/CheckLocalizations.swift @@ -2,21 +2,21 @@ import Foundation -func die(msg: String) { +func die(_ msg: String) { print("ERROR: \(msg)") exit(1) } -extension NSXMLElement { +extension XMLElement { convenience init(name: String, attributes: [String: String], stringValue string: String? = nil) { self.init(name: name, stringValue: string) - setAttributesWithDictionary(attributes) + setAttributesWith(attributes) } } -let ud = NSUserDefaults.standardUserDefaults() -let sparkleRoot = ud.objectForKey("root") as? String -let htmlPath = ud.objectForKey("htmlPath") as? String +let ud = UserDefaults.standard +let sparkleRoot = ud.object(forKey: "root") as? String +let htmlPath = ud.object(forKey: "htmlPath") as? String if sparkleRoot == nil || htmlPath == nil { die("Missing arguments") } @@ -29,36 +29,36 @@ if enStringsDict == nil { let enStringsDictKeys = enStringsDict!.allKeys let dirPath = NSString(string: sparkleRoot! + "/Sparkle") -let dirContents = try! NSFileManager.defaultManager().contentsOfDirectoryAtPath(dirPath as String) +let dirContents = try! FileManager.default.contentsOfDirectory(atPath: dirPath as String) let css = "body { font-family: sans-serif; font-size: 10pt; }" + "h1 { font-size: 12pt; }" + ".missing { background-color: #FFBABA; color: #D6010E; white-space: pre; }" + ".unused { background-color: #BDE5F8; color: #00529B; white-space: pre; }" + ".unlocalized { background-color: #FEEFB3; color: #9F6000; white-space: pre; }" -var html = NSXMLDocument(rootElement: NSXMLElement(name: "html")) -html.DTD = NSXMLDTD() -html.DTD!.name = html.rootElement()!.name +var html = XMLDocument(rootElement: XMLElement(name: "html")) +html.dtd = XMLDTD() +html.dtd!.name = html.rootElement()!.name html.characterEncoding = "UTF-8" -html.documentContentKind = NSXMLDocumentContentKind.XHTMLKind -var body = NSXMLElement(name: "body") -var head = NSXMLElement(name: "head") +html.documentContentKind = XMLDocument.ContentKind.xhtml +var body = XMLElement(name: "body") +var head = XMLElement(name: "head") html.rootElement()!.addChild(head) html.rootElement()!.addChild(body) -head.addChild(NSXMLElement(name: "meta", attributes: ["charset": html.characterEncoding!])) -head.addChild(NSXMLElement(name: "title", stringValue: "Sparkle Localizations Report")) -head.addChild(NSXMLElement(name: "style", stringValue: css)) +head.addChild(XMLElement(name: "meta", attributes: ["charset": html.characterEncoding!])) +head.addChild(XMLElement(name: "title", stringValue: "Sparkle Localizations Report")) +head.addChild(XMLElement(name: "style", stringValue: css)) -let locale = NSLocale.currentLocale() +let locale = Locale.current for dirEntry in dirContents { if NSString(string: dirEntry).pathExtension != "lproj" || dirEntry == "en.lproj" { continue } - let lang = locale.displayNameForKey(NSLocaleLanguageCode, value: NSString(string: dirEntry).stringByDeletingPathExtension) - body.addChild(NSXMLElement(name: "h1", stringValue: "\(dirEntry) (\(lang!))")) + let lang = (locale as NSLocale).displayName(forKey: NSLocale.Key.languageCode, value: NSString(string: dirEntry).deletingPathExtension) + body.addChild(XMLElement(name: "h1", stringValue: "\(dirEntry) (\(lang!))")) - let stringsPath = NSString(string: dirPath.stringByAppendingPathComponent(dirEntry)).stringByAppendingPathComponent("Sparkle.strings") + let stringsPath = NSString(string: dirPath.appendingPathComponent(dirEntry)).appendingPathComponent("Sparkle.strings") let stringsDict = NSDictionary(contentsOfFile: stringsPath) if stringsDict == nil { die("Invalid strings file \(dirEntry)") @@ -70,10 +70,10 @@ for dirEntry in dirContents { var unused: [String] = [] for key in enStringsDictKeys { - let str = stringsDict?.objectForKey(key) as? String + let str = stringsDict?.object(forKey: key) as? String if str == nil { missing.append(key as! String) - } else if let enStr = enStringsDict?.objectForKey(key) as? String { + } else if let enStr = enStringsDict?.object(forKey: key) as? String { if enStr == str { unlocalized.append(key as! String) } @@ -82,7 +82,7 @@ for dirEntry in dirContents { let stringsDictKeys = stringsDict!.allKeys for key in stringsDictKeys { - if enStringsDict?.objectForKey(key) == nil { + if enStringsDict?.object(forKey: key) == nil { unused.append(key as! String) } } @@ -90,12 +90,12 @@ for dirEntry in dirContents { let sorter = { (s1: String, s2: String) -> Bool in return s1 < s2 } - missing.sortInPlace(sorter) - unlocalized.sortInPlace(sorter) - unused.sortInPlace(sorter) + missing.sort(by: sorter) + unlocalized.sort(by: sorter) + unused.sort(by: sorter) let addRow = { (prefix: String, cssClass: String, key: String) -> Void in - body.addChild(NSXMLElement(name: "span", attributes: ["class": cssClass], stringValue: [prefix, key].joinWithSeparator(" ") + "\n")) + body.addChild(XMLElement(name: "span", attributes: ["class": cssClass], stringValue: [prefix, key].joined(separator: " ") + "\n")) } for key in missing { @@ -110,6 +110,6 @@ for dirEntry in dirContents { } var err: NSError? -if !html.XMLData.writeToFile(htmlPath!, atomically: true) { - die("Can't write report: \(err)") +if !((try? html.xmlData.write(to: URL(fileURLWithPath: htmlPath!), options: [.atomic])) != nil) { + die("Can't write report: \(err!)") } From 40a777f5d9cc2aa8cbade7dbc8422e442c2204cc Mon Sep 17 00:00:00 2001 From: vitu Date: Thu, 9 Mar 2017 11:58:52 -0500 Subject: [PATCH 07/49] Missing strings translation. --- Sparkle/pt_BR.lproj/Sparkle.strings | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Sparkle/pt_BR.lproj/Sparkle.strings b/Sparkle/pt_BR.lproj/Sparkle.strings index a39ebe5a..26097fda 100755 --- a/Sparkle/pt_BR.lproj/Sparkle.strings +++ b/Sparkle/pt_BR.lproj/Sparkle.strings @@ -1,3 +1,5 @@ +"%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$@ foi transferido e está pronto para uso! Esta é uma atualização importante; deseja instalar e reabrir o %1$@ agora?"; + "%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 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." = "%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."; @@ -30,6 +32,8 @@ "An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@." = "Ocorreu um erro ao reabrir o %1$@. A nova versão estará disponível da próxima vez que você abrir o %1$@."; +"An important update to %@ is ready to install" = "Uma atualização importante do %@ está pronta para ser instalada!"; + /* the unit for bytes */ "B" = "B"; @@ -56,20 +60,30 @@ /* the unit for kilobytes */ "KB" = "KB"; +/* Alternative name for "Install" button if we have a paid update or other update + without a download but with a URL. */ +"Learn More..." = "Saber Mais…"; + /* the unit for megabytes */ "MB" = "MB"; +/* OK button. */ "OK" = "OK"; +/* Status message on progress window once download has finished. */ "Ready to Install" = "Pronto para Instalar"; +/* Message that is optionally shown at startup to allow users to turn on/off update checks. */ "Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Deseja que o %1$@ busque atualizações automaticamente? Você pode buscar atualizações manualmente, através do menu %1$@."; -"Update Error!" = "Erro de Atualização!"; +"The update is improperly signed." = "A atualização está assinada incorretamente."; -"Updating %@" = "Atualizando %@"; +"Update Error!" = "Erro de atualização!"; +"Updating %@" = "Atualizando o %@"; + +/* 'Error' message when the user checks for updates but is already current or the feed doesn't contain any updates. (not necessarily shown in UI) */ "You already have the newest version of %@." = "Você já possui a versão mais recente do %@."; +/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */ "You're up-to-date!" = "Você está atualizado!"; - From ac8c37096eba9e09b5b8813fbc20d7cfaa2e2615 Mon Sep 17 00:00:00 2001 From: Brett Walker Date: Sat, 11 Mar 2017 12:09:53 +0100 Subject: [PATCH 08/49] ignore .html files when scanning for archives --- generate_appcast/Unarchive.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_appcast/Unarchive.swift b/generate_appcast/Unarchive.swift index 60e6f906..69537559 100644 --- a/generate_appcast/Unarchive.swift +++ b/generate_appcast/Unarchive.swift @@ -50,7 +50,7 @@ func unarchiveUpdates(archivesSourceDir: URL) throws -> [ArchiveItem] { let dir = try fileManager.contentsOfDirectory(atPath: archivesSourceDir.path); var running = 0; - for item in dir.filter({ !$0.hasPrefix(".") && !$0.hasSuffix(".delta") && !$0.hasSuffix(".xml") }) { + for item in dir.filter({ !$0.hasPrefix(".") && !$0.hasSuffix(".delta") && !$0.hasSuffix(".xml") && !$0.hasSuffix(".html") }) { let itemPath = archivesSourceDir.appendingPathComponent(item); let archiveDestDir = archivesDestDir.appendingPathComponent(itemPath.lastPathComponent); From 615a08bc32250c4229cc23c8e6c686389b9e0b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Wed, 15 Mar 2017 18:34:54 +0000 Subject: [PATCH 09/49] Feed formatting --- generate_appcast/FeedXML.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generate_appcast/FeedXML.swift b/generate_appcast/FeedXML.swift index 64a064e4..d885d8a7 100644 --- a/generate_appcast/FeedXML.swift +++ b/generate_appcast/FeedXML.swift @@ -23,6 +23,7 @@ func findOrCreateElement(name: String, parent: XMLElement) -> XMLElement { return element; } let element = XMLElement(name: name); + linebreak(parent); parent.addChild(element); return element; } @@ -69,7 +70,9 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws { channel = channelNodes[0] as! XMLElement; } else { channel = XMLElement(name: "channel"); + linebreak(channel); channel.addChild(XMLElement.element(withName: "title", stringValue: appBaseName) as! XMLElement); + linebreak(root); root.addChild(channel); } From 1683d2de34f04cea6f6e8ed7523098c783e0b869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Tue, 14 Mar 2017 15:52:13 +0000 Subject: [PATCH 10/49] Simplify release notes link check --- generate_appcast/ArchiveItem.swift | 5 ++++- generate_appcast/FeedXML.swift | 13 +++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index c172a5af..5b7666a1 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -119,13 +119,16 @@ class ArchiveItem: CustomStringConvertible { return (self.archiveFileAttributes[.size] as! NSNumber).int64Value; } - var releaseNotesPath : URL { + private var releaseNotesPath : URL { let basename = self.archivePath.deletingPathExtension(); let releaseNotes = basename.appendingPathExtension("html"); return releaseNotes; } var releaseNotesURL : URL? { + if !FileManager.default.fileExists(atPath: self.releaseNotesPath.path) { + return nil; + } guard let escapedFilename = self.releaseNotesPath.lastPathComponent.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) else { return nil; } diff --git a/generate_appcast/FeedXML.swift b/generate_appcast/FeedXML.swift index d885d8a7..55c3f183 100644 --- a/generate_appcast/FeedXML.swift +++ b/generate_appcast/FeedXML.swift @@ -114,16 +114,13 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws { minVer?.setChildren([text(update.minimumSystemVersion)]); let relElement = findElement(name: "sparkle:releaseNotesLink", parent: item); - if nil == relElement { - if FileManager.default.fileExists(atPath: update.releaseNotesPath.path) { + if let url = update.releaseNotesURL { + if nil == relElement { linebreak(item); - item.addChild(XMLElement.element(withName:"sparkle:releaseNotesLink", stringValue: (update.releaseNotesURL?.absoluteString)!) as! XMLElement); - } - } else { - if !FileManager.default.fileExists(atPath: update.releaseNotesPath.path) { - let childIndex = relElement?.index; - item.removeChild(at: childIndex!); + item.addChild(XMLElement.element(withName:"sparkle:releaseNotesLink", stringValue: url.absoluteString) as! XMLElement); } + } else if let childIndex = relElement?.index { + item.removeChild(at: childIndex); } var enclosure = findElement(name: "enclosure", parent: item); From b6b5c6d92788ae82b3771dfbb48f1bc4bbd94c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Tue, 14 Mar 2017 15:52:38 +0000 Subject: [PATCH 11/49] Link straight to docs from the readme --- README.markdown | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.markdown b/README.markdown index 32b308ee..58c7e5f4 100644 --- a/README.markdown +++ b/README.markdown @@ -33,18 +33,24 @@ Secure and reliable software update framework for Cocoa developers. * Build: Xcode 7 and 10.8 SDK or greater * HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/)) -## API +## Usage + +See [getting started guide](https://sparkle-project.org/documentation/). No code is necessary, but a bit of Xcode configuration is required. + +## Development + +### API symbols Sparkle is built with `-fvisibility=hidden -fvisibility-inlines-hidden` which means no symbols are exported by default. If you are adding a symbol to the public API you must decorate the declaration with the `SU_EXPORT` macro (grep the source code for examples). -## Building the distribution package +### Building the distribution package `cd` to the root of the Sparkle source tree and run `make release`. Sparkle-*VERSION*.tar.bz2 will be created in a temporary directory and revealed in Finder after the build has completed. Alternatively, build the Distribution scheme in the Xcode UI. -## Code of Conduct +### Code of Conduct We pledge to have an open and welcoming environment. See our [Code of Conduct](CODE_OF_CONDUCT.md). From 662e84400a40d11f442a8e238eb8a6337078cb8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Wed, 15 Mar 2017 18:39:29 +0000 Subject: [PATCH 12/49] Inline release notes if they don't look like a standalone HTML document --- generate_appcast/ArchiveItem.swift | 31 +++++++++++++++++++++++++++--- generate_appcast/FeedXML.swift | 7 +++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 5b7666a1..5f8d902a 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -119,17 +119,42 @@ class ArchiveItem: CustomStringConvertible { return (self.archiveFileAttributes[.size] as! NSNumber).int64Value; } - private var releaseNotesPath : URL { + private var releaseNotesPath : URL? { let basename = self.archivePath.deletingPathExtension(); let releaseNotes = basename.appendingPathExtension("html"); + if !FileManager.default.fileExists(atPath: releaseNotes.path) { + return nil; + } return releaseNotes; } + private func getReleaseNotesAsHTMLFragment(_ path: URL) -> String? { + if let html = try? String(contentsOf: path) { + if html.utf8.count < 1000 && + !html.localizedCaseInsensitiveContains(" Date: Tue, 14 Mar 2017 15:50:35 +0000 Subject: [PATCH 13/49] Shush Xcode --- Sparkle.xcodeproj/project.pbxproj | 2 +- Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme | 2 +- Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme | 2 +- Sparkle.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 7c47c62c..8175d07a 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -1628,7 +1628,7 @@ attributes = { CLASSPREFIX = SU; LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0830; ORGANIZATIONNAME = "Sparkle Project"; TargetAttributes = { 5AA96C541E0AE0DB00CA4346 = { diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme index 328e2254..ffa56e90 100644 --- a/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme @@ -1,6 +1,6 @@ Date: Wed, 15 Mar 2017 18:39:44 +0000 Subject: [PATCH 14/49] Special case for .tar.gz extension --- generate_appcast/ArchiveItem.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 5f8d902a..4cee60bf 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -120,7 +120,10 @@ class ArchiveItem: CustomStringConvertible { } private var releaseNotesPath : URL? { - let basename = self.archivePath.deletingPathExtension(); + var basename = self.archivePath.deletingPathExtension(); + if basename.pathExtension == "tar" { // tar.gz + basename = basename.deletingPathExtension(); + } let releaseNotes = basename.appendingPathExtension("html"); if !FileManager.default.fileExists(atPath: releaseNotes.path) { return nil; 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 15/49] 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 0569c73391a981fcc9ab04a6f5859f9491b830b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Fri, 17 Mar 2017 09:25:47 +0000 Subject: [PATCH 16/49] Make generate_appcast available as a shared scheme #1049 --- .../xcschemes/generate_appcast.xcscheme | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Sparkle.xcodeproj/xcshareddata/xcschemes/generate_appcast.xcscheme diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/generate_appcast.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/generate_appcast.xcscheme new file mode 100644 index 00000000..06b35333 --- /dev/null +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/generate_appcast.xcscheme @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 405c9fd9a1c104e536d5f877bae1a39fe0873278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Fri, 24 Mar 2017 11:27:38 +0000 Subject: [PATCH 17/49] Unused --- Sparkle/SUConstants.h | 1 - Sparkle/SUConstants.m | 1 - 2 files changed, 2 deletions(-) diff --git a/Sparkle/SUConstants.h b/Sparkle/SUConstants.h index 33abaab6..ae81a4b4 100644 --- a/Sparkle/SUConstants.h +++ b/Sparkle/SUConstants.h @@ -47,7 +47,6 @@ extern NSString *const SUEnableSystemProfilingKey; extern NSString *const SUSendProfileInfoKey; 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."))); diff --git a/Sparkle/SUConstants.m b/Sparkle/SUConstants.m index 5e883f6f..2fb83829 100644 --- a/Sparkle/SUConstants.m +++ b/Sparkle/SUConstants.m @@ -41,7 +41,6 @@ NSString *const SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate"; NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch"; NSString *const SUEnableJavaScriptKey = @"SUEnableJavaScript"; NSString *const SUFixedHTMLDisplaySizeKey = @"SUFixedHTMLDisplaySize"; -NSString *const SUKeepDownloadOnFailedInstallKey = @"SUKeepDownloadOnFailedInstall"; NSString *const SUDefaultsDomainKey = @"SUDefaultsDomain"; NSString *const SUSparkleErrorDomain = @"SUSparkleErrorDomain"; From 4bc2e6e8916e99ac81a10959933f50b645bd9037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Fri, 24 Mar 2017 11:57:45 +0000 Subject: [PATCH 18/49] %s is deliberate in this format string Fixes #1053 --- Sparkle/SUFileManager.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sparkle/SUFileManager.m b/Sparkle/SUFileManager.m index 94696530..87ce81a9 100644 --- a/Sparkle/SUFileManager.m +++ b/Sparkle/SUFileManager.m @@ -174,7 +174,10 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { if (runStatus != errAuthorizationSuccess) { #pragma clang diagnostic pop if (error != NULL) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcstring-format-directive" *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed to run authorization tool %s (%d).", toolPath, (int)runStatus] }]; +#pragma clang diagnostic pop } return NO; } From 89acca1318fb8f4fd54146365e8ca75f69a98183 Mon Sep 17 00:00:00 2001 From: Kornel Date: Fri, 31 Mar 2017 11:08:03 +0100 Subject: [PATCH 19/49] Escape profile URLs better Fixes #1059 --- Sparkle/SUUpdater.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 9a951b3b..4a4b1f11 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -483,6 +483,12 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults return [self.host boolForKey:SUSendProfileInfoKey]; } +static NSString *escapeURLComponent(NSString *str) { + return [[[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] + stringByReplacingOccurrencesOfString:@"=" withString:@"%3d"] + stringByReplacingOccurrencesOfString:@"&" withString:@"%26"]; +} + - (NSURL *)parameterizedFeedURL { NSURL *baseFeedURL = [self feedURL]; @@ -512,7 +518,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults // Build up the parameterized URL. NSMutableArray *parameterStrings = [NSMutableArray array]; for (NSDictionary *currentProfileInfo in parameters) { - [parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", [[[currentProfileInfo objectForKey:@"key"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [[[currentProfileInfo objectForKey:@"value"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; + [parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", escapeURLComponent([[currentProfileInfo objectForKey:@"key"] description]), escapeURLComponent([[currentProfileInfo objectForKey:@"value"] description])]]; } NSString *separatorCharacter = @"?"; From 3e45211bbebb2ef0fea74a69bbb5534c57091490 Mon Sep 17 00:00:00 2001 From: Kornel Date: Fri, 31 Mar 2017 15:15:22 +0100 Subject: [PATCH 20/49] Escape + as well --- Sparkle/SUUpdater.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 4a4b1f11..9e732136 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -484,9 +484,10 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults } static NSString *escapeURLComponent(NSString *str) { - return [[[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] + return [[[[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] stringByReplacingOccurrencesOfString:@"=" withString:@"%3d"] - stringByReplacingOccurrencesOfString:@"&" withString:@"%26"]; + stringByReplacingOccurrencesOfString:@"&" withString:@"%26"] + stringByReplacingOccurrencesOfString:@"+" withString:@"%2b"]; } - (NSURL *)parameterizedFeedURL From 715163fe0debdf754a8071b09e91dc1439ae336c Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 24 Apr 2017 18:03:38 +0100 Subject: [PATCH 21/49] Formatting --- Sparkle/SULog.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sparkle/SULog.m b/Sparkle/SULog.m index 1e816b75..7faa0a6d 100644 --- a/Sparkle/SULog.m +++ b/Sparkle/SULog.m @@ -43,8 +43,8 @@ void SULog(SULogLevel level, NSString *format, ...) // Act the same way os_log() does; don't log to stderr if a terminal device is attached if (!isatty(STDERR_FILENO)) { options |= ASL_OPT_STDERR; - } - + } + NSString *displayName = [[NSFileManager defaultManager] displayNameAtPath:mainBundle.bundlePath]; client = asl_open([displayName stringByAppendingString:@" [Sparkle]"].UTF8String, SPARKLE_BUNDLE_IDENTIFIER, options); queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL); @@ -77,10 +77,10 @@ void SULog(SULogLevel level, NSString *format, ...) // See docs for OS_LOG_TYPE_ERROR os_log_error(logger, "%{public}@", logMessage); break; - } + } #pragma clang diagnostic pop return; -} + } // Otherwise use ASL // Make sure we do not async, because if we async, the log may not be delivered deterministically From 60727bffa53ebfbfaf701575904847827bc1656a Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 24 Apr 2017 18:03:21 +0100 Subject: [PATCH 22/49] Log key read failure --- Sparkle/SUHost.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUHost.m b/Sparkle/SUHost.m index 13dfe144..99719ac2 100644 --- a/Sparkle/SUHost.m +++ b/Sparkle/SUHost.m @@ -127,7 +127,12 @@ if (!keyPath) { return nil; } - return [NSString stringWithContentsOfFile:keyPath encoding:NSASCIIStringEncoding error:nil]; + NSError *error = nil; + key = [NSString stringWithContentsOfFile:keyPath encoding:NSASCIIStringEncoding error:&error]; + if (error) { + SULog(SULogLevelError, @"Error loading %@: %@", keyPath, error); + } + return key; } - (NSString * __nullable)publicDSAKeyFileKey From a2764158d62dc93dbb3cc1968ea19c67aeda1026 Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 3 May 2017 12:34:28 +0100 Subject: [PATCH 23/49] Unify handling of aborted updates --- Sparkle/SUAutomaticUpdateDriver.m | 20 -------------------- Sparkle/SUScheduledUpdateDriver.m | 29 ++++++++--------------------- Sparkle/SUUIBasedUpdateDriver.h | 1 + Sparkle/SUUIBasedUpdateDriver.m | 14 +++++++++----- 4 files changed, 18 insertions(+), 46 deletions(-) diff --git a/Sparkle/SUAutomaticUpdateDriver.m b/Sparkle/SUAutomaticUpdateDriver.m index 44fb18fd..c88aaeaf 100644 --- a/Sparkle/SUAutomaticUpdateDriver.m +++ b/Sparkle/SUAutomaticUpdateDriver.m @@ -29,7 +29,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 @interface SUAutomaticUpdateDriver () @property (assign) BOOL postponingInstallation; -@property (assign) BOOL showErrors; @property (assign) BOOL willUpdateOnTermination; @property (assign) BOOL isTerminating; @property (strong) SUAutomaticUpdateAlert *alert; @@ -40,7 +39,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 @implementation SUAutomaticUpdateDriver @synthesize postponingInstallation; -@synthesize showErrors; @synthesize willUpdateOnTermination; @synthesize isTerminating; @synthesize alert; @@ -202,7 +200,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 [self stopUpdatingOnTermination]; } - self.showErrors = YES; [super installWithToolAndRelaunch:relaunch displayingUserInterface:showUI]; } @@ -231,21 +228,4 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 } } -- (void)abortUpdateWithError:(NSError *)error -{ - if (self.showErrors) { - [super abortUpdateWithError:error]; - } else { - // Call delegate separately here because otherwise it won't know we stopped. - // Normally this gets called by the superclass - id updater = self.updater; - id updaterDelegate = [updater delegate]; - if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) { - [updaterDelegate updater:self.updater didAbortWithError:error]; - } - - [self abortUpdate]; - } -} - @end diff --git a/Sparkle/SUScheduledUpdateDriver.m b/Sparkle/SUScheduledUpdateDriver.m index 18f4826c..a7a840db 100644 --- a/Sparkle/SUScheduledUpdateDriver.m +++ b/Sparkle/SUScheduledUpdateDriver.m @@ -12,13 +12,17 @@ @interface SUScheduledUpdateDriver () -@property (assign) BOOL showErrors; - @end @implementation SUScheduledUpdateDriver -@synthesize showErrors; +- (instancetype)initWithUpdater:(id)anUpdater +{ + if ((self = [super initWithUpdater:anUpdater])) { + self.showErrors = NO; + } + return self; +} - (void)didFindValidUpdate { @@ -39,25 +43,8 @@ [self abortUpdate]; // Don't tell the user that no update was found; this was a scheduled update. } -- (void)abortUpdateWithError:(NSError *)error -{ - if (self.showErrors) { - [super abortUpdateWithError:error]; - } else { - // Call delegate separately here because otherwise it won't know we stopped. - // Normally this gets called by the superclass - id updater = self.updater; - id updaterDelegate = [updater delegate]; - if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) { - [updaterDelegate updater:self.updater didAbortWithError:error]; - } - - [self abortUpdate]; - } -} - - (BOOL)shouldDisableKeyboardShortcutForInstallButton { return YES; } - + @end diff --git a/Sparkle/SUUIBasedUpdateDriver.h b/Sparkle/SUUIBasedUpdateDriver.h index 69f34459..0c9f3914 100644 --- a/Sparkle/SUUIBasedUpdateDriver.h +++ b/Sparkle/SUUIBasedUpdateDriver.h @@ -15,6 +15,7 @@ @class SUStatusController; @interface SUUIBasedUpdateDriver : SUBasicUpdateDriver +@property (assign) BOOL showErrors; - (void)showAlert:(NSAlert *)alert; - (IBAction)cancelDownload:(id)sender; diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index 5e1de6f3..0400e5aa 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -45,11 +45,13 @@ @synthesize statusController; @synthesize updateAlert; +@synthesize showErrors; - (instancetype)initWithUpdater:(id)anUpdater { if ((self = [super initWithUpdater:anUpdater])) { self.automaticallyInstallUpdates = NO; + self.showErrors = YES; } return self; } @@ -293,11 +295,13 @@ - (void)abortUpdateWithError:(NSError *)error { - NSAlert *alert = [[NSAlert alloc] init]; - alert.messageText = SULocalizedString(@"Update Error!", nil); - alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]]; - [alert addButtonWithTitle:SULocalizedString(@"Cancel Update", nil)]; - [self showAlert:alert]; + if (self.showErrors) { + NSAlert *alert = [[NSAlert alloc] init]; + alert.messageText = SULocalizedString(@"Update Error!", nil); + alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]]; + [alert addButtonWithTitle:SULocalizedString(@"Cancel Update", nil)]; + [self showAlert:alert]; + } [super abortUpdateWithError:error]; } From bfada07a2cf07bcff0f3f753b92ebe8247d1d4ce Mon Sep 17 00:00:00 2001 From: Kornel Date: Thu, 18 May 2017 21:48:51 +0100 Subject: [PATCH 24/49] Log more errors --- Sparkle/SUBasicUpdateDriver.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 84a9917a..09b5aa45 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -492,6 +492,10 @@ } NSBundle *sparkleBundle = updater.sparkleBundle; + if (!sparkleBundle) { + SULog(SULogLevelError, @"Sparkle bundle is gone?"); + return; + } // Copy the relauncher into a temporary directory so we can get to it after the new version's installed. // Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems. @@ -501,6 +505,14 @@ NSError *error = nil; BOOL copiedRelaunchPath = NO; + if (!relaunchToolName) { + SULog(SULogLevelError, @"SPARKLE_RELAUNCH_TOOL_NAME not configued"); + } + + if (!relaunchToolSourcePath) { + SULog(SULogLevelError, @"Sparkle.framework is damaged. %@ is missing", relaunchToolName); + } + if (relaunchToolSourcePath) { relaunchCopyTargetPath = [[self appCachePath] stringByAppendingPathComponent:[relaunchToolSourcePath lastPathComponent]]; From fc48e5e4df43d735bd1eb1f7240f1dd1d3d84e0b Mon Sep 17 00:00:00 2001 From: Kornel Date: Thu, 18 May 2017 21:54:56 +0100 Subject: [PATCH 25/49] 1.18.0 --- CHANGELOG | 10 ++++++++++ Configurations/ConfigCommon.xcconfig | 2 +- Sparkle.podspec | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d2d44059..e35c6598 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,13 @@ +# 1.18.0 + + * 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) + * Added `sparkle:shortVersionString` to the enclosure, #1032 (Brett Walker) + * Fixed Japanese localization (1024jp) + * Fixed escaping of system profile URLs + * Added more logging in various failure cases (Kornel Lesiński) + # 1.17.0 * Added Touch Bar support (Bi11) diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index e322fd12..c1a8c503 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -16,7 +16,7 @@ SPARKLE_AUTOMATED_DOWNGRADES = 0 SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0 SPARKLE_VERSION_MAJOR = 1 -SPARKLE_VERSION_MINOR = 17 +SPARKLE_VERSION_MINOR = 18 SPARKLE_VERSION_PATCH = 0 SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH) diff --git a/Sparkle.podspec b/Sparkle.podspec index 16e7378d..ccf1eb4f 100644 --- a/Sparkle.podspec +++ b/Sparkle.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Sparkle" - s.version = "1.17.0" + s.version = "1.18.0" 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" From 55be13ca6faec96ba00164b37a17f5351b7b1b97 Mon Sep 17 00:00:00 2001 From: Kornel Date: Sat, 20 May 2017 17:09:56 +0100 Subject: [PATCH 26/49] Update error message to mention temp folders rather than optical drives Finder is required to remove quarantine from downloaded apps --- Sparkle/SUBasicUpdateDriver.m | 2 +- Sparkle/ar.lproj/Sparkle.strings | 2 +- Sparkle/cs.lproj/Sparkle.strings | 2 +- Sparkle/da.lproj/Sparkle.strings | 2 +- Sparkle/de.lproj/Sparkle.strings | 2 +- Sparkle/el.lproj/Sparkle.strings | 2 +- Sparkle/en.lproj/Sparkle.strings | 2 +- Sparkle/es.lproj/Sparkle.strings | 2 +- Sparkle/fr.lproj/Sparkle.strings | 2 +- Sparkle/it.lproj/Sparkle.strings | 2 +- Sparkle/ja.lproj/Sparkle.strings | 2 +- Sparkle/ko.lproj/Sparkle.strings | 2 +- Sparkle/nb.lproj/Sparkle.strings | 2 +- Sparkle/nl.lproj/Sparkle.strings | 2 +- Sparkle/pl.lproj/Sparkle.strings | 4 ++-- Sparkle/pt_BR.lproj/Sparkle.strings | 2 +- Sparkle/pt_PT.lproj/Sparkle.strings | 2 +- Sparkle/ro.lproj/Sparkle.strings | 2 +- Sparkle/ru.lproj/Sparkle.strings | 2 +- Sparkle/sk.lproj/Sparkle.strings | 2 +- Sparkle/sl.lproj/Sparkle.strings | 2 +- Sparkle/sv.lproj/Sparkle.strings | 2 +- Sparkle/th.lproj/Sparkle.strings | 2 +- Sparkle/tr.lproj/Sparkle.strings | 2 +- Sparkle/uk.lproj/Sparkle.strings | 2 +- Sparkle/zh_CN.lproj/Sparkle.strings | 2 +- Sparkle/zh_TW.lproj/Sparkle.strings | 2 +- 27 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 09b5aa45..d5842622 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -56,7 +56,7 @@ [super checkForUpdatesAtURL:URL host:aHost]; if ([aHost isRunningOnReadOnlyVolume]) { - [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%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.", nil), [aHost name]] }]]; + [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%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.", nil), [aHost name]] }]]; return; } diff --git a/Sparkle/ar.lproj/Sparkle.strings b/Sparkle/ar.lproj/Sparkle.strings index c8f6d535..e163944d 100644 --- a/Sparkle/ar.lproj/Sparkle.strings +++ b/Sparkle/ar.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$@ وهو جاهز للاستخدام، هل ترغب بتثبيت التحديث وإعادة تشغيل %1$@ الآن؟"; -"%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." = "لا يمكن تحديث %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." = "الإصدار %2$@ هو أحدث إصدار متوفر حاليًا لتطبيق %1$@"; diff --git a/Sparkle/cs.lproj/Sparkle.strings b/Sparkle/cs.lproj/Sparkle.strings index 251d007f..aef9bb98 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 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."; +"%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." = "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"; diff --git a/Sparkle/da.lproj/Sparkle.strings b/Sparkle/da.lproj/Sparkle.strings index 0e18c057..46ec942a 100644 --- a/Sparkle/da.lproj/Sparkle.strings +++ b/Sparkle/da.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$@ er hentet og klar til brug! Vil du installere og genstarte %1$@ nu?"; -"%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." = "%1$@ kan ikke opdateres når det køres fra en kun læsbar enhed. Flyt %1$@ til mappen Programmer, genstart derfra og prøv igen."; +"%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$@ kan ikke opdateres når det køres fra en kun læsbar enhed. Flyt %1$@ til mappen Programmer, genstart derfra og prøv igen."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ er den aktuelle version."; diff --git a/Sparkle/de.lproj/Sparkle.strings b/Sparkle/de.lproj/Sparkle.strings index 1fc6a3d7..f8c5cec2 100644 --- a/Sparkle/de.lproj/Sparkle.strings +++ b/Sparkle/de.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$@ wurde heruntergeladen und steht zur Verwendung bereit! Möchten Sie %1$@ jetzt durch die neue Version ersetzen und neu starten?"; -"%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." = "%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, 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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ ist zur Zeit die neueste verfügbare Version."; diff --git a/Sparkle/el.lproj/Sparkle.strings b/Sparkle/el.lproj/Sparkle.strings index 150f3e8e..eb3b5ac0 100644 --- a/Sparkle/el.lproj/Sparkle.strings +++ b/Sparkle/el.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$@ έχει ληφθεί και είναι έτοιμο προς χρήση! Θα θέλατε να το εγκαταστήσετε και να επανεκκινήσετε το %1$@ τώρα;"; -"%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." = "Το %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/en.lproj/Sparkle.strings b/Sparkle/en.lproj/Sparkle.strings index 35d29205..45f7b87e 100644 --- a/Sparkle/en.lproj/Sparkle.strings +++ b/Sparkle/en.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$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?"; -"%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." = "%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."; +"%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$@ can’t be updated when it’s running from a read-only volume like a disk image or an optical drive. Move %1$@ to Applications folder using Finder, relaunch it from there, and try again."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available."; diff --git a/Sparkle/es.lproj/Sparkle.strings b/Sparkle/es.lproj/Sparkle.strings index 490517d7..09293904 100644 --- a/Sparkle/es.lproj/Sparkle.strings +++ b/Sparkle/es.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$@ se han descargado y están listos para utilizar. ¿Le gustaría instalar e iniciar %1$@ ahora?"; -"%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." = "%1$@ no se puede actualizar cuando se ejecuta desde un volumen de sólo lectura como imagen de disco o medio óptico. Mueva %1$@ a su carpeta de Aplicaciones y trate de iniciarlo desde allí."; +"%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$@ no se puede actualizar cuando se ejecuta desde un volumen de sólo lectura como imagen de disco o medio óptico. Mueva %1$@ a su carpeta de Aplicaciones y trate de iniciarlo desde allí."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ es la última versión disponible."; diff --git a/Sparkle/fr.lproj/Sparkle.strings b/Sparkle/fr.lproj/Sparkle.strings index 229afe0b..5262ae13 100644 --- a/Sparkle/fr.lproj/Sparkle.strings +++ b/Sparkle/fr.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$@ a été téléchargé. Voulez-vous l’installer et relancer %1$@ maintenant ?"; -"%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." = "%1$@ ne peut pas être mis à jour quand il fonctionne à partir d’un volume en lecture seule, comme une image disque ou un lecteur optique. Déplacez %1$@ dans votre dossier Applications, relancez-le à partir de là et réessayez."; +"%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$@ ne peut pas être mis à jour quand il fonctionne à partir d’un volume en lecture seule, comme une image disque ou un lecteur optique. Déplacez %1$@ dans votre dossier Applications, relancez-le à partir de là et réessayez."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ est la version la plus récente disponible."; diff --git a/Sparkle/it.lproj/Sparkle.strings b/Sparkle/it.lproj/Sparkle.strings index 19fe027f..5f1b8943 100644 --- a/Sparkle/it.lproj/Sparkle.strings +++ b/Sparkle/it.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$@ è stato scaricato ed è pronto per essere utilizzato! Desideri installare e riavviare %1$@ ora?"; -"%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." = "Impossibile aggiornare %1$@ quando viene eseguito da un volume di sola lettura come un’immagine disco o un’unità ottica. Spostare %1$@ nella Cartella Applicazioni, riavviarlo e riprovare."; +"%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." = "Impossibile aggiornare %1$@ quando viene eseguito da un volume di sola lettura come un’immagine disco o un’unità ottica. Spostare %1$@ nella Cartella Applicazioni, riavviarlo e riprovare."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ è la versione più recente attualmente disponibile."; diff --git a/Sparkle/ja.lproj/Sparkle.strings b/Sparkle/ja.lproj/Sparkle.strings index f0a558cf..bd009cba 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 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." = "%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/ko.lproj/Sparkle.strings b/Sparkle/ko.lproj/Sparkle.strings index 2a816bac..e9b09633 100644 --- a/Sparkle/ko.lproj/Sparkle.strings +++ b/Sparkle/ko.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$@이(가) 다운로드 되었습니다. 프로그램을 업데이트하고 재실행 하시겠습니까?"; -"%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." = "%1$@이(가) 디스크 이미지나 CD 드라이브 같은 읽기 전용 볼륨에서 실행되고 있으므로 업데이트 할 수 없습니다. %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$@이(가) 디스크 이미지나 CD 드라이브 같은 읽기 전용 볼륨에서 실행되고 있으므로 업데이트 할 수 없습니다. %1$@을(를) 응용프로그램 폴더로 이동하여 다시 실행해 주십시오."; "%@ %@ is currently the newest version available." = "%1$@ %2$@이(가) 현재 최신 버전입니다."; diff --git a/Sparkle/nb.lproj/Sparkle.strings b/Sparkle/nb.lproj/Sparkle.strings index 6e954ee3..68a5b930 100644 --- a/Sparkle/nb.lproj/Sparkle.strings +++ b/Sparkle/nb.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$@ er lastet ned og er klar til bruk! Ønsker du å installere og restarte %1$@ nå?"; -"%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." = "%1$@ kan ikke oppdateres fra en 'bare lesbar' enhet som f.eks. en cd. Flytt %1$@ til Programmer-katalogen, start på ny og prøv igjen."; +"%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$@ kan ikke oppdateres fra en 'bare lesbar' enhet som f.eks. en cd. Flytt %1$@ til Programmer-katalogen, start på ny og prøv igjen."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ er nyeste versjon."; diff --git a/Sparkle/nl.lproj/Sparkle.strings b/Sparkle/nl.lproj/Sparkle.strings index e8d710dc..7f47823b 100644 --- a/Sparkle/nl.lproj/Sparkle.strings +++ b/Sparkle/nl.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$@ is gedownload en is klaar voor gebruik! Wilt u %1$@ nu installeren en herstarten?"; -"%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." = "%1$@ kan niet worden geupdate als het van een alleen-lezen volume, zoals een schijfkopie of CD, geopend is. Verplaats %1$@ naar de Map ’Programma’s’, herstart van daar, en probeer opnieuw."; +"%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$@ kan niet worden geupdate als het van een alleen-lezen volume, zoals een schijfkopie of CD, geopend is. Verplaats %1$@ naar de Map ’Programma’s’, herstart van daar, en probeer opnieuw."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ is momenteel de recentste versie."; diff --git a/Sparkle/pl.lproj/Sparkle.strings b/Sparkle/pl.lproj/Sparkle.strings index 064047e3..0eb924af 100644 --- a/Sparkle/pl.lproj/Sparkle.strings +++ b/Sparkle/pl.lproj/Sparkle.strings @@ -1,8 +1,8 @@ /* "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?"; */ "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ został pobrany i jest gotowy do użycia! Czy chcesz teraz zainstalować i ponownie uruchomić %1$@?"; -/* "%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." = "%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."; */ -"%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." = "%1$@ nie może zostać uaktualniony gdy jest uruchomiony z woluminu tylko do odczytu jak obraz dysku lub napęd optyczny. Przenieś %1$@ do folderu Programy, uruchom z nowej lokacji i spróbuj ponownie."; +/* "%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$@ 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$@ 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$@ nie może zostać uaktualniony, ponieważ został uruchomiony z folderu tymczasowego lub tylko do odczytu. Użyj Findera, aby skopiować %1$@ do folderu Programy, uruchom z nowej lokacji i spróbuj ponownie."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ jest najnowszą dostępną wersją."; diff --git a/Sparkle/pt_BR.lproj/Sparkle.strings b/Sparkle/pt_BR.lproj/Sparkle.strings index 26097fda..1e073c87 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 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." = "%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 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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ é a versão mais recente disponível."; diff --git a/Sparkle/pt_PT.lproj/Sparkle.strings b/Sparkle/pt_PT.lproj/Sparkle.strings index 251523f6..38afb7e5 100644 --- a/Sparkle/pt_PT.lproj/Sparkle.strings +++ b/Sparkle/pt_PT.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?" = "O %1$@ %2$@ foi transferido e está pronto a instalar! Gostaria de o fazer agora e reiniciar o %1$@ posteriormente?"; -"%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." = "O %1$@ não pode ser actualizado quando estiver a ser executado a partir de um volume apenas de leitura como uma imagem de disco ou disco óptico. Mova o %1$@ para a sua pasta Aplicações, reinicie-o aí 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." = "O %1$@ não pode ser actualizado quando estiver a ser executado a partir de um volume apenas de leitura como uma imagem de disco ou disco óptico. Mova o %1$@ para a sua pasta Aplicações, reinicie-o aí e tente novamente."; "%@ %@ is currently the newest version available." = "O %1$@ %2$@ é neste momento a versão mais recente disponível."; diff --git a/Sparkle/ro.lproj/Sparkle.strings b/Sparkle/ro.lproj/Sparkle.strings index ff6b8be0..eaf5d25d 100644 --- a/Sparkle/ro.lproj/Sparkle.strings +++ b/Sparkle/ro.lproj/Sparkle.strings @@ -4,7 +4,7 @@ "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ a fost descărcată și este gata de utilizare! Dorești să o instalezi și să relansați %1$@ acum?"; -"%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." = "%1$@ nu poate fi actualizată atunci când a fost pornită de pe un volum read-only ca o imagine disc sau o unitate optică. Mută %1$@ în directorul Aplicații, repornește-o de acolo și încearcă din nou."; +"%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$@ nu poate fi actualizată atunci când a fost pornită de pe un volum read-only ca o imagine disc sau o unitate optică. Mută %1$@ în directorul Aplicații, repornește-o de acolo și încearcă din nou."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ este cea ultima versiune disponibilă."; diff --git a/Sparkle/ru.lproj/Sparkle.strings b/Sparkle/ru.lproj/Sparkle.strings index 1261f77c..c1cd4b42 100644 --- a/Sparkle/ru.lproj/Sparkle.strings +++ b/Sparkle/ru.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$@ загружен и готов к использованию! Хотите установить и перезапустить %1$@?"; -"%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." = "Во время работы %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/sk.lproj/Sparkle.strings b/Sparkle/sk.lproj/Sparkle.strings index ef017bae..c7e3fd6b 100644 --- a/Sparkle/sk.lproj/Sparkle.strings +++ b/Sparkle/sk.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?" = "Aplikácia %1$@ %2$@ bola prevzatá a je pripravená na použitie! Chcete teraz nainštalovať a následne znovu spustiť %1$@?"; -"%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." = "Aplikáciu %1$@ nemožno aktualizovať, ak je spustená zo zväzku s právami len na čítanie (napríklad z obrazu disku alebo optického disku). Presuňte aplikáciu %1$@ do priečinka Applications, spustite ju odtiaľ a potom znova skúste aktualizáciu."; +"%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." = "Aplikáciu %1$@ nemožno aktualizovať, ak je spustená zo zväzku s právami len na čítanie (napríklad z obrazu disku alebo optického disku). Presuňte aplikáciu %1$@ do priečinka Applications, spustite ju odtiaľ a potom znova skúste aktualizáciu."; "%@ %@ is currently the newest version available." = "%1$@ %2$@\nje najnovšia dostupná verzia."; diff --git a/Sparkle/sl.lproj/Sparkle.strings b/Sparkle/sl.lproj/Sparkle.strings index 97a627e4..bb92b145 100644 --- a/Sparkle/sl.lproj/Sparkle.strings +++ b/Sparkle/sl.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$@ je bil uspešno prenešen s spleta in je pripravljen na namestitev. Ga želite namestiti in ponovno zagnati takoj?"; -"%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." = "Programa %1$@ ni mogoče posodobiti, ker ga poganjate iz lokacije, kamor pisanje ni dovoljeno (pogosto je to slika diska dmg ali optična enota). Poskusite %1$@ premakniti v direktorij z aplikacijami (Applications), ga ponovno zagnati in šele nato posodobiti."; +"%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." = "Programa %1$@ ni mogoče posodobiti, ker ga poganjate iz lokacije, kamor pisanje ni dovoljeno (pogosto je to slika diska dmg ali optična enota). Poskusite %1$@ premakniti v direktorij z aplikacijami (Applications), ga ponovno zagnati in šele nato posodobiti."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ je najnovejša verzija programa."; diff --git a/Sparkle/sv.lproj/Sparkle.strings b/Sparkle/sv.lproj/Sparkle.strings index 83acaf50..191929bb 100644 --- a/Sparkle/sv.lproj/Sparkle.strings +++ b/Sparkle/sv.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$@ har hämtats och är klar att använda! Vill du installera det och starta om %1$@ nu?"; -"%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." = "%1$@ kan inte uppdateras när det körs från en skrivskyddad volym som en skivavbild eller en optisk enhet. Flytta %1$@ till mappen Program, starta om det därifrån, och försök igen."; +"%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$@ kan inte uppdateras när det körs från en skrivskyddad volym som en skivavbild eller en optisk enhet. Flytta %1$@ till mappen Program, starta om det därifrån, och försök igen."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ är för närvarande den senaste tillgängliga versionen."; diff --git a/Sparkle/th.lproj/Sparkle.strings b/Sparkle/th.lproj/Sparkle.strings index 193483f4..f8e00c79 100644 --- a/Sparkle/th.lproj/Sparkle.strings +++ b/Sparkle/th.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$@ ได้ถูกดาวน์โหลดและพร้อมใช้งานแล้ว คุณต้องการติดตั้งและเริ่ม %1$@ ใหม่เดี๋ยวนี้หรือไม่"; -"%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." = "%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/tr.lproj/Sparkle.strings b/Sparkle/tr.lproj/Sparkle.strings index fda03413..5f12c471 100644 --- a/Sparkle/tr.lproj/Sparkle.strings +++ b/Sparkle/tr.lproj/Sparkle.strings @@ -4,7 +4,7 @@ /* de_DE v0.1 - No comment provided by engineer. */ -"%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." = "%1$@ uygulaması disk kalıbı içerisindeyken güncellenemez. Lütfen %1$@ uygulamasını Uygulamalar dizinine kopyalayıp yeniden başlatınız."; +"%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$@ uygulaması disk kalıbı içerisindeyken güncellenemez. Lütfen %1$@ uygulamasını Uygulamalar dizinine kopyalayıp yeniden başlatınız."; /* de_DE v0.1 - No comment provided by engineer. */ diff --git a/Sparkle/uk.lproj/Sparkle.strings b/Sparkle/uk.lproj/Sparkle.strings index 9a3a7d15..90679d07 100644 --- a/Sparkle/uk.lproj/Sparkle.strings +++ b/Sparkle/uk.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$@ завантажений і готовий до використання! Бажаєте встановити і перезавантажити %1$@?"; -"%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." = "Під час роботи з %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/zh_CN.lproj/Sparkle.strings b/Sparkle/zh_CN.lproj/Sparkle.strings index e9158627..bb030f8f 100644 --- a/Sparkle/zh_CN.lproj/Sparkle.strings +++ b/Sparkle/zh_CN.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$@ 已下载完毕并可以使用!您想要现在安装 %1$@ 吗?"; -"%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." = "无法更新 %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/zh_TW.lproj/Sparkle.strings b/Sparkle/zh_TW.lproj/Sparkle.strings index 459ef76b..741d87ab 100644 --- a/Sparkle/zh_TW.lproj/Sparkle.strings +++ b/Sparkle/zh_TW.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$@ 已下載且可供使用!您是否要現在安裝並重新啟動%1$@?"; -"%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." = "當 %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 61774b3f7d470b979ec78e14b25db5eb27245f24 Mon Sep 17 00:00:00 2001 From: Kornel Date: Sat, 27 May 2017 11:37:03 +0100 Subject: [PATCH 27/49] Error message tweak --- Sparkle/SUFileManager.m | 2 +- Sparkle/SUHost.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUFileManager.m b/Sparkle/SUFileManager.m index 87ce81a9..7bf08747 100644 --- a/Sparkle/SUFileManager.m +++ b/Sparkle/SUFileManager.m @@ -176,7 +176,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { if (error != NULL) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wcstring-format-directive" - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed to run authorization tool %s (%d).", toolPath, (int)runStatus] }]; + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed to run authorization tool %s (error code %d).", toolPath, (int)runStatus] }]; #pragma clang diagnostic pop } return NO; diff --git a/Sparkle/SUHost.m b/Sparkle/SUHost.m index 99719ac2..fe7345cd 100644 --- a/Sparkle/SUHost.m +++ b/Sparkle/SUHost.m @@ -82,7 +82,7 @@ name = [self objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey]; if (name && name.length > 0) return name; - return [[[NSFileManager defaultManager] displayNameAtPath:[self.bundle bundlePath]] stringByDeletingPathExtension]; + return [[[NSFileManager defaultManager] displayNameAtPath:[self bundlePath]] stringByDeletingPathExtension]; } - (NSString *__nonnull)version From 84b7e5e22fa81636e63c05a92a4449ba7f5fe4fb Mon Sep 17 00:00:00 2001 From: Kornel Date: Sat, 27 May 2017 11:38:19 +0100 Subject: [PATCH 28/49] Prepend app name to Autoupdate.app name --- Sparkle/SUBasicUpdateDriver.m | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index d5842622..bd96b515 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -499,22 +499,29 @@ // Copy the relauncher into a temporary directory so we can get to it after the new version's installed. // Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems. - NSString *const relaunchToolName = @"" SPARKLE_RELAUNCH_TOOL_NAME; - NSString *const relaunchToolSourcePath = [sparkleBundle pathForResource:relaunchToolName ofType:@"app"]; + NSString *const relaunchToolSourceName = @"" SPARKLE_RELAUNCH_TOOL_NAME; + NSString *const relaunchToolSourcePath = [sparkleBundle pathForResource:relaunchToolSourceName ofType:@"app"]; NSString *relaunchCopyTargetPath = nil; NSError *error = nil; BOOL copiedRelaunchPath = NO; - if (!relaunchToolName) { + if (!relaunchToolSourceName || ![relaunchToolSourceName length]) { SULog(SULogLevelError, @"SPARKLE_RELAUNCH_TOOL_NAME not configued"); } if (!relaunchToolSourcePath) { - SULog(SULogLevelError, @"Sparkle.framework is damaged. %@ is missing", relaunchToolName); + SULog(SULogLevelError, @"Sparkle.framework is damaged. %@ is missing", relaunchToolSourceName); } if (relaunchToolSourcePath) { - relaunchCopyTargetPath = [[self appCachePath] stringByAppendingPathComponent:[relaunchToolSourcePath lastPathComponent]]; + NSString *hostBundleBaseName = [[self.host.bundlePath lastPathComponent] stringByDeletingPathExtension]; + if (!hostBundleBaseName) { + SULog(SULogLevelError, @"Unable to get bundlePath"); + hostBundleBaseName = @"Sparkle"; + } + NSString *relaunchCopyBaseName = [NSString stringWithFormat:@"%@ (Autoupdate).app", hostBundleBaseName]; + + relaunchCopyTargetPath = [[self appCachePath] stringByAppendingPathComponent:relaunchCopyBaseName]; SUFileManager *fileManager = [SUFileManager defaultManager]; From d0a6c699daa10e55352dadc6b0f757401fe806fb Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Thu, 1 Jun 2017 16:55:52 -0500 Subject: [PATCH 29/49] Don't assume that the progress block exists (the parameter is nullable) --- Sparkle/SUPlainInstaller.m | 41 ++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/Sparkle/SUPlainInstaller.m b/Sparkle/SUPlainInstaller.m index 2f326767..a7fd0281 100644 --- a/Sparkle/SUPlainInstaller.m +++ b/Sparkle/SUPlainInstaller.m @@ -72,7 +72,9 @@ return NO; } - progress(1/10.0); + if (progress) { + progress(1/10.0); + } SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:fileOperationToolPath]; @@ -85,7 +87,9 @@ return NO; } - progress(2/10.0); + if (progress) { + progress(2/10.0); + } // Move the new app to our temporary directory NSString *newURLLastPathComponent = newURL.lastPathComponent; @@ -96,7 +100,9 @@ return NO; } - progress(3/10.0); + if (progress) { + progress(3/10.0); + } // Release our new app from quarantine, fix its owner and group IDs, and update its modification time while it's at our temporary destination // We must leave moving the app to its destination as the final step in installing it, so that @@ -108,7 +114,9 @@ SULog(SULogLevelError, @"Failed to release quarantine at %@ with error %@", newTempURL.path, quarantineError); } - progress(4/10.0); + if (progress) { + progress(4/10.0); + } NSURL *oldURL = [NSURL fileURLWithPath:host.bundlePath]; if (oldURL == nil) { @@ -127,15 +135,18 @@ return NO; } - - progress(5/10.0); + if (progress) { + progress(5/10.0); + } if (![fileManager updateModificationAndAccessTimeOfItemAtURL:newTempURL error:error]) { // Not a fatal error, but a pretty unfortunate one SULog(SULogLevelError, @"Failed to update modification and access time of new app at %@", newTempURL.path); } - progress(6/10.0); + if (progress) { + progress(6/10.0); + } // Decide on a destination name we should use for the older app when we move it around the file system NSString *oldDestinationName = nil; @@ -159,7 +170,9 @@ return NO; } - progress(7/10.0); + if (progress) { + progress(7/10.0); + } // Move the old app to the temporary directory NSURL *oldTempURL = [tempOldDirectoryURL URLByAppendingPathComponent:oldDestinationNameWithPathExtension]; @@ -173,7 +186,9 @@ return NO; } - progress(8/10.0); + if (progress) { + progress(8/10.0); + } // Move the new app to its final destination if (![fileManager moveItemAtURL:newTempURL toURL:installationURL error:error]) { @@ -189,7 +204,9 @@ return NO; } - progress(9/10.0); + if (progress) { + progress(9/10.0); + } // From here on out, we don't really need to bring up authorization if we haven't done so prior SUFileManager *constrainedFileManager = [fileManager fileManagerByPreservingAuthorizationRights]; @@ -198,7 +215,9 @@ [constrainedFileManager removeItemAtURL:tempOldDirectoryURL error:NULL]; [constrainedFileManager removeItemAtURL:tempNewDirectoryURL error:NULL]; - progress(10/10.0); + if (progress) { + progress(10/10.0); + } return YES; } From fe5737f0b61e53445ef8e07743a907719931279a Mon Sep 17 00:00:00 2001 From: Kornel Date: Fri, 2 Jun 2017 12:21:08 +0100 Subject: [PATCH 30/49] 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 31/49] =?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 32/49] 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 33/49] [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 34/49] [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 35/49] 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 36/49] 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 37/49] 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 38/49] 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 @@