Compare commits

..
10 Commits
Author SHA1 Message Date
Kornel ea94969188 10.7 compatibility 2018-03-18 13:52:13 +00:00
Kornel 57731f44d7 Avoid invalid use of main thread
Fixes #1189
2018-03-18 13:41:08 +00:00
Kornel 2a0514c93b Update wording of read-only error 2018-03-18 13:37:46 +00:00
Adrian Thomas 467e1495c0 Improve 'read-only' error message (#1192)
* Improver read-only error message German

Updated the "read-only volume" error to reflect the real-world scenarios users run into.
It's almost never a CD, it's nearly always running from ~/Downloads or the .dmg if you still ship your app that way.
2018-03-18 13:34:19 +00:00
Kornel Lesiński 8ac254951a "all" target 2018-03-18 13:27:56 +00:00
Kornel c83c9221f7 Hidden verbose flag 2018-03-18 13:27:45 +00:00
Kornel b46315df9c Outdated comment 2018-03-18 13:27:43 +00:00
Kornel 9c505dee2f Merge pull request #1181 from vitu/master
Amend to avoid gender issue
2018-02-02 17:22:50 +00:00
BR Lingo 2ed7402367 Amend to avoid gender issue
Amend to avoid gender issue

Victor committed
a01979c
1 changed file
Instead of addressing the user, which might cause gender issues, string has been adapted to include “app” (masculine, in accordance with Apple's terminology).

Would translate back as “The app is up-to-date!”
2018-02-02 10:51:47 -05:00
Kornel 3afa47b092 Changelog 2018-01-29 23:03:33 +00:00
11 changed files with 54 additions and 19 deletions

No files matched your search

+12
View File
@@ -1,3 +1,15 @@
# 1.19.0
* Refactoring of downloader code to avoid deprecated methods (Deadpikle)
* Changes to which methods run on the main thread.
Note: some delegate methods may be called on non-main thread now. (Kornel)
* Update Japanese localization (1024jp)
* Update Sparkle.strings (Stefan Paychère)
* Fix Sparkle clients polling too frequently (Jonathan Bullard)
* Handle SecTransformExecute errors (Kornel)
* Silence Touch Bar availability warnings on Xcode 9 by using API_AVAILABLE. Disable gnu-zero-variadic-macro-arguments to prevent warnings from use of API_AVAILABLE. (Kent Sutherland)
* 10.11 SDK compatibility (David Fuhrmann)
# 1.18.1
* Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115) (App Tyrant)
+2
View File
@@ -1,5 +1,7 @@
.PHONY: all localizable-strings release build test ci
all: build
ifndef BUILDDIR
BUILDDIR := $(shell mktemp -d "$(TMPDIR)/Sparkle.XXXXXX")
endif
+1 -1
View File
@@ -41,7 +41,7 @@ static NSTimeInterval OLD_ITEM_DELETION_INTERVAL = 86400 * 10; // 10 days
NSDictionary<NSString *, id> *fileAttributes = [fileManager attributesOfItemAtPath:[directory stringByAppendingPathComponent:filename] error:NULL];
if (fileAttributes != nil)
{
NSDate *lastModificationDate = fileAttributes[NSFileModificationDate];
NSDate *lastModificationDate = [fileAttributes objectForKey:NSFileModificationDate];
if ([currentDate timeIntervalSinceDate:lastModificationDate] >= OLD_ITEM_DELETION_INTERVAL)
{
[filePathsToRemove addObject:[directory stringByAppendingPathComponent:filename]];
+11 -7
View File
@@ -72,13 +72,17 @@ static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServ
- (instancetype)initWithCoder:(NSCoder *)decoder
{
NSURL *url = [decoder decodeObjectOfClass:[NSURL class] forKey:SPUURLRequestURLKey];
NSURLRequestCachePolicy cachePolicy = (NSURLRequestCachePolicy)[decoder decodeIntegerForKey:SPUURLRequestCachePolicyKey];
NSTimeInterval timeoutInterval = [decoder decodeDoubleForKey:SPUURLRequestTimeoutIntervalKey];
NSDictionary<NSString *, NSString *> *httpHeaderFields = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class]]] forKey:SPUURLRequestHttpHeaderFieldsKey];
NSURLRequestNetworkServiceType networkServiceType = (NSURLRequestNetworkServiceType)[decoder decodeIntegerForKey:SPUURLRequestNetworkServiceTypeKey];
return [self initWithURL:url cachePolicy:cachePolicy timeoutInterval:timeoutInterval httpHeaderFields:httpHeaderFields networkServiceType:networkServiceType];
if (@available(macOS 10.8, *)) {
NSURL *url = [decoder decodeObjectOfClass:[NSURL class] forKey:SPUURLRequestURLKey];
NSURLRequestCachePolicy cachePolicy = (NSURLRequestCachePolicy)[decoder decodeIntegerForKey:SPUURLRequestCachePolicyKey];
NSTimeInterval timeoutInterval = [decoder decodeDoubleForKey:SPUURLRequestTimeoutIntervalKey];
NSDictionary<NSString *, NSString *> *httpHeaderFields = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class]]] forKey:SPUURLRequestHttpHeaderFieldsKey];
NSURLRequestNetworkServiceType networkServiceType = (NSURLRequestNetworkServiceType)[decoder decodeIntegerForKey:SPUURLRequestNetworkServiceTypeKey];
return [self initWithURL:url cachePolicy:cachePolicy timeoutInterval:timeoutInterval httpHeaderFields:httpHeaderFields networkServiceType:networkServiceType];
} else {
abort(); // Not used on 10.7
}
}
- (NSURLRequest *)request
+7 -2
View File
@@ -304,7 +304,7 @@
- (void)abortUpdateWithError:(NSError *)error
{
dispatch_sync(dispatch_get_main_queue(), ^{
void (^callback)() = ^{
if (self.showErrors) {
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = SULocalizedString(@"Update Error!", nil);
@@ -313,7 +313,12 @@
[self showAlert:alert];
}
[super abortUpdateWithError:error];
});
};
if ([NSThread isMainThread]) {
callback();
} else {
dispatch_sync(dispatch_get_main_queue(), callback);
}
}
- (void)abortUpdate
+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 geladen und steht zur Installation bereit! Möchtest du %1$@ jetzt durch die neue Version ersetzen und neu starten?";
"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ kann nicht aktualisiert werden, weil es von einem Ort ohne Schreibzugriff oder temporären Ort aus gestartet wurde. Kopiere %1$@ in den Programmeordner, starte es von dort aus und versuche es erneut zu aktualisieren.";
"%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, da es aus dem Downloads-Order, oder von einer DMG Datei oder Laufwerk ohne Schreibzugriff gestartet wurde. Kopiere %1$@ in den Programmeordner, starte es von dort aus und versuche es erneut zu aktualisieren.";
"%@ %@ is currently the newest version available." = "%1$@ %2$@ ist zurzeit die neueste verfügbare 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$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?";
"%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.";
"%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.";
"%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available.";
+1 -1
View File
@@ -86,4 +86,4 @@
"You already have the newest version of %@." = "Você já possui a versão mais recente do %@.";
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
"You're up-to-date!" = "Você está atualizado!";
"You're up-to-date!" = "O app está atualizado!";
+2 -3
View File
@@ -14,10 +14,10 @@ func makeError(code: SUError, _ description: String) -> NSError {
]);
}
func makeAppcast(archivesSourceDir: URL, privateKey: SecKey) throws -> [String:[ArchiveItem]] {
func makeAppcast(archivesSourceDir: URL, privateKey: SecKey, verbose: Bool) throws -> [String:[ArchiveItem]] {
let comparator = SUStandardVersionComparator();
let allUpdates = (try unarchiveUpdates(archivesSourceDir: archivesSourceDir))
let allUpdates = (try unarchiveUpdates(archivesSourceDir: archivesSourceDir, verbose:verbose))
.sorted(by: {
.orderedDescending == comparator.compareVersion($0.version, toVersion:$1.version)
})
@@ -85,7 +85,6 @@ func makeAppcast(archivesSourceDir: URL, privateKey: SecKey) throws -> [String:[
// Require delta to be a bit smaller
if delta.fileSize / 7 < latestItem.fileSize / 8 {
// Max 3 deltas per version (arbitrary limit to reduce amount of work)
numDeltas += 1;
if numDeltas > maxDeltas {
break;
+13 -2
View File
@@ -39,8 +39,11 @@ func unarchive(itemPath:URL, archiveDestDir: URL, callback: @escaping (Error?) -
}
}
func unarchiveUpdates(archivesSourceDir: URL) throws -> [ArchiveItem] {
func unarchiveUpdates(archivesSourceDir: URL, verbose: Bool) throws -> [ArchiveItem] {
let archivesDestDir = archivesSourceDir.appendingPathComponent(".tmp");
if verbose {
print("Unarchiving to temp directory", archivesDestDir.path);
}
let group = DispatchGroup();
@@ -60,10 +63,18 @@ func unarchiveUpdates(archivesSourceDir: URL) throws -> [ArchiveItem] {
}
let addItem = {
if let item = try? ArchiveItem(fromArchive: itemPath, unarchivedDir: archiveDestDir) {
do {
let item = try ArchiveItem(fromArchive: itemPath, unarchivedDir: archiveDestDir);
if verbose {
print("Found archive", item);
}
objc_sync_enter(unarchived);
unarchived.append(item);
objc_sync_exit(unarchived);
} catch {
if verbose {
print("Skipped", item, error);
}
}
}
+3 -1
View File
@@ -8,6 +8,8 @@
import Foundation
var verbose = false;
func main() {
let args = CommandLine.arguments;
if args.count < 3 {
@@ -26,7 +28,7 @@ func main() {
do {
let privateKey = try loadPrivateKey(privateKeyPath: privateKeyPath);
do {
let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, privateKey: privateKey);
let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, privateKey: privateKey, verbose:verbose);
for (appcastFile, updates) in allUpdates {
let appcastDestPath = URL(fileURLWithPath: appcastFile, relativeTo: archivesSourceDir);