mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc48e5e4df | ||
|
|
bfada07a2c | ||
|
|
4f965660f3 | ||
|
|
a2764158d6 | ||
|
|
60727bffa5 | ||
|
|
715163fe0d | ||
|
|
629c42d62d | ||
|
|
3e45211bbe | ||
|
|
89acca1318 | ||
|
|
4bc2e6e891 | ||
|
|
405c9fd9a1 | ||
|
|
9232316b19 | ||
|
|
ac042821d8 | ||
|
|
662e84400a | ||
|
|
1683d2de34 | ||
|
|
615a08bc32 |
No files matched your search
@@ -1,3 +1,13 @@
|
||||
# 1.18.0
|
||||
|
||||
* More detailed progress bar for package installers (Kornel Lesiński)
|
||||
* Disabled the keyboard shortcut for the install button for scheduled updates to avoid accidental installs. (George Nachman)
|
||||
* generate_appcast tool adds release notes if there's an .html file with the same base name as the archive (Brett Walker)
|
||||
* Added `sparkle:shortVersionString` to the enclosure, #1032 (Brett Walker)
|
||||
* Fixed Japanese localization (1024jp)
|
||||
* Fixed escaping of system profile URLs
|
||||
* Added more logging in various failure cases (Kornel Lesiński)
|
||||
|
||||
# 1.17.0
|
||||
|
||||
* Added Touch Bar support (Bi11)
|
||||
|
||||
@@ -16,7 +16,7 @@ SPARKLE_AUTOMATED_DOWNGRADES = 0
|
||||
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
|
||||
|
||||
SPARKLE_VERSION_MAJOR = 1
|
||||
SPARKLE_VERSION_MINOR = 17
|
||||
SPARKLE_VERSION_MINOR = 18
|
||||
SPARKLE_VERSION_PATCH = 0
|
||||
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Sparkle"
|
||||
s.version = "1.17.0"
|
||||
s.version = "1.18.0"
|
||||
s.summary = "A software update framework for macOS"
|
||||
s.description = "Sparkle is an easy-to-use software update framework for Cocoa developers."
|
||||
s.homepage = "http://sparkle-project.org"
|
||||
|
||||
Vendored
-20
@@ -29,7 +29,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
@interface SUAutomaticUpdateDriver ()
|
||||
|
||||
@property (assign) BOOL postponingInstallation;
|
||||
@property (assign) BOOL showErrors;
|
||||
@property (assign) BOOL willUpdateOnTermination;
|
||||
@property (assign) BOOL isTerminating;
|
||||
@property (strong) SUAutomaticUpdateAlert *alert;
|
||||
@@ -40,7 +39,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
@implementation SUAutomaticUpdateDriver
|
||||
|
||||
@synthesize postponingInstallation;
|
||||
@synthesize showErrors;
|
||||
@synthesize willUpdateOnTermination;
|
||||
@synthesize isTerminating;
|
||||
@synthesize alert;
|
||||
@@ -202,7 +200,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
[self stopUpdatingOnTermination];
|
||||
}
|
||||
|
||||
self.showErrors = YES;
|
||||
[super installWithToolAndRelaunch:relaunch displayingUserInterface:showUI];
|
||||
}
|
||||
|
||||
@@ -231,21 +228,4 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
}
|
||||
}
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
if (self.showErrors) {
|
||||
[super abortUpdateWithError:error];
|
||||
} else {
|
||||
// Call delegate separately here because otherwise it won't know we stopped.
|
||||
// Normally this gets called by the superclass
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
||||
[updaterDelegate updater:self.updater didAbortWithError:error];
|
||||
}
|
||||
|
||||
[self abortUpdate];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+12
@@ -492,6 +492,10 @@
|
||||
}
|
||||
|
||||
NSBundle *sparkleBundle = updater.sparkleBundle;
|
||||
if (!sparkleBundle) {
|
||||
SULog(SULogLevelError, @"Sparkle bundle is gone?");
|
||||
return;
|
||||
}
|
||||
|
||||
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
|
||||
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
|
||||
@@ -501,6 +505,14 @@
|
||||
NSError *error = nil;
|
||||
BOOL copiedRelaunchPath = NO;
|
||||
|
||||
if (!relaunchToolName) {
|
||||
SULog(SULogLevelError, @"SPARKLE_RELAUNCH_TOOL_NAME not configued");
|
||||
}
|
||||
|
||||
if (!relaunchToolSourcePath) {
|
||||
SULog(SULogLevelError, @"Sparkle.framework is damaged. %@ is missing", relaunchToolName);
|
||||
}
|
||||
|
||||
if (relaunchToolSourcePath) {
|
||||
relaunchCopyTargetPath = [[self appCachePath] stringByAppendingPathComponent:[relaunchToolSourcePath lastPathComponent]];
|
||||
|
||||
|
||||
Vendored
-1
@@ -47,7 +47,6 @@ extern NSString *const SUEnableSystemProfilingKey;
|
||||
extern NSString *const SUSendProfileInfoKey;
|
||||
extern NSString *const SULastProfileSubmitDateKey;
|
||||
extern NSString *const SUPromptUserOnFirstLaunchKey;
|
||||
extern NSString *const SUKeepDownloadOnFailedInstallKey;
|
||||
extern NSString *const SUDefaultsDomainKey;
|
||||
extern NSString *const SUEnableJavaScriptKey;
|
||||
extern NSString *const SUFixedHTMLDisplaySizeKey __attribute__((deprecated("This key is obsolete and has no effect.")));
|
||||
|
||||
Vendored
-1
@@ -41,7 +41,6 @@ NSString *const SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate";
|
||||
NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch";
|
||||
NSString *const SUEnableJavaScriptKey = @"SUEnableJavaScript";
|
||||
NSString *const SUFixedHTMLDisplaySizeKey = @"SUFixedHTMLDisplaySize";
|
||||
NSString *const SUKeepDownloadOnFailedInstallKey = @"SUKeepDownloadOnFailedInstall";
|
||||
NSString *const SUDefaultsDomainKey = @"SUDefaultsDomain";
|
||||
NSString *const SUSparkleErrorDomain = @"SUSparkleErrorDomain";
|
||||
|
||||
|
||||
Vendored
+3
@@ -174,7 +174,10 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
|
||||
if (runStatus != errAuthorizationSuccess) {
|
||||
#pragma clang diagnostic pop
|
||||
if (error != NULL) {
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wcstring-format-directive"
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed to run authorization tool %s (%d).", toolPath, (int)runStatus] }];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
Vendored
+6
-1
@@ -127,7 +127,12 @@
|
||||
if (!keyPath) {
|
||||
return nil;
|
||||
}
|
||||
return [NSString stringWithContentsOfFile:keyPath encoding:NSASCIIStringEncoding error:nil];
|
||||
NSError *error = nil;
|
||||
key = [NSString stringWithContentsOfFile:keyPath encoding:NSASCIIStringEncoding error:&error];
|
||||
if (error) {
|
||||
SULog(SULogLevelError, @"Error loading %@: %@", keyPath, error);
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
- (NSString * __nullable)publicDSAKeyFileKey
|
||||
|
||||
Vendored
+4
-4
@@ -43,8 +43,8 @@ void SULog(SULogLevel level, NSString *format, ...)
|
||||
// Act the same way os_log() does; don't log to stderr if a terminal device is attached
|
||||
if (!isatty(STDERR_FILENO)) {
|
||||
options |= ASL_OPT_STDERR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NSString *displayName = [[NSFileManager defaultManager] displayNameAtPath:mainBundle.bundlePath];
|
||||
client = asl_open([displayName stringByAppendingString:@" [Sparkle]"].UTF8String, SPARKLE_BUNDLE_IDENTIFIER, options);
|
||||
queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
|
||||
@@ -77,10 +77,10 @@ void SULog(SULogLevel level, NSString *format, ...)
|
||||
// See docs for OS_LOG_TYPE_ERROR
|
||||
os_log_error(logger, "%{public}@", logMessage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise use ASL
|
||||
// Make sure we do not async, because if we async, the log may not be delivered deterministically
|
||||
|
||||
Vendored
+8
-21
@@ -12,13 +12,17 @@
|
||||
|
||||
@interface SUScheduledUpdateDriver ()
|
||||
|
||||
@property (assign) BOOL showErrors;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SUScheduledUpdateDriver
|
||||
|
||||
@synthesize showErrors;
|
||||
- (instancetype)initWithUpdater:(id<SUUpdaterPrivate>)anUpdater
|
||||
{
|
||||
if ((self = [super initWithUpdater:anUpdater])) {
|
||||
self.showErrors = NO;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)didFindValidUpdate
|
||||
{
|
||||
@@ -39,25 +43,8 @@
|
||||
[self abortUpdate]; // Don't tell the user that no update was found; this was a scheduled update.
|
||||
}
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
if (self.showErrors) {
|
||||
[super abortUpdateWithError:error];
|
||||
} else {
|
||||
// Call delegate separately here because otherwise it won't know we stopped.
|
||||
// Normally this gets called by the superclass
|
||||
id<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 {
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Vendored
+1
@@ -15,6 +15,7 @@
|
||||
@class SUStatusController;
|
||||
|
||||
@interface SUUIBasedUpdateDriver : SUBasicUpdateDriver
|
||||
@property (assign) BOOL showErrors;
|
||||
|
||||
- (void)showAlert:(NSAlert *)alert;
|
||||
- (IBAction)cancelDownload:(id)sender;
|
||||
|
||||
Vendored
+9
-5
@@ -45,11 +45,13 @@
|
||||
|
||||
@synthesize statusController;
|
||||
@synthesize updateAlert;
|
||||
@synthesize showErrors;
|
||||
|
||||
- (instancetype)initWithUpdater:(id<SUUpdaterPrivate>)anUpdater
|
||||
{
|
||||
if ((self = [super initWithUpdater:anUpdater])) {
|
||||
self.automaticallyInstallUpdates = NO;
|
||||
self.showErrors = YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -293,11 +295,13 @@
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.messageText = SULocalizedString(@"Update Error!", nil);
|
||||
alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]];
|
||||
[alert addButtonWithTitle:SULocalizedString(@"Cancel Update", nil)];
|
||||
[self showAlert:alert];
|
||||
if (self.showErrors) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.messageText = SULocalizedString(@"Update Error!", nil);
|
||||
alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]];
|
||||
[alert addButtonWithTitle:SULocalizedString(@"Cancel Update", nil)];
|
||||
[self showAlert:alert];
|
||||
}
|
||||
[super abortUpdateWithError:error];
|
||||
}
|
||||
|
||||
|
||||
Vendored
+8
-1
@@ -483,6 +483,13 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
||||
return [self.host boolForKey:SUSendProfileInfoKey];
|
||||
}
|
||||
|
||||
static NSString *escapeURLComponent(NSString *str) {
|
||||
return [[[[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
|
||||
stringByReplacingOccurrencesOfString:@"=" withString:@"%3d"]
|
||||
stringByReplacingOccurrencesOfString:@"&" withString:@"%26"]
|
||||
stringByReplacingOccurrencesOfString:@"+" withString:@"%2b"];
|
||||
}
|
||||
|
||||
- (NSURL *)parameterizedFeedURL
|
||||
{
|
||||
NSURL *baseFeedURL = [self feedURL];
|
||||
@@ -512,7 +519,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
||||
// Build up the parameterized URL.
|
||||
NSMutableArray *parameterStrings = [NSMutableArray array];
|
||||
for (NSDictionary *currentProfileInfo in parameters) {
|
||||
[parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", [[[currentProfileInfo objectForKey:@"key"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [[[currentProfileInfo objectForKey:@"value"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
|
||||
[parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", escapeURLComponent([[currentProfileInfo objectForKey:@"key"] description]), escapeURLComponent([[currentProfileInfo objectForKey:@"value"] description])]];
|
||||
}
|
||||
|
||||
NSString *separatorCharacter = @"?";
|
||||
|
||||
@@ -119,14 +119,45 @@ class ArchiveItem: CustomStringConvertible {
|
||||
return (self.archiveFileAttributes[.size] as! NSNumber).int64Value;
|
||||
}
|
||||
|
||||
var releaseNotesPath : URL {
|
||||
let basename = self.archivePath.deletingPathExtension();
|
||||
private var releaseNotesPath : URL? {
|
||||
var basename = self.archivePath.deletingPathExtension();
|
||||
if basename.pathExtension == "tar" { // tar.gz
|
||||
basename = basename.deletingPathExtension();
|
||||
}
|
||||
let releaseNotes = basename.appendingPathExtension("html");
|
||||
if !FileManager.default.fileExists(atPath: releaseNotes.path) {
|
||||
return nil;
|
||||
}
|
||||
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? {
|
||||
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;
|
||||
}
|
||||
if let relative = self.feedURL {
|
||||
|
||||
@@ -23,6 +23,7 @@ func findOrCreateElement(name: String, parent: XMLElement) -> XMLElement {
|
||||
return element;
|
||||
}
|
||||
let element = XMLElement(name: name);
|
||||
linebreak(parent);
|
||||
parent.addChild(element);
|
||||
return element;
|
||||
}
|
||||
@@ -69,7 +70,9 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
|
||||
channel = channelNodes[0] as! XMLElement;
|
||||
} else {
|
||||
channel = XMLElement(name: "channel");
|
||||
linebreak(channel);
|
||||
channel.addChild(XMLElement.element(withName: "title", stringValue: appBaseName) as! XMLElement);
|
||||
linebreak(root);
|
||||
root.addChild(channel);
|
||||
}
|
||||
|
||||
@@ -102,6 +105,13 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
|
||||
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);
|
||||
if nil == minVer {
|
||||
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)]);
|
||||
|
||||
let relElement = findElement(name: "sparkle:releaseNotesLink", parent: item);
|
||||
if nil == relElement {
|
||||
if FileManager.default.fileExists(atPath: update.releaseNotesPath.path) {
|
||||
if let url = update.releaseNotesURL {
|
||||
if nil == relElement {
|
||||
linebreak(item);
|
||||
item.addChild(XMLElement.element(withName:"sparkle:releaseNotesLink", stringValue: (update.releaseNotesURL?.absoluteString)!) as! XMLElement);
|
||||
}
|
||||
} else {
|
||||
if !FileManager.default.fileExists(atPath: update.releaseNotesPath.path) {
|
||||
let childIndex = relElement?.index;
|
||||
item.removeChild(at: childIndex!);
|
||||
item.addChild(XMLElement.element(withName:"sparkle:releaseNotesLink", stringValue: url.absoluteString) as! XMLElement);
|
||||
}
|
||||
} else if let childIndex = relElement?.index {
|
||||
item.removeChild(at: childIndex);
|
||||
}
|
||||
|
||||
var enclosure = findElement(name: "enclosure", parent: item);
|
||||
|
||||
Reference in new issue
Block a user