Compare commits

...
51 Commits
Author SHA1 Message Date
Cyril Austin MacDonald b1894ca7c2 Pull request comments 2017-12-12 09:51:54 -05:00
Cyril Austin MacDonald b66d700677 adding method to cancel default installation and pass back the extracted archive instead 2017-12-11 11:35:10 -05:00
Marcus Ososbase 612120a933 1.18.0TB 2017-06-22 18:19:49 -04:00
Marcus Ososbase adebd9f18e Cleanup 2017-06-22 17:58:44 -04:00
Marcus Ososbase 4f2c269e80 Allow auto updates for standard accounts 2017-06-22 17:28:28 -04:00
Marcus Ososbase f5d3cb4500 Allow check for updates even though download not possible 2017-06-22 17:28:28 -04:00
Marcus Ososbase ece2b2e642 Rebased fork on upstream 2017-06-22 17:28:26 -04:00
Marcus Ososbase 744d67c6ed Patched loophole that allowed Sparkle to present UI even though it was suppressed
Added some log statements for future debugging if necessary
2017-06-22 17:27:05 -04:00
Marcus Osobase 094b242f97 Automatically download update and wait until restart to install 2017-06-22 17:27:05 -04:00
Marcus Osobase b3afccee9d Allow delegate to decide how to proceed with new update 2017-06-22 17:26:33 -04:00
Marcus Osobase cd57836ca5 Dont show update window 2017-06-22 17:25:50 -04:00
Justin Simpson 3f2d37486f Added swift friendly function 2017-06-22 17:24:35 -04:00
Marcus Ososbase e308867767 1.14.2 2017-06-22 17:24:13 -04:00
Marcus Ososbase 9715e82a82 Patched loophole that allowed Sparkle to present UI even though it was suppressed
Added some log statements for future debugging if necessary
2017-06-22 17:23:04 -04:00
Marcus Osobase cc75f340e8 Automatically download update and wait until restart to install 2017-06-22 17:22:49 -04:00
Marcus Osobase 17c51da8af Allow delegate to decide how to proceed with new update 2017-06-22 17:22:30 -04:00
Marcus Osobase 48e3a4277e Dont show update window 2017-06-22 17:20:19 -04:00
Kornel 7e9f05865a Merge pull request #1094 from keith/ks/cocoapods-bin
Include bin files in CocoaPods installation
2017-06-19 10:24:38 +01:00
Keith Smiley 3c14c950ef 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.
2017-06-18 20:33:24 -07:00
Kornel 4438b69b50 Simplified check 2017-06-07 23:56:45 +01:00
Kornel 6d0c734c26 Rename OSX macOS 2017-06-07 23:55:34 +01:00
Kornel e8805e0563 Merge pull request #1089 from Memphiz/add_osx_attribute
Add support for the sparkle:os attribute in the enclosure tag
2017-06-07 23:51:10 +01:00
Memphiz 193036b2c4 [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 2017-06-07 22:11:08 +02:00
Memphiz 33bf6732ea [AppcastItem] - parse and save the sparkle:os attribute of the enclosure element and add isOsxUpdate method to item class 2017-06-07 22:10:56 +02:00
Kornel e94fb63ff0 Merge pull request #1087 from 1024jp/japanese
Updated Japanese translation to reflect change on 55be13c
2017-06-04 15:12:32 +01:00
Kornel 84e5925578 Merge pull request #1086 from vitu/master
Updated translation to reflect change on 55be13c
2017-06-04 15:11:51 +01:00
1024jp bb83e9a0da Updated Japanese translation to reflect change on 55be13c 2017-06-04 10:55:45 +09:00
Victor 26d4d75c36 Updated translation to reflect change on “Update error message to mention temp folders rather than optical drives”. 2017-06-03 20:23:14 -04:00
Kornel fe5737f0b6 Changelog 2017-06-02 12:21:08 +01:00
Kornel ac49a3b5b6 Merge pull request #1081 from sparkle-project/autoname
Prepend app name to Autoupdate.app name
2017-06-02 12:01:22 +01:00
Kornel cbeaeb29ec Merge pull request #1084 from ksuther/nil-progress-block
Don't assume that the progress block exists (the parameter is nullable)
2017-06-02 04:14:22 +01:00
Kent Sutherland d0a6c699da Don't assume that the progress block exists (the parameter is nullable) 2017-06-01 16:55:52 -05:00
Kornel 84b7e5e22f Prepend app name to Autoupdate.app name 2017-05-27 11:38:19 +01:00
Kornel 61774b3f7d Error message tweak 2017-05-27 11:37:06 +01:00
Kornel 55be13ca6f Update error message to mention temp folders rather than optical drives
Finder is required to remove quarantine from downloaded apps
2017-05-20 17:09:56 +01:00
Kornel fc48e5e4df 1.18.0 2017-05-18 21:54:56 +01:00
Kornel bfada07a2c Log more errors 2017-05-18 21:48:51 +01:00
Kornel 4f965660f3 Merge pull request #1072 from sparkle-project/autoerror
Unify handling of aborted updates
2017-05-03 16:51:06 +01:00
Kornel a2764158d6 Unify handling of aborted updates 2017-05-03 12:34:28 +01:00
Kornel 60727bffa5 Log key read failure 2017-04-24 18:05:13 +01:00
Kornel 715163fe0d Formatting 2017-04-24 18:05:13 +01:00
Kornel 629c42d62d Merge pull request #1050 from sparkle-project/genapp
generate_appcast improvements
2017-04-14 21:28:07 +02:00
Kornel 3e45211bbe Escape + as well 2017-03-31 15:15:22 +01:00
Kornel 89acca1318 Escape profile URLs better
Fixes #1059
2017-03-31 11:08:03 +01:00
Kornel Lesiński 4bc2e6e891 %s is deliberate in this format string
Fixes #1053
2017-03-24 12:00:12 +00:00
Kornel Lesiński 405c9fd9a1 Unused 2017-03-24 12:00:12 +00:00
Kornel 9232316b19 Merge pull request #1052 from sparkle-project/scheme
Make generate_appcast available as a shared scheme
2017-03-24 11:05:33 +00:00
Kornel Lesiński ac042821d8 Special case for .tar.gz extension 2017-03-15 18:42:08 +00:00
Kornel Lesiński 662e84400a Inline release notes if they don't look like a standalone HTML document 2017-03-15 18:42:08 +00:00
Kornel Lesiński 1683d2de34 Simplify release notes link check 2017-03-15 18:42:08 +00:00
Kornel Lesiński 615a08bc32 Feed formatting 2017-03-15 18:42:08 +00:00
50 changed files with 349 additions and 182 deletions

No files matched your search

+12
View File
@@ -1,3 +1,15 @@
# 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)
* 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)
* Better error message for quarantined apps that can't be updated
# 1.17.0 # 1.17.0
* Added Touch Bar support (Bi11) * Added Touch Bar support (Bi11)
+3 -2
View File
@@ -16,9 +16,10 @@ SPARKLE_AUTOMATED_DOWNGRADES = 0
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0 SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
SPARKLE_VERSION_MAJOR = 1 SPARKLE_VERSION_MAJOR = 1
SPARKLE_VERSION_MINOR = 17 SPARKLE_VERSION_MINOR = 18
SPARKLE_VERSION_PATCH = 0 SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH) TUNNELBEAR_ID = TB
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(TUNNELBEAR_ID)
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION) CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
ALWAYS_SEARCH_USER_PATHS = NO ALWAYS_SEARCH_USER_PATHS = NO
+3 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "Sparkle" s.name = "Sparkle"
s.version = "1.17.0" s.version = "1.18.0TB"
s.summary = "A software update framework for macOS" s.summary = "A software update framework for macOS"
s.description = "Sparkle is an easy-to-use software update framework for Cocoa developers." s.description = "Sparkle is an easy-to-use software update framework for Cocoa developers."
s.homepage = "http://sparkle-project.org" s.homepage = "http://sparkle-project.org"
@@ -19,9 +19,10 @@ Pod::Spec.new do |s|
} }
s.platform = :osx, '10.7' s.platform = :osx, '10.7'
s.source = { :http => "https://github.com/sparkle-project/Sparkle/releases/download/#{s.version}/Sparkle-#{s.version}.tar.bz2" } s.source = { :http => "https://s3.amazonaws.com/tunnelbear/sparkle/Sparkle-#{s.version}.tar.bz2" }
s.source_files = 'Sparkle.framework/Versions/A/Headers/*.h' s.source_files = 'Sparkle.framework/Versions/A/Headers/*.h'
s.preserve_paths = 'bin/*'
s.public_header_files = 'Sparkle.framework/Versions/A/Headers/*.h' s.public_header_files = 'Sparkle.framework/Versions/A/Headers/*.h'
s.vendored_frameworks = 'Sparkle.framework' s.vendored_frameworks = 'Sparkle.framework'
s.xcconfig = { s.xcconfig = {
+3
View File
@@ -27,9 +27,11 @@ SU_EXPORT @interface SUAppcastItem : NSObject
@property (strong, readonly) NSURL *fileURL; @property (strong, readonly) NSURL *fileURL;
@property (nonatomic, readonly) uint64_t contentLength; @property (nonatomic, readonly) uint64_t contentLength;
@property (copy, readonly) NSString *versionString; @property (copy, readonly) NSString *versionString;
@property (copy, readonly) NSString *osString;
@property (copy, readonly) NSString *displayVersionString; @property (copy, readonly) NSString *displayVersionString;
@property (copy, readonly) NSDictionary *deltaUpdates; @property (copy, readonly) NSDictionary *deltaUpdates;
@property (strong, readonly) NSURL *infoURL; @property (strong, readonly) NSURL *infoURL;
@property (strong) NSString *localInstallationPath;
// Initializes with data from a dictionary provided by the RSS class. // Initializes with data from a dictionary provided by the RSS class.
- (instancetype)initWithDictionary:(NSDictionary *)dict; - (instancetype)initWithDictionary:(NSDictionary *)dict;
@@ -37,6 +39,7 @@ SU_EXPORT @interface SUAppcastItem : NSObject
@property (getter=isDeltaUpdate, readonly) BOOL deltaUpdate; @property (getter=isDeltaUpdate, readonly) BOOL deltaUpdate;
@property (getter=isCriticalUpdate, readonly) BOOL criticalUpdate; @property (getter=isCriticalUpdate, readonly) BOOL criticalUpdate;
@property (getter=isMacOsUpdate, readonly) BOOL macOsUpdate;
@property (getter=isInformationOnlyUpdate, readonly) BOOL informationOnlyUpdate; @property (getter=isInformationOnlyUpdate, readonly) BOOL informationOnlyUpdate;
// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions. // Returns the dictionary provided in initWithDictionary; this might be useful later for extensions.
+9 -1
View File
@@ -23,6 +23,7 @@
@property (copy, readwrite) NSString *maximumSystemVersion; @property (copy, readwrite) NSString *maximumSystemVersion;
@property (strong, readwrite) NSURL *fileURL; @property (strong, readwrite) NSURL *fileURL;
@property (copy, readwrite) NSString *versionString; @property (copy, readwrite) NSString *versionString;
@property (copy, readwrite) NSString *osString;
@property (copy, readwrite) NSString *displayVersionString; @property (copy, readwrite) NSString *displayVersionString;
@property (copy, readwrite) NSDictionary *deltaUpdates; @property (copy, readwrite) NSDictionary *deltaUpdates;
@property (strong, readwrite) NSURL *infoURL; @property (strong, readwrite) NSURL *infoURL;
@@ -43,6 +44,7 @@
@synthesize releaseNotesURL; @synthesize releaseNotesURL;
@synthesize title; @synthesize title;
@synthesize versionString; @synthesize versionString;
@synthesize osString;
@synthesize propertiesDictionary; @synthesize propertiesDictionary;
- (BOOL)isDeltaUpdate - (BOOL)isDeltaUpdate
@@ -56,6 +58,11 @@
return [[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate]; return [[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate];
} }
- (BOOL)isMacOsUpdate
{
return self.osString == nil || [self.osString isEqualToString:SUAppcastAttributeValueMacOS];
}
- (BOOL)isInformationOnlyUpdate - (BOOL)isInformationOnlyUpdate
{ {
return self.infoURL && !self.fileURL; return self.infoURL && !self.fileURL;
@@ -150,8 +157,9 @@
} }
if (enclosure) { if (enclosure) {
self.DSASignature = [enclosure objectForKey:SUAppcastAttributeDSASignature]; self.DSASignature = [enclosure objectForKey:SUAppcastAttributeDSASignature];
self.osString = [enclosure objectForKey:SUAppcastAttributeOsType];
} }
self.versionString = newVersion; self.versionString = newVersion;
self.minimumSystemVersion = [dict objectForKey:SUAppcastElementMinimumSystemVersion]; self.minimumSystemVersion = [dict objectForKey:SUAppcastElementMinimumSystemVersion];
self.maximumSystemVersion = [dict objectForKey:SUAppcastElementMaximumSystemVersion]; self.maximumSystemVersion = [dict objectForKey:SUAppcastElementMaximumSystemVersion];
+25 -20
View File
@@ -29,7 +29,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
@interface SUAutomaticUpdateDriver () @interface SUAutomaticUpdateDriver ()
@property (assign) BOOL postponingInstallation; @property (assign) BOOL postponingInstallation;
@property (assign) BOOL showErrors;
@property (assign) BOOL willUpdateOnTermination; @property (assign) BOOL willUpdateOnTermination;
@property (assign) BOOL isTerminating; @property (assign) BOOL isTerminating;
@property (strong) SUAutomaticUpdateAlert *alert; @property (strong) SUAutomaticUpdateAlert *alert;
@@ -40,7 +39,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
@implementation SUAutomaticUpdateDriver @implementation SUAutomaticUpdateDriver
@synthesize postponingInstallation; @synthesize postponingInstallation;
@synthesize showErrors;
@synthesize willUpdateOnTermination; @synthesize willUpdateOnTermination;
@synthesize isTerminating; @synthesize isTerminating;
@synthesize alert; @synthesize alert;
@@ -48,6 +46,15 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
- (void)showUpdateAlert - (void)showUpdateAlert
{ {
id<SUUpdaterPrivate> updater = self.updater;
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
if ([updaterDelegate suppressSparkleUI])
{
[self automaticUpdateAlertFinishedWithChoice:SUInstallLaterChoice];
return;
}
// NSLog(@"[Sparkle showUpdateAlert]");
self.interruptible = NO; self.interruptible = NO;
[self invalidateShowUpdateAlertTimer]; [self invalidateShowUpdateAlertTimer];
@@ -98,10 +105,26 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationInvocation:invocation]; [updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationInvocation:invocation];
} }
//For Swift
else if ([updaterDelegate respondsToSelector:@selector(updater: willInstallUpdateOnQuit:immediateInstallationBlock:)])
{
BOOL relaunch = YES;
BOOL showUI = NO;
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:displayingUserInterface:)]];
[invocation setSelector:@selector(installWithToolAndRelaunch:displayingUserInterface:)];
[invocation setArgument:&relaunch atIndex:2];
[invocation setArgument:&showUI atIndex:3];
[invocation setTarget:self];
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationBlock:^{
[invocation invoke];
}];
}
// If this is marked as a critical update, we'll prompt the user to install it right away. // If this is marked as a critical update, we'll prompt the user to install it right away.
if ([self.updateItem isCriticalUpdate]) if ([self.updateItem isCriticalUpdate])
{ {
// NSLog(@"[Sparkle update deemed critical]");
[self showUpdateAlert]; [self showUpdateAlert];
} }
else else
@@ -202,7 +225,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
[self stopUpdatingOnTermination]; [self stopUpdatingOnTermination];
} }
self.showErrors = YES;
[super installWithToolAndRelaunch:relaunch displayingUserInterface:showUI]; [super installWithToolAndRelaunch:relaunch displayingUserInterface:showUI];
} }
@@ -231,21 +253,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<SUUpdaterPrivate> updater = self.updater;
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
[updaterDelegate updater:self.updater didAbortWithError:error];
}
[self abortUpdate];
}
}
@end @end
+41 -11
View File
@@ -56,7 +56,7 @@
[super checkForUpdatesAtURL:URL host:aHost]; [super checkForUpdatesAtURL:URL host:aHost];
if ([aHost isRunningOnReadOnlyVolume]) 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; return;
} }
@@ -115,12 +115,15 @@
+ (BOOL)hostSupportsItem:(SUAppcastItem *)ui + (BOOL)hostSupportsItem:(SUAppcastItem *)ui
{ {
BOOL osOK = [ui isMacOsUpdate];
if (([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) && if (([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) &&
([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) { return YES; } ([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) {
return osOK;
}
BOOL minimumVersionOK = TRUE; BOOL minimumVersionOK = TRUE;
BOOL maximumVersionOK = TRUE; BOOL maximumVersionOK = TRUE;
id<SUVersionComparison> versionComparator = [[SUStandardVersionComparator alloc] init]; id<SUVersionComparison> versionComparator = [[SUStandardVersionComparator alloc] init];
// Check minimum and maximum System Version // Check minimum and maximum System Version
@@ -131,7 +134,7 @@
maximumVersionOK = [versionComparator compareVersion:[ui maximumSystemVersion] toVersion:[SUOperatingSystem systemVersionString]] != NSOrderedAscending; maximumVersionOK = [versionComparator compareVersion:[ui maximumSystemVersion] toVersion:[SUOperatingSystem systemVersionString]] != NSOrderedAscending;
} }
return minimumVersionOK && maximumVersionOK; return minimumVersionOK && maximumVersionOK && osOK;
} }
- (BOOL)isItemNewer:(SUAppcastItem *)ui - (BOOL)isItemNewer:(SUAppcastItem *)ui
@@ -209,7 +212,11 @@
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification
object:self.updater object:self.updater
userInfo:@{ SUUpdaterAppcastItemNotificationKey: self.updateItem }]; userInfo:@{ SUUpdaterAppcastItemNotificationKey: self.updateItem }];
[self downloadUpdate];
// TB: Always download update.
// Stadard accounts will recieve an auth prompt before installation
[self downloadUpdate];
} }
- (void)didNotFindUpdate - (void)didNotFindUpdate
@@ -364,6 +371,8 @@
NSError *reason = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{NSLocalizedDescriptionKey: @"Failed to extract update."}]; NSError *reason = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{NSLocalizedDescriptionKey: @"Failed to extract update."}];
[self unarchiverDidFailWithError:reason]; [self unarchiverDidFailWithError:reason];
} else { } else {
self.updateItem.localInstallationPath = self.downloadPath.stringByDeletingLastPathComponent;
[unarchiver unarchiveWithCompletionBlock:^(NSError *err){ [unarchiver unarchiveWithCompletionBlock:^(NSError *err){
if (err) { if (err) {
[self unarchiverDidFailWithError:err]; [self unarchiverDidFailWithError:err];
@@ -486,23 +495,44 @@
} }
} }
if ([updaterDelegate respondsToSelector:@selector(updater:willInstallUpdate:)]) { if ([updaterDelegate respondsToSelector:@selector(updater:willInstallUpdate:)]) {
[updaterDelegate updater:self.updater willInstallUpdate:self.updateItem]; BOOL continueInstall = [updaterDelegate updater:self.updater willInstallUpdate:self.updateItem];
if (!continueInstall) {
return;
}
} }
NSBundle *sparkleBundle = updater.sparkleBundle; 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. // 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. // 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 relaunchToolSourceName = @"" SPARKLE_RELAUNCH_TOOL_NAME;
NSString *const relaunchToolSourcePath = [sparkleBundle pathForResource:relaunchToolName ofType:@"app"]; NSString *const relaunchToolSourcePath = [sparkleBundle pathForResource:relaunchToolSourceName ofType:@"app"];
NSString *relaunchCopyTargetPath = nil; NSString *relaunchCopyTargetPath = nil;
NSError *error = nil; NSError *error = nil;
BOOL copiedRelaunchPath = NO; BOOL copiedRelaunchPath = NO;
if (!relaunchToolSourceName || ![relaunchToolSourceName length]) {
SULog(SULogLevelError, @"SPARKLE_RELAUNCH_TOOL_NAME not configued");
}
if (!relaunchToolSourcePath) {
SULog(SULogLevelError, @"Sparkle.framework is damaged. %@ is missing", relaunchToolSourceName);
}
if (relaunchToolSourcePath) { 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]; SUFileManager *fileManager = [SUFileManager defaultManager];
@@ -554,7 +584,7 @@
pathToRelaunch = delegateRelaunchPath; pathToRelaunch = delegateRelaunchPath;
} }
} }
[NSTask launchedTaskWithLaunchPath:relaunchToolPath arguments:@[[self.host bundlePath], [NSTask launchedTaskWithLaunchPath:relaunchToolPath arguments:@[[self.host bundlePath],
pathToRelaunch, pathToRelaunch,
[NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]],
+5 -1
View File
@@ -21,6 +21,8 @@ extern const NSTimeInterval SUDefaultUpdateCheckInterval;
extern NSString *const SUBundleIdentifier; extern NSString *const SUBundleIdentifier;
extern NSString *const SUAppcastAttributeValueMacOS;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Notifications: // Notifications:
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@@ -47,7 +49,6 @@ extern NSString *const SUEnableSystemProfilingKey;
extern NSString *const SUSendProfileInfoKey; extern NSString *const SUSendProfileInfoKey;
extern NSString *const SULastProfileSubmitDateKey; extern NSString *const SULastProfileSubmitDateKey;
extern NSString *const SUPromptUserOnFirstLaunchKey; extern NSString *const SUPromptUserOnFirstLaunchKey;
extern NSString *const SUKeepDownloadOnFailedInstallKey;
extern NSString *const SUDefaultsDomainKey; extern NSString *const SUDefaultsDomainKey;
extern NSString *const SUEnableJavaScriptKey; extern NSString *const SUEnableJavaScriptKey;
extern NSString *const SUFixedHTMLDisplaySizeKey __attribute__((deprecated("This key is obsolete and has no effect."))); extern NSString *const SUFixedHTMLDisplaySizeKey __attribute__((deprecated("This key is obsolete and has no effect.")));
@@ -64,6 +65,9 @@ extern NSString *const SUAppcastAttributeDeltaFrom;
extern NSString *const SUAppcastAttributeDSASignature; extern NSString *const SUAppcastAttributeDSASignature;
extern NSString *const SUAppcastAttributeShortVersionString; extern NSString *const SUAppcastAttributeShortVersionString;
extern NSString *const SUAppcastAttributeVersion; extern NSString *const SUAppcastAttributeVersion;
extern NSString *const SUAppcastAttributeOsType;
extern NSString *const SUAppcastElementCriticalUpdate; extern NSString *const SUAppcastElementCriticalUpdate;
extern NSString *const SUAppcastElementDeltas; extern NSString *const SUAppcastElementDeltas;
+3 -1
View File
@@ -21,6 +21,8 @@ const NSTimeInterval SUDefaultUpdateCheckInterval = DEBUG ? 60 : (60 * 60 * 24);
NSString *const SUBundleIdentifier = @SPARKLE_BUNDLE_IDENTIFIER; NSString *const SUBundleIdentifier = @SPARKLE_BUNDLE_IDENTIFIER;
NSString *const SUAppcastAttributeValueMacOS = @"macos";
NSString *const SUTechnicalErrorInformationKey = @"SUTechnicalErrorInformation"; NSString *const SUTechnicalErrorInformationKey = @"SUTechnicalErrorInformation";
NSString *const SUHasLaunchedBeforeKey = @"SUHasLaunchedBefore"; NSString *const SUHasLaunchedBeforeKey = @"SUHasLaunchedBefore";
@@ -41,7 +43,6 @@ NSString *const SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate";
NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch"; NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch";
NSString *const SUEnableJavaScriptKey = @"SUEnableJavaScript"; NSString *const SUEnableJavaScriptKey = @"SUEnableJavaScript";
NSString *const SUFixedHTMLDisplaySizeKey = @"SUFixedHTMLDisplaySize"; NSString *const SUFixedHTMLDisplaySizeKey = @"SUFixedHTMLDisplaySize";
NSString *const SUKeepDownloadOnFailedInstallKey = @"SUKeepDownloadOnFailedInstall";
NSString *const SUDefaultsDomainKey = @"SUDefaultsDomain"; NSString *const SUDefaultsDomainKey = @"SUDefaultsDomain";
NSString *const SUSparkleErrorDomain = @"SUSparkleErrorDomain"; NSString *const SUSparkleErrorDomain = @"SUSparkleErrorDomain";
@@ -54,6 +55,7 @@ NSString *const SUAppcastAttributeDeltaFrom = @"sparkle:deltaFrom";
NSString *const SUAppcastAttributeDSASignature = @"sparkle:dsaSignature"; NSString *const SUAppcastAttributeDSASignature = @"sparkle:dsaSignature";
NSString *const SUAppcastAttributeShortVersionString = @"sparkle:shortVersionString"; NSString *const SUAppcastAttributeShortVersionString = @"sparkle:shortVersionString";
NSString *const SUAppcastAttributeVersion = @"sparkle:version"; NSString *const SUAppcastAttributeVersion = @"sparkle:version";
NSString *const SUAppcastAttributeOsType = @"sparkle:os";
NSString *const SUAppcastElementCriticalUpdate = @"sparkle:criticalUpdate"; NSString *const SUAppcastElementCriticalUpdate = @"sparkle:criticalUpdate";
NSString *const SUAppcastElementDeltas = @"sparkle:deltas"; NSString *const SUAppcastElementDeltas = @"sparkle:deltas";
+1
View File
@@ -31,6 +31,7 @@ typedef NS_ENUM(OSStatus, SUError) {
// Download phase errors. // Download phase errors.
SUTemporaryDirectoryError = 2000, SUTemporaryDirectoryError = 2000,
SUDownloadError = 2001, SUDownloadError = 2001,
SUHostDirectoryNotWritable = 2002,
// Extraction phase errors. // Extraction phase errors.
SUUnarchivingError = 3000, SUUnarchivingError = 3000,
+4 -1
View File
@@ -174,7 +174,10 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
if (runStatus != errAuthorizationSuccess) { if (runStatus != errAuthorizationSuccess) {
#pragma clang diagnostic pop #pragma clang diagnostic pop
if (error != NULL) { if (error != NULL) {
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed to run authorization tool %s (%d).", toolPath, (int)runStatus] }]; #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 (error code %d).", toolPath, (int)runStatus] }];
#pragma clang diagnostic pop
} }
return NO; return NO;
} }
+7 -2
View File
@@ -82,7 +82,7 @@
name = [self objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey]; name = [self objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey];
if (name && name.length > 0) return name; 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 - (NSString *__nonnull)version
@@ -127,7 +127,12 @@
if (!keyPath) { if (!keyPath) {
return nil; 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 - (NSString * __nullable)publicDSAKeyFileKey
+4 -4
View File
@@ -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 // Act the same way os_log() does; don't log to stderr if a terminal device is attached
if (!isatty(STDERR_FILENO)) { if (!isatty(STDERR_FILENO)) {
options |= ASL_OPT_STDERR; options |= ASL_OPT_STDERR;
} }
NSString *displayName = [[NSFileManager defaultManager] displayNameAtPath:mainBundle.bundlePath]; NSString *displayName = [[NSFileManager defaultManager] displayNameAtPath:mainBundle.bundlePath];
client = asl_open([displayName stringByAppendingString:@" [Sparkle]"].UTF8String, SPARKLE_BUNDLE_IDENTIFIER, options); client = asl_open([displayName stringByAppendingString:@" [Sparkle]"].UTF8String, SPARKLE_BUNDLE_IDENTIFIER, options);
queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL); 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 // See docs for OS_LOG_TYPE_ERROR
os_log_error(logger, "%{public}@", logMessage); os_log_error(logger, "%{public}@", logMessage);
break; break;
} }
#pragma clang diagnostic pop #pragma clang diagnostic pop
return; return;
} }
// Otherwise use ASL // Otherwise use ASL
// Make sure we do not async, because if we async, the log may not be delivered deterministically // Make sure we do not async, because if we async, the log may not be delivered deterministically
+30 -11
View File
@@ -72,7 +72,9 @@
return NO; return NO;
} }
progress(1/10.0); if (progress) {
progress(1/10.0);
}
SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:fileOperationToolPath]; SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:fileOperationToolPath];
@@ -85,7 +87,9 @@
return NO; return NO;
} }
progress(2/10.0); if (progress) {
progress(2/10.0);
}
// Move the new app to our temporary directory // Move the new app to our temporary directory
NSString *newURLLastPathComponent = newURL.lastPathComponent; NSString *newURLLastPathComponent = newURL.lastPathComponent;
@@ -96,7 +100,9 @@
return NO; 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 // 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 // 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); 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]; NSURL *oldURL = [NSURL fileURLWithPath:host.bundlePath];
if (oldURL == nil) { if (oldURL == nil) {
@@ -127,15 +135,18 @@
return NO; return NO;
} }
if (progress) {
progress(5/10.0); progress(5/10.0);
}
if (![fileManager updateModificationAndAccessTimeOfItemAtURL:newTempURL error:error]) { if (![fileManager updateModificationAndAccessTimeOfItemAtURL:newTempURL error:error]) {
// Not a fatal error, but a pretty unfortunate one // Not a fatal error, but a pretty unfortunate one
SULog(SULogLevelError, @"Failed to update modification and access time of new app at %@", newTempURL.path); 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 // Decide on a destination name we should use for the older app when we move it around the file system
NSString *oldDestinationName = nil; NSString *oldDestinationName = nil;
@@ -159,7 +170,9 @@
return NO; return NO;
} }
progress(7/10.0); if (progress) {
progress(7/10.0);
}
// Move the old app to the temporary directory // Move the old app to the temporary directory
NSURL *oldTempURL = [tempOldDirectoryURL URLByAppendingPathComponent:oldDestinationNameWithPathExtension]; NSURL *oldTempURL = [tempOldDirectoryURL URLByAppendingPathComponent:oldDestinationNameWithPathExtension];
@@ -173,7 +186,9 @@
return NO; return NO;
} }
progress(8/10.0); if (progress) {
progress(8/10.0);
}
// Move the new app to its final destination // Move the new app to its final destination
if (![fileManager moveItemAtURL:newTempURL toURL:installationURL error:error]) { if (![fileManager moveItemAtURL:newTempURL toURL:installationURL error:error]) {
@@ -189,7 +204,9 @@
return NO; 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 // From here on out, we don't really need to bring up authorization if we haven't done so prior
SUFileManager *constrainedFileManager = [fileManager fileManagerByPreservingAuthorizationRights]; SUFileManager *constrainedFileManager = [fileManager fileManagerByPreservingAuthorizationRights];
@@ -198,7 +215,9 @@
[constrainedFileManager removeItemAtURL:tempOldDirectoryURL error:NULL]; [constrainedFileManager removeItemAtURL:tempOldDirectoryURL error:NULL];
[constrainedFileManager removeItemAtURL:tempNewDirectoryURL error:NULL]; [constrainedFileManager removeItemAtURL:tempNewDirectoryURL error:NULL];
progress(10/10.0); if (progress) {
progress(10/10.0);
}
return YES; return YES;
} }
+8 -21
View File
@@ -12,13 +12,17 @@
@interface SUScheduledUpdateDriver () @interface SUScheduledUpdateDriver ()
@property (assign) BOOL showErrors;
@end @end
@implementation SUScheduledUpdateDriver @implementation SUScheduledUpdateDriver
@synthesize showErrors; - (instancetype)initWithUpdater:(id<SUUpdaterPrivate>)anUpdater
{
if ((self = [super initWithUpdater:anUpdater])) {
self.showErrors = NO;
}
return self;
}
- (void)didFindValidUpdate - (void)didFindValidUpdate
{ {
@@ -39,25 +43,8 @@
[self abortUpdate]; // Don't tell the user that no update was found; this was a scheduled update. [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<SUUpdaterPrivate> updater = self.updater;
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
[updaterDelegate updater:self.updater didAbortWithError:error];
}
[self abortUpdate];
}
}
- (BOOL)shouldDisableKeyboardShortcutForInstallButton { - (BOOL)shouldDisableKeyboardShortcutForInstallButton {
return YES; return YES;
} }
@end @end
+1
View File
@@ -15,6 +15,7 @@
@class SUStatusController; @class SUStatusController;
@interface SUUIBasedUpdateDriver : SUBasicUpdateDriver @interface SUUIBasedUpdateDriver : SUBasicUpdateDriver
@property (assign) BOOL showErrors;
- (void)showAlert:(NSAlert *)alert; - (void)showAlert:(NSAlert *)alert;
- (IBAction)cancelDownload:(id)sender; - (IBAction)cancelDownload:(id)sender;
+34 -52
View File
@@ -45,11 +45,13 @@
@synthesize statusController; @synthesize statusController;
@synthesize updateAlert; @synthesize updateAlert;
@synthesize showErrors;
- (instancetype)initWithUpdater:(id<SUUpdaterPrivate>)anUpdater - (instancetype)initWithUpdater:(id<SUUpdaterPrivate>)anUpdater
{ {
if ((self = [super initWithUpdater:anUpdater])) { if ((self = [super initWithUpdater:anUpdater])) {
self.automaticallyInstallUpdates = NO; self.automaticallyInstallUpdates = NO;
self.showErrors = YES;
} }
return self; return self;
} }
@@ -57,42 +59,16 @@
- (void)didFindValidUpdate - (void)didFindValidUpdate
{ {
id<SUUpdaterPrivate> updater = self.updater; id<SUUpdaterPrivate> updater = self.updater;
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) { if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:respondWithChoice:)]) {
[[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem]; [[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem respondWithChoice:^(SUDUpdateAlertChoice choice) {
[self updateAlertFinishedWithChoice:(SUUpdateAlertChoice)choice];
}];
return;
} }
else if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
if (self.automaticallyInstallUpdates) { [[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem];
[self updateAlertFinishedWithChoice:SUInstallUpdateChoice];
return;
} }
self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:self.updateItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) {
[self updateAlertFinishedWithChoice:choice];
}];
id<SUVersionDisplay> 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];
}
[window makeKeyAndOrderFront:self];
} else
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
} }
- (BOOL)shouldDisableKeyboardShortcutForInstallButton { - (BOOL)shouldDisableKeyboardShortcutForInstallButton {
@@ -133,7 +109,7 @@
break; break;
case SUOpenInfoURLChoice: case SUOpenInfoURLChoice:
[[NSWorkspace sharedWorkspace] openURL:[self.updateItem infoURL]]; [[NSWorkspace sharedWorkspace] openURL:[self.updateItem releaseNotesURL]];
[self abortUpdate]; [self abortUpdate];
break; break;
@@ -150,18 +126,22 @@
- (void)downloadUpdate - (void)downloadUpdate
{ {
BOOL createdStatusController = NO; id<SUUpdaterPrivate> updater = self.updater;
if (self.statusController == nil) { if(![[updater delegate] suppressSparkleUI])
self.statusController = [[SUStatusController alloc] initWithHost:self.host]; {
createdStatusController = YES; BOOL createdStatusController = NO;
} if (self.statusController == nil) {
self.statusController = [[SUStatusController alloc] initWithHost:self.host];
[self.statusController beginActionWithTitle:SULocalizedString(@"Downloading update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil]; createdStatusController = YES;
[self.statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelDownload:) isDefault:NO]; }
[self.statusController setButtonEnabled:YES];
[self.statusController beginActionWithTitle:SULocalizedString(@"Downloading update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil];
if (createdStatusController) { [self.statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelDownload:) isDefault:NO];
[self.statusController showWindow:self]; [self.statusController setButtonEnabled:YES];
if (createdStatusController) {
[self.statusController showWindow:self];
}
} }
[super downloadUpdate]; [super downloadUpdate];
@@ -293,11 +273,13 @@
- (void)abortUpdateWithError:(NSError *)error - (void)abortUpdateWithError:(NSError *)error
{ {
NSAlert *alert = [[NSAlert alloc] init]; if (self.showErrors) {
alert.messageText = SULocalizedString(@"Update Error!", nil); NSAlert *alert = [[NSAlert alloc] init];
alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]]; alert.messageText = SULocalizedString(@"Update Error!", nil);
[alert addButtonWithTitle:SULocalizedString(@"Cancel Update", nil)]; alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]];
[self showAlert:alert]; [alert addButtonWithTitle:SULocalizedString(@"Cancel Update", nil)];
[self showAlert:alert];
}
[super abortUpdateWithError:error]; [super abortUpdateWithError:error];
} }
+6
View File
@@ -53,6 +53,12 @@ SU_EXPORT @interface SUUpdater : NSObject
*/ */
- (instancetype)initForBundle:(NSBundle *)bundle; - (instancetype)initForBundle:(NSBundle *)bundle;
/*!
Suppress sparkle UI. This should prevent any Sparkle UI from popping up.
Updates should be handled by the host.
*/
-(BOOL)suppressSparkleUI;
/*! /*!
Explicitly checks for updates and displays a progress dialog while doing so. Explicitly checks for updates and displays a progress dialog while doing so.
+27 -4
View File
@@ -10,6 +10,7 @@
#import "SUUpdaterDelegate.h" #import "SUUpdaterDelegate.h"
#import "SUUpdaterPrivate.h" #import "SUUpdaterPrivate.h"
#import "SUErrors.h"
#import "SUHost.h" #import "SUHost.h"
#import "SUUpdatePermissionResponse.h" #import "SUUpdatePermissionResponse.h"
#import "SUUpdatePermissionPrompt.h" #import "SUUpdatePermissionPrompt.h"
@@ -283,7 +284,17 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)checkForUpdatesInBackground - (void)checkForUpdatesInBackground
{ {
// Do not use reachability for a preflight check. This can be deceptive and a bad idea. Apple does not recommend doing it. // Do not use reachability for a preflight check. This can be deceptive and a bad idea. Apple does not recommend doing it.
SUUpdateDriver *theUpdateDriver = [[([self automaticallyDownloadsUpdates] ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class])alloc] initWithUpdater:self];
SUUpdateDriver *theUpdateDriver;
if ([self.delegate suppressSparkleUI])
{
theUpdateDriver = [[SUAutomaticUpdateDriver alloc] initWithUpdater:self];
}
else {
theUpdateDriver = [[SUScheduledUpdateDriver alloc] initWithUpdater:self];
}
[self checkForUpdatesWithDriver:theUpdateDriver]; [self checkForUpdatesWithDriver:theUpdateDriver];
} }
@@ -307,6 +318,8 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)installUpdatesIfAvailable - (void)installUpdatesIfAvailable
{ {
// NSLog(@"[Sparkle installUpdatesIfAvailable]");
if (self.driver && [self.driver isInterruptible]) { if (self.driver && [self.driver isInterruptible]) {
if ([self.driver resumeUpdateInteractively]) { if ([self.driver resumeUpdateInteractively]) {
return; return;
@@ -425,9 +438,12 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
if (![SUSystemUpdateInfo systemAllowsAutomaticUpdatesForHost:self.host]) { if (![SUSystemUpdateInfo systemAllowsAutomaticUpdatesForHost:self.host]) {
return NO; return NO;
} }
// Otherwise, automatically downloading updates is allowed. Does the user want it? // Otherwise, automatically downloading updates is allowed. Does the user want it?
return [self.host boolForUserDefaultsKey:SUAutomaticallyUpdateKey];
BOOL automatic = [self.host boolForUserDefaultsKey:SUAutomaticallyUpdateKey];
// NSLog(@"Automatic updates %@", automatic ? @"enabled" : @"disabled");
return automatic;
} }
- (void)setFeedURL:(NSURL *)feedURL - (void)setFeedURL:(NSURL *)feedURL
@@ -483,6 +499,13 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
return [self.host boolForKey:SUSendProfileInfoKey]; return [self.host boolForKey:SUSendProfileInfoKey];
} }
static NSString *escapeURLComponent(NSString *str) {
return [[[[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
stringByReplacingOccurrencesOfString:@"=" withString:@"%3d"]
stringByReplacingOccurrencesOfString:@"&" withString:@"%26"]
stringByReplacingOccurrencesOfString:@"+" withString:@"%2b"];
}
- (NSURL *)parameterizedFeedURL - (NSURL *)parameterizedFeedURL
{ {
NSURL *baseFeedURL = [self feedURL]; NSURL *baseFeedURL = [self feedURL];
@@ -512,7 +535,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
// Build up the parameterized URL. // Build up the parameterized URL.
NSMutableArray *parameterStrings = [NSMutableArray array]; NSMutableArray *parameterStrings = [NSMutableArray array];
for (NSDictionary *currentProfileInfo in parameters) { 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 = @"?"; NSString *separatorCharacter = @"?";
+35 -1
View File
@@ -14,6 +14,13 @@
#import "SUExport.h" #import "SUExport.h"
typedef NS_ENUM(NSInteger, SUDUpdateAlertChoice) {
SUDInstallUpdateChoice,
SUDRemindMeLaterChoice,
SUDSkipThisVersionChoice,
SUDOpenInfoURLChoice
};
@protocol SUVersionComparison, SUVersionDisplay; @protocol SUVersionComparison, SUVersionDisplay;
@class SUUpdater, SUAppcast, SUAppcastItem; @class SUUpdater, SUAppcast, SUAppcastItem;
@@ -45,6 +52,12 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
@protocol SUUpdaterDelegate <NSObject> @protocol SUUpdaterDelegate <NSObject>
@optional @optional
/*!
Suppress sparkle UI. This should prevent any Sparkle UI from popping up.
Updates should be handled by the host.
*/
-(BOOL)suppressSparkleUI;
/*! /*!
Returns whether to allow Sparkle to pop up. Returns whether to allow Sparkle to pop up.
@@ -121,6 +134,16 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
*/ */
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item; - (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item;
/*!
Called when a valid update is found by the update driver and provides delegate ability to respond.
\param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that is proposed to be installed.
\param responseBlock The block carrying the users response to update.
*/
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item respondWithChoice:(void (^)(SUDUpdateAlertChoice))responseBlock;
/*! /*!
Called when a valid update is not found. Called when a valid update is not found.
@@ -158,8 +181,10 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
\param updater The SUUpdater instance. \param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that is proposed to be installed. \param item The appcast item corresponding to the update that is proposed to be installed.
\return \c NO to prevent any further action. item.localInstallationPath provides the path to the download and extracted archive and any custom actions can be taken at this point.
*/ */
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)item; - (BOOL)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)item;
/*! /*!
Returns whether the relaunch should be delayed in order to perform other tasks. Returns whether the relaunch should be delayed in order to perform other tasks.
@@ -253,6 +278,15 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
*/ */
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationInvocation:(NSInvocation *)invocation; - (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationInvocation:(NSInvocation *)invocation;
/*!
Called when an update is scheduled to be silently installed on quit. Swift compatible.
\param updater the SUUpdater instance.
\param item The appcast item corresponding to the udpate that is proposed to be installed.
\param restartBlock Can be used to trigger an immediate silent install and relaunch.
*/
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationBlock:(void (^)()) restartBlock;
/*! /*!
Calls after an update that was scheduled to be silently installed on quit has been canceled. Calls after an update that was scheduled to be silently installed on quit has been canceled.
+2
View File
@@ -20,4 +20,6 @@
@property (strong, readonly) NSBundle *sparkleBundle; @property (strong, readonly) NSBundle *sparkleBundle;
@property BOOL automaticallyDownloadsUpdates;
@end @end
+1 -1
View File
@@ -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$@ %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$@"; "%@ %@ is currently the newest version available." = "الإصدار %2$@ هو أحدث إصدار متوفر حاليًا لتطبيق %1$@";
+1 -1
View File
@@ -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$@ %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"; "%@ %@ is currently the newest version available." = "%1$@ %2$@ je nejnovější dostupná verze";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ er den aktuelle version.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ ist zur Zeit die neueste verfügbare Version.";
+1 -1
View File
@@ -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$@ %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$@ είναι η τελευταία διαθέσιμη έκδοση."; "%@ %@ is currently the newest version available." = "Το %1$@ %2$@ είναι η τελευταία διαθέσιμη έκδοση.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ es la última versión disponible.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ est la version la plus récente disponible.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ è la versione più recente attualmente disponibile.";
+1 -1
View File
@@ -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$@ %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$@ は現在入手できる最新バージョンです。"; "%@ %@ is currently the newest version available." = "%1$@ %2$@ は現在入手できる最新バージョンです。";
+1 -1
View File
@@ -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$@ %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$@이(가) 현재 최신 버전입니다."; "%@ %@ is currently the newest version available." = "%1$@ %2$@이(가) 현재 최신 버전입니다.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ er nyeste versjon.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ is momenteel de recentste versie.";
+2 -2
View File
@@ -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$@ 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$@ %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, 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 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$@ 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ą."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ jest najnowszą dostępną wersją.";
+1 -1
View File
@@ -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$@ %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 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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ é a versão mais recente disponível.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "O %1$@ %2$@ é neste momento a versão mais recente disponível.";
+1 -1
View File
@@ -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$@ %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ă."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ este cea ultima versiune disponibilă.";
+1 -1
View File
@@ -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$@ %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$@ является новейшей версией."; "%@ %@ is currently the newest version available." = "В настоящий момент %1$@ %2$@ является новейшей версией.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@\nje najnovšia dostupná verzia.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ je najnovejša verzija programa.";
+1 -1
View File
@@ -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$@ %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."; "%@ %@ is currently the newest version available." = "%1$@ %2$@ är för närvarande den senaste tillgängliga versionen.";
+1 -1
View File
@@ -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$@ %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$@ เป็นเวอร์ชั่นใหม่ล่าสุดแล้ว"; "%@ %@ is currently the newest version available." = "%1$@ %2$@ เป็นเวอร์ชั่นใหม่ล่าสุดแล้ว";
+1 -1
View File
@@ -4,7 +4,7 @@
/* de_DE v0.1 - No comment provided by engineer. */ /* 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. */ /* de_DE v0.1 - No comment provided by engineer. */
+1 -1
View File
@@ -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$@ %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$@ є останньою версією."; "%@ %@ is currently the newest version available." = "У данний момент %1$@ %2$@ є останньою версією.";
+1 -1
View File
@@ -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$@ %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$@ 是当前的最新版本。"; "%@ %@ is currently the newest version available." = "%1$@ %2$@ 是当前的最新版本。";
+1 -1
View File
@@ -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$@ %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$@ 已是目前最新的版本。"; "%@ %@ is currently the newest version available." = "%1$@ %2$@ 已是目前最新的版本。";
+34 -3
View File
@@ -119,14 +119,45 @@ class ArchiveItem: CustomStringConvertible {
return (self.archiveFileAttributes[.size] as! NSNumber).int64Value; return (self.archiveFileAttributes[.size] as! NSNumber).int64Value;
} }
var releaseNotesPath : URL { 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"); let releaseNotes = basename.appendingPathExtension("html");
if !FileManager.default.fileExists(atPath: releaseNotes.path) {
return nil;
}
return releaseNotes; return releaseNotes;
} }
private func getReleaseNotesAsHTMLFragment(_ path: URL) -> String? {
if let html = try? String(contentsOf: path) {
if html.utf8.count < 1000 &&
!html.localizedCaseInsensitiveContains("<!DOCTYPE") &&
!html.localizedCaseInsensitiveContains("<body") {
return html;
}
}
return nil;
}
var releaseNotesHTML : String? {
if let path = self.releaseNotesPath {
return self.getReleaseNotesAsHTMLFragment(path);
}
return nil;
}
var releaseNotesURL : URL? { var releaseNotesURL : URL? {
guard let escapedFilename = self.releaseNotesPath.lastPathComponent.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) else { guard let path = self.releaseNotesPath else {
return nil;
}
// The file is already used as inline description
if self.getReleaseNotesAsHTMLFragment(path) != nil {
return nil;
}
guard let escapedFilename = path.lastPathComponent.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) else {
return nil; return nil;
} }
if let relative = self.feedURL { if let relative = self.feedURL {
+10 -10
View File
@@ -7,48 +7,48 @@ import Foundation
func loadPrivateKey(privateKeyPath: URL) throws -> SecKey { func loadPrivateKey(privateKeyPath: URL) throws -> SecKey {
let data = try Data(contentsOf: privateKeyPath); let data = try Data(contentsOf: privateKeyPath);
var cfitems: CFArray? = nil; var cfitems: CFArray? = nil;
var format = SecExternalFormat.formatOpenSSL; var format = SecExternalFormat.formatOpenSSL;
var type = SecExternalItemType.itemTypePrivateKey; var type = SecExternalItemType.itemTypePrivateKey;
let status = SecItemImport(data as CFData, nil, &format, &type, SecItemImportExportFlags(rawValue: UInt32(0)), nil, nil, &cfitems); let status = SecItemImport(data as CFData, nil, &format, &type, SecItemImportExportFlags(rawValue: UInt32(0)), nil, nil, &cfitems);
if (status != errSecSuccess || cfitems == nil) { if (status != errSecSuccess || cfitems == nil) {
print("Private DSA key could not be imported", status); print("Private DSA key could not be imported", status);
throw NSError(domain: SUSparkleErrorDomain, code: Int(OSStatus(SUError.signatureError.rawValue)), userInfo: nil); throw NSError(domain: SUSparkleErrorDomain, code: Int(OSStatus(SUError.signatureError.rawValue)), userInfo: nil);
} }
if (format != SecExternalFormat.formatOpenSSL || type != SecExternalItemType.itemTypePrivateKey) { if (format != SecExternalFormat.formatOpenSSL || type != SecExternalItemType.itemTypePrivateKey) {
throw makeError(code: .signatureError, "Not an OpensSSL private key \(format) \(type)"); throw makeError(code: .signatureError, "Not an OpensSSL private key \(format) \(type)");
} }
return (cfitems as! NSArray)[0] as! SecKey; return (cfitems as! NSArray)[0] as! SecKey;
} }
func dsaSignature(path: URL, privateKey: SecKey) throws -> String { func dsaSignature(path: URL, privateKey: SecKey) throws -> String {
var error: Unmanaged<CFError>?; var error: Unmanaged<CFError>?;
let stream = InputStream(fileAtPath:path.path)!; let stream = InputStream(fileAtPath:path.path)!;
let dataReadTransform = SecTransformCreateReadTransformWithReadStream(stream); let dataReadTransform = SecTransformCreateReadTransformWithReadStream(stream);
let dataDigestTransform = SecDigestTransformCreate(kSecDigestSHA1, 20, nil); let dataDigestTransform = SecDigestTransformCreate(kSecDigestSHA1, 20, nil);
guard let dataSignTransform = SecSignTransformCreate(privateKey, &error) else { guard let dataSignTransform = SecSignTransformCreate(privateKey, &error) else {
print("can't use the key"); print("can't use the key");
throw error!.takeRetainedValue(); throw error!.takeRetainedValue();
} }
let group = SecTransformCreateGroupTransform(); let group = SecTransformCreateGroupTransform();
SecTransformConnectTransforms(dataReadTransform, kSecTransformOutputAttributeName, dataDigestTransform, kSecTransformInputAttributeName, group, &error); SecTransformConnectTransforms(dataReadTransform, kSecTransformOutputAttributeName, dataDigestTransform, kSecTransformInputAttributeName, group, &error);
if (error != nil) { if (error != nil) {
throw error!.takeRetainedValue(); throw error!.takeRetainedValue();
} }
SecTransformConnectTransforms(dataDigestTransform, kSecTransformOutputAttributeName, dataSignTransform, kSecTransformInputAttributeName, group, &error); SecTransformConnectTransforms(dataDigestTransform, kSecTransformOutputAttributeName, dataSignTransform, kSecTransformInputAttributeName, group, &error);
if (error != nil) { if (error != nil) {
throw error!.takeRetainedValue(); throw error!.takeRetainedValue();
} }
let result = SecTransformExecute(group, &error) as! Data; let result = SecTransformExecute(group, &error) as! Data;
return result.base64EncodedString(); return result.base64EncodedString();
} }
+15 -8
View File
@@ -23,6 +23,7 @@ func findOrCreateElement(name: String, parent: XMLElement) -> XMLElement {
return element; return element;
} }
let element = XMLElement(name: name); let element = XMLElement(name: name);
linebreak(parent);
parent.addChild(element); parent.addChild(element);
return element; return element;
} }
@@ -69,7 +70,9 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
channel = channelNodes[0] as! XMLElement; channel = channelNodes[0] as! XMLElement;
} else { } else {
channel = XMLElement(name: "channel"); channel = XMLElement(name: "channel");
linebreak(channel);
channel.addChild(XMLElement.element(withName: "title", stringValue: appBaseName) as! XMLElement); channel.addChild(XMLElement.element(withName: "title", stringValue: appBaseName) as! XMLElement);
linebreak(root);
root.addChild(channel); root.addChild(channel);
} }
@@ -102,6 +105,13 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
item.addChild(XMLElement.element(withName: "pubDate", stringValue: update.pubDate) as! XMLElement); item.addChild(XMLElement.element(withName: "pubDate", stringValue: update.pubDate) as! XMLElement);
} }
if let html = update.releaseNotesHTML {
let descElement = findOrCreateElement(name: "description", parent: item);
let cdata = XMLNode(kind:.text, options:.nodeIsCDATA);
cdata.stringValue = html;
descElement.setChildren([cdata]);
}
var minVer = findElement(name: "sparkle:minimumSystemVersion", parent: item); var minVer = findElement(name: "sparkle:minimumSystemVersion", parent: item);
if nil == minVer { if nil == minVer {
minVer = XMLElement.element(withName: "sparkle:minimumSystemVersion", uri: sparkleNS) as? XMLElement; minVer = XMLElement.element(withName: "sparkle:minimumSystemVersion", uri: sparkleNS) as? XMLElement;
@@ -111,16 +121,13 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
minVer?.setChildren([text(update.minimumSystemVersion)]); minVer?.setChildren([text(update.minimumSystemVersion)]);
let relElement = findElement(name: "sparkle:releaseNotesLink", parent: item); let relElement = findElement(name: "sparkle:releaseNotesLink", parent: item);
if nil == relElement { if let url = update.releaseNotesURL {
if FileManager.default.fileExists(atPath: update.releaseNotesPath.path) { if nil == relElement {
linebreak(item); linebreak(item);
item.addChild(XMLElement.element(withName:"sparkle:releaseNotesLink", stringValue: (update.releaseNotesURL?.absoluteString)!) as! XMLElement); item.addChild(XMLElement.element(withName:"sparkle:releaseNotesLink", stringValue: url.absoluteString) as! XMLElement);
}
} else {
if !FileManager.default.fileExists(atPath: update.releaseNotesPath.path) {
let childIndex = relElement?.index;
item.removeChild(at: childIndex!);
} }
} else if let childIndex = relElement?.index {
item.removeChild(at: childIndex);
} }
var enclosure = findElement(name: "enclosure", parent: item); var enclosure = findElement(name: "enclosure", parent: item);