mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07a6893e1f | ||
|
|
4b119a1eed | ||
|
|
c2c94bdb1f | ||
|
|
d14e89ef53 | ||
|
|
7bd4e56cd5 | ||
|
|
8577ed8953 | ||
|
|
7b8fd7c097 | ||
|
|
cb15481e88 | ||
|
|
efa8447b1f | ||
|
|
e140353ed5 | ||
|
|
d6316b6d9c | ||
|
|
b0c9c31dc1 | ||
|
|
9d03d79ca7 | ||
|
|
519dccf64b | ||
|
|
1392f5155a | ||
|
|
76ce31f2f6 | ||
|
|
f46d7b5c1e | ||
|
|
d94c316583 | ||
|
|
c97a0462ae | ||
|
|
a62db7348d | ||
|
|
bd77daac35 | ||
|
|
b41165e2e2 | ||
|
|
49c622b36b | ||
|
|
2d33235886 | ||
|
|
2aa4899efd | ||
|
|
a0f368823b | ||
|
|
afec652729 | ||
|
|
0ae81e3c05 | ||
|
|
90d319cb02 | ||
|
|
4ffb2d2361 | ||
|
|
e8508a4a66 | ||
|
|
a5b92c2008 | ||
|
|
d7185de470 | ||
|
|
0c1eca9f82 | ||
|
|
88de072950 | ||
|
|
5efef76004 | ||
|
|
95eb6456e3 | ||
|
|
4cbffd02e3 | ||
|
|
47a4978e6a | ||
|
|
0400bc4d66 | ||
|
|
e1ef953067 | ||
|
|
bfa28948f0 |
No files matched your search
@@ -1,3 +1,11 @@
|
||||
# 1.7.0
|
||||
|
||||
* Dropped support for Mac OS X 10.6. Sparkle now supports 10.7 and newer (including 10.10 Yosemite) on 64-bit Intel Macs (the last 32-bit Mac was released in 2006).
|
||||
* Removed use of deprecated functions (Zachary Waldowski)
|
||||
* Switched to modern Obj-C runtime and new literals syntax
|
||||
* Removed pre-10.7 code. (C.W. Betts)
|
||||
* Use more Blocks/libdispatch code. (C.W. Betts)
|
||||
* Cleaned up and improved security of `generate_keys`/`sign_update` scripts
|
||||
|
||||
# 1.6.1
|
||||
|
||||
@@ -36,3 +44,4 @@
|
||||
* Prompts the user to update after a week (rather than a day) if he doesn't quit the app (Andy Matuschak)
|
||||
* Adding <sparkle:tags> appcast item element, <sparkle:criticalUpdate /> tag (Andy Matuschak)
|
||||
* We have this check box that says "Automatically download and install updates in the future." But we only download them automatically. We still ask permission again before installing them. (Andy Matuschak)
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
FINISH_INSTALL_TOOL_NAME = Autoupdate
|
||||
|
||||
CURRENT_PROJECT_VERSION = 1.6
|
||||
CURRENT_PROJECT_VERSION = 1.7.0
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES
|
||||
GCC_PREFIX_HEADER = $(SDKROOT)/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h
|
||||
ARCHS = i386 x86_64
|
||||
ARCHS = x86_64
|
||||
|
||||
GCC_PREPROCESSOR_DEFINITIONS = FINISH_INSTALL_TOOL_NAME=$(FINISH_INSTALL_TOOL_NAME)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Framework only
|
||||
|
||||
INSTALL_PATH = @loader_path/../Frameworks
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.5
|
||||
DYLIB_CURRENT_VERSION = 1.5
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.6
|
||||
DYLIB_CURRENT_VERSION = 1.7
|
||||
PRODUCT_NAME = Sparkle
|
||||
WRAPPER_EXTENSION = framework
|
||||
FRAMEWORK_VERSION = A
|
||||
|
||||
@@ -2,5 +2,3 @@
|
||||
#include "ConfigCommonRelease.xcconfig"
|
||||
#include "ConfigFramework.xcconfig"
|
||||
|
||||
STRIP_INSTALLED_PRODUCT = YES
|
||||
DEPLOYMENT_POSTPROCESSING = YES
|
||||
@@ -1,9 +1,9 @@
|
||||
// Unit Test only
|
||||
|
||||
INFOPLIST_FILE = Tests/Sparkle Unit Tests-Info.plist
|
||||
OTHER_LDFLAGS = -framework Cocoa -framework SenTestingKit
|
||||
OTHER_LDFLAGS = -framework Cocoa -framework XCTest
|
||||
PRODUCT_NAME = Sparkle Unit Tests
|
||||
WRAPPER_EXTENSION = octest
|
||||
WRAPPER_EXTENSION = xctest
|
||||
FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_LIBRARY_DIR)/Frameworks
|
||||
GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES
|
||||
@@ -10,16 +10,6 @@
|
||||
#define NTSYNCHRONOUSTASK_H
|
||||
|
||||
@interface NTSynchronousTask : NSObject
|
||||
{
|
||||
@private
|
||||
NSTask *mv_task;
|
||||
NSPipe *mv_outputPipe;
|
||||
NSPipe *mv_inputPipe;
|
||||
|
||||
NSData* mv_output;
|
||||
BOOL mv_done;
|
||||
int mv_result;
|
||||
}
|
||||
@property (readonly, retain) NSData *output;
|
||||
@property (readonly) int result;
|
||||
|
||||
|
||||
+42
-42
@@ -32,7 +32,7 @@
|
||||
|
||||
- (void)taskOutputAvailable:(NSNotification*)note
|
||||
{
|
||||
self.output = [[note userInfo] objectForKey:NSFileHandleNotificationDataItem];
|
||||
self.output = [note userInfo][NSFileHandleNotificationDataItem];
|
||||
|
||||
self.done = YES;
|
||||
}
|
||||
@@ -42,7 +42,7 @@
|
||||
self.result = [self.task terminationStatus];
|
||||
}
|
||||
|
||||
- (id)init;
|
||||
- (instancetype)init;
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
@@ -78,8 +78,9 @@
|
||||
{
|
||||
BOOL success = NO;
|
||||
|
||||
if (currentDirectory)
|
||||
if (currentDirectory) {
|
||||
self.task.currentDirectoryPath = currentDirectory;
|
||||
}
|
||||
|
||||
self.task.launchPath = toolPath;
|
||||
self.task.arguments = args;
|
||||
@@ -94,7 +95,7 @@
|
||||
name:NSTaskDidTerminateNotification
|
||||
object:[self task]];
|
||||
|
||||
[[[self outputPipe] fileHandleForReading] readToEndOfFileInBackgroundAndNotifyForModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil]];
|
||||
[[[self outputPipe] fileHandleForReading] readToEndOfFileInBackgroundAndNotifyForModes:@[NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode]];
|
||||
|
||||
@try
|
||||
{
|
||||
@@ -131,59 +132,58 @@
|
||||
|
||||
+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input
|
||||
{
|
||||
// we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSData* result = nil;
|
||||
|
||||
@try
|
||||
{
|
||||
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
|
||||
// we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
|
||||
@autoreleasepool {
|
||||
@try {
|
||||
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
|
||||
|
||||
[task run:toolPath directory:currentDirectory withArgs:args input:input];
|
||||
|
||||
if ([task result] == 0) {
|
||||
result = [[task output] retain];
|
||||
}
|
||||
|
||||
[task release];
|
||||
}
|
||||
@catch (NSException *localException) { }
|
||||
|
||||
[task run:toolPath directory:currentDirectory withArgs:args input:input];
|
||||
|
||||
if ([task result] == 0)
|
||||
result = [[task output] retain];
|
||||
|
||||
[task release];
|
||||
}
|
||||
@catch (NSException *localException) { }
|
||||
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
// retained above
|
||||
[result autorelease];
|
||||
|
||||
return result;
|
||||
return [result autorelease];
|
||||
}
|
||||
|
||||
|
||||
+(int) task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input output: (NSData**)outData
|
||||
{
|
||||
int taskResult = 0;
|
||||
// we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
int taskResult = 0;
|
||||
if( outData )
|
||||
*outData = nil;
|
||||
|
||||
@try {
|
||||
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
|
||||
@autoreleasepool {
|
||||
if (outData) {
|
||||
*outData = nil;
|
||||
}
|
||||
|
||||
[task run:toolPath directory:currentDirectory withArgs:args input:input];
|
||||
@try {
|
||||
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
|
||||
|
||||
[task run:toolPath directory:currentDirectory withArgs:args input:input];
|
||||
|
||||
taskResult = [task result];
|
||||
if (outData) {
|
||||
*outData = [[task output] retain];
|
||||
}
|
||||
|
||||
[task release];
|
||||
} @catch (NSException *localException) {
|
||||
taskResult = errCppGeneral;
|
||||
}
|
||||
|
||||
taskResult = [task result];
|
||||
if( outData )
|
||||
*outData = [[task output] retain];
|
||||
|
||||
[task release];
|
||||
} @catch (NSException *localException) {
|
||||
taskResult = errCppGeneral;
|
||||
}
|
||||
|
||||
[pool drain];
|
||||
|
||||
// retained above
|
||||
if( outData )
|
||||
if (outData) {
|
||||
[*outData autorelease];
|
||||
}
|
||||
|
||||
return taskResult;
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ is an easy-to-use software update framework for Cocoa developers.
|
||||
|
||||
## This fork
|
||||
|
||||
* Up to date with 10.9 SDK and Xcode 5.1.
|
||||
* Up to date with 10.9 SDK and Xcode 5/6. Supports Mac OS X 10.7+.
|
||||
* Merged bugfixes, security fixes and some features from multiple Sparkle forks.
|
||||
* Merged official Sparkle branch with truly automatic background updates (no UI at all) when user agreed to "Automatically download and install updates in the future."
|
||||
* Ability to mark updates as critical.
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url;
|
||||
|
||||
- (NSArray *)items;
|
||||
@property (readonly, copy) NSArray *items;
|
||||
@end
|
||||
|
||||
@protocol SUAppcastDelegate <NSObject>
|
||||
|
||||
+20
-24
@@ -16,7 +16,7 @@
|
||||
#import "SULog.h"
|
||||
|
||||
@interface NSXMLElement (SUAppcastExtensions)
|
||||
- (NSDictionary *)attributesAsDictionary;
|
||||
@property (readonly, copy) NSDictionary *attributesAsDictionary;
|
||||
@end
|
||||
|
||||
@implementation NSXMLElement (SUAppcastExtensions)
|
||||
@@ -26,7 +26,7 @@
|
||||
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
|
||||
|
||||
for (NSXMLNode *attribute in attributeEnum) {
|
||||
[dictionary setObject:[attribute stringValue] forKey:[attribute name]];
|
||||
dictionary[[attribute name]] = [attribute stringValue];
|
||||
}
|
||||
return dictionary;
|
||||
}
|
||||
@@ -60,8 +60,9 @@
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url
|
||||
{
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
|
||||
if (userAgentString)
|
||||
if (userAgentString) {
|
||||
[request setValue:userAgentString forHTTPHeaderField:@"User-Agent"];
|
||||
}
|
||||
|
||||
self.download = [[[NSURLDownload alloc] initWithRequest:request delegate:self] autorelease];
|
||||
}
|
||||
@@ -93,13 +94,7 @@
|
||||
if (downloadFilename)
|
||||
{
|
||||
NSUInteger options = 0;
|
||||
if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7) {
|
||||
// In order to avoid including external entities when parsing the appcast (a potential security vulnerability; see https://github.com/andymatuschak/Sparkle/issues/169), we ask NSXMLDocument to "tidy" the XML first. This happens to remove these external entities; it wouldn't be a future-proof approach, but it worked in these historical versions of OS X, and we have a more rigorous approach for 10.7+.
|
||||
options = NSXMLDocumentTidyXML;
|
||||
} else {
|
||||
// In 10.7 and later, there's a real option for the behavior we desire.
|
||||
options = NSXMLNodeLoadExternalEntitiesSameOriginOnly;
|
||||
}
|
||||
options = NSXMLNodeLoadExternalEntitiesSameOriginOnly;
|
||||
document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:options error:&error] autorelease];
|
||||
|
||||
[[NSFileManager defaultManager] removeItemAtPath:downloadFilename error:nil];
|
||||
@@ -142,11 +137,11 @@
|
||||
NSString *name = [node name];
|
||||
if (name)
|
||||
{
|
||||
NSMutableArray *nodes = [nodesDict objectForKey:name];
|
||||
NSMutableArray *nodes = nodesDict[name];
|
||||
if (nodes == nil)
|
||||
{
|
||||
nodes = [NSMutableArray array];
|
||||
[nodesDict setObject:nodes forKey:name];
|
||||
nodesDict[name] = nodes;
|
||||
}
|
||||
[nodes addObject:node];
|
||||
}
|
||||
@@ -156,12 +151,12 @@
|
||||
|
||||
for (NSString *name in nodesDict)
|
||||
{
|
||||
node = [self bestNodeInNodes:[nodesDict objectForKey:name]];
|
||||
node = [self bestNodeInNodes:nodesDict[name]];
|
||||
if ([name isEqualToString:@"enclosure"])
|
||||
{
|
||||
// enclosure is flattened as a separate dictionary for some reason
|
||||
NSDictionary *encDict = [(NSXMLElement *)node attributesAsDictionary];
|
||||
[dict setObject:encDict forKey:@"enclosure"];
|
||||
dict[@"enclosure"] = encDict;
|
||||
|
||||
}
|
||||
else if ([name isEqualToString:@"pubDate"])
|
||||
@@ -169,7 +164,7 @@
|
||||
// pubDate is expected to be an NSDate by SUAppcastItem, but the RSS class was returning an NSString
|
||||
NSDate *date = [NSDate dateWithNaturalLanguageString:[node stringValue]];
|
||||
if (date)
|
||||
[dict setObject:date forKey:name];
|
||||
dict[name] = date;
|
||||
}
|
||||
else if ([name isEqualToString:@"sparkle:deltas"])
|
||||
{
|
||||
@@ -179,14 +174,14 @@
|
||||
if ([[child name] isEqualToString:@"enclosure"])
|
||||
[deltas addObject:[(NSXMLElement *)child attributesAsDictionary]];
|
||||
}
|
||||
[dict setObject:deltas forKey:@"deltas"];
|
||||
dict[@"deltas"] = deltas;
|
||||
}
|
||||
else if (name != nil)
|
||||
{
|
||||
// add all other values as strings
|
||||
NSString *theValue = [[node stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
if (theValue != nil) {
|
||||
[dict setObject:theValue forKey:name];
|
||||
dict[name] = theValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,13 +204,13 @@
|
||||
if ([appcastItems count])
|
||||
{
|
||||
NSSortDescriptor *sort = [[[NSSortDescriptor alloc] initWithKey:@"date" ascending:NO] autorelease];
|
||||
[appcastItems sortUsingDescriptors:[NSArray arrayWithObject:sort]];
|
||||
[appcastItems sortUsingDescriptors:@[sort]];
|
||||
self.items = appcastItems;
|
||||
}
|
||||
|
||||
if (failed)
|
||||
{
|
||||
[self reportError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while parsing the update feed.", nil), NSLocalizedDescriptionKey, nil]]];
|
||||
[self reportError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:@{NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while parsing the update feed.", nil)}]];
|
||||
}
|
||||
else if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)])
|
||||
{
|
||||
@@ -243,7 +238,7 @@
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(appcast:failedToLoadWithError:)])
|
||||
{
|
||||
[delegate appcast:self failedToLoadWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred in retrieving update information. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
[delegate appcast:self failedToLoadWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastError userInfo:@{NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred in retrieving update information. Please try again later.", nil), NSLocalizedFailureReasonErrorKey: [error localizedDescription]}]];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +246,7 @@
|
||||
{
|
||||
// We use this method to pick out the localized version of a node when one's available.
|
||||
if ([nodes count] == 1)
|
||||
return [nodes objectAtIndex:0];
|
||||
return nodes[0];
|
||||
else if ([nodes count] == 0)
|
||||
return nil;
|
||||
|
||||
@@ -262,11 +257,12 @@
|
||||
lang = [[node attributeForName:@"xml:lang"] stringValue];
|
||||
[languages addObject:(lang ? lang : @"")];
|
||||
}
|
||||
lang = [[NSBundle preferredLocalizationsFromArray:languages] objectAtIndex:0];
|
||||
lang = [NSBundle preferredLocalizationsFromArray:languages][0];
|
||||
i = [languages indexOfObject:([languages containsObject:lang] ? lang : @"")];
|
||||
if (i == NSNotFound)
|
||||
if (i == NSNotFound) {
|
||||
i = 0;
|
||||
return [nodes objectAtIndex:i];
|
||||
}
|
||||
return nodes[i];
|
||||
}
|
||||
|
||||
@end
|
||||
+4
-26
@@ -10,28 +10,6 @@
|
||||
#define SUAPPCASTITEM_H
|
||||
|
||||
@interface SUAppcastItem : NSObject
|
||||
{
|
||||
@private
|
||||
NSString *title;
|
||||
NSDate *date;
|
||||
NSString *itemDescription;
|
||||
|
||||
NSURL *releaseNotesURL;
|
||||
|
||||
NSString *DSASignature;
|
||||
NSString *minimumSystemVersion;
|
||||
NSString *maximumSystemVersion;
|
||||
|
||||
NSURL *fileURL;
|
||||
NSString *versionString;
|
||||
NSString *displayVersionString;
|
||||
|
||||
NSDictionary *deltaUpdates;
|
||||
|
||||
NSDictionary *propertiesDictionary;
|
||||
|
||||
NSURL *infoURL; // UK 2007-08-31
|
||||
}
|
||||
@property (copy, readonly) NSString *title;
|
||||
@property (copy, readonly) NSDate *date;
|
||||
@property (copy, readonly) NSString *itemDescription;
|
||||
@@ -43,17 +21,17 @@
|
||||
@property (copy, readonly) NSString *versionString;
|
||||
@property (copy, readonly) NSString *displayVersionString;
|
||||
@property (copy, readonly) NSDictionary *deltaUpdates;
|
||||
@property (retain, readonly) NSURL *infoURL;
|
||||
@property (retain, readonly) NSURL *infoURL; // UK 2007-08-31
|
||||
|
||||
// Initializes with data from a dictionary provided by the RSS class.
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dict;
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dict failureReason:(NSString**)error;
|
||||
|
||||
- (BOOL)isDeltaUpdate;
|
||||
- (BOOL)isCriticalUpdate;
|
||||
@property (getter=isDeltaUpdate, readonly) BOOL deltaUpdate;
|
||||
@property (getter=isCriticalUpdate, readonly) BOOL criticalUpdate;
|
||||
|
||||
// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions.
|
||||
- (NSDictionary *)propertiesDictionary;
|
||||
@property (readonly, copy) NSDictionary *propertiesDictionary;
|
||||
|
||||
- (NSURL *)infoURL; // UK 2007-08-31
|
||||
|
||||
|
||||
+34
-34
@@ -27,6 +27,7 @@
|
||||
@property (copy, readwrite) NSString *displayVersionString;
|
||||
@property (copy, readwrite) NSDictionary *deltaUpdates;
|
||||
@property (retain, readwrite) NSURL *infoURL;
|
||||
@property (readwrite, copy) NSDictionary *propertiesDictionary;
|
||||
@end
|
||||
|
||||
@implementation SUAppcastItem
|
||||
@@ -42,28 +43,29 @@
|
||||
@synthesize releaseNotesURL;
|
||||
@synthesize title;
|
||||
@synthesize versionString;
|
||||
@synthesize propertiesDictionary;
|
||||
|
||||
- (BOOL)isDeltaUpdate
|
||||
{
|
||||
return [[propertiesDictionary objectForKey:@"enclosure"] objectForKey:@"sparkle:deltaFrom"] != nil;
|
||||
return propertiesDictionary[@"enclosure"][@"sparkle:deltaFrom"] != nil;
|
||||
}
|
||||
|
||||
- (BOOL)isCriticalUpdate
|
||||
{
|
||||
return [[propertiesDictionary objectForKey:@"sparkle:tags"] containsObject:@"sparkle:criticalUpdate"];
|
||||
return [propertiesDictionary[@"sparkle:tags"] containsObject:@"sparkle:criticalUpdate"];
|
||||
}
|
||||
|
||||
- initWithDictionary:(NSDictionary *)dict
|
||||
- (instancetype) initWithDictionary:(NSDictionary *)dict
|
||||
{
|
||||
return [self initWithDictionary:dict failureReason:nil];
|
||||
}
|
||||
|
||||
- initWithDictionary:(NSDictionary *)dict failureReason:(NSString**)error
|
||||
- (instancetype) initWithDictionary:(NSDictionary *)dict failureReason:(NSString**)error
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
id enclosure = [dict objectForKey:@"enclosure"];
|
||||
id enclosure = dict[@"enclosure"];
|
||||
|
||||
// Try to find a version string.
|
||||
// Finding the new version number from the RSS feed is a little bit hacky. There are two ways:
|
||||
@@ -73,14 +75,14 @@
|
||||
// underscore and the last period as the version number. So name your packages like this: APPNAME_VERSION.extension.
|
||||
// The big caveat with this is that you can't have underscores in your version strings, as that'll confuse Sparkle.
|
||||
// Feel free to change the separator string to a hyphen or something more suited to your needs if you like.
|
||||
NSString *newVersion = [enclosure objectForKey:@"sparkle:version"];
|
||||
NSString *newVersion = enclosure[@"sparkle:version"];
|
||||
if( newVersion == nil )
|
||||
newVersion = [dict objectForKey:@"sparkle:version"]; // UK 2007-08-31 Get version from the item, in case it's a download-less item (i.e. paid upgrade).
|
||||
newVersion = dict[@"sparkle:version"]; // UK 2007-08-31 Get version from the item, in case it's a download-less item (i.e. paid upgrade).
|
||||
if (newVersion == nil) // no sparkle:version attribute anywhere?
|
||||
{
|
||||
// Separate the url by underscores and take the last component, as that'll be closest to the end,
|
||||
// then we remove the extension. Hopefully, this will be the version.
|
||||
NSArray *fileComponents = [[enclosure objectForKey:@"url"] componentsSeparatedByString:@"_"];
|
||||
NSArray *fileComponents = [enclosure[@"url"] componentsSeparatedByString:@"_"];
|
||||
if ([fileComponents count] > 1)
|
||||
newVersion = [[fileComponents lastObject] stringByDeletingPathExtension];
|
||||
}
|
||||
@@ -94,11 +96,11 @@
|
||||
}
|
||||
|
||||
propertiesDictionary = [[NSMutableDictionary alloc] initWithDictionary:dict];
|
||||
self.title = [dict objectForKey:@"title"];
|
||||
self.date = [dict objectForKey:@"pubDate"];
|
||||
self.itemDescription = [dict objectForKey:@"description"];
|
||||
self.title = dict[@"title"];
|
||||
self.date = dict[@"pubDate"];
|
||||
self.itemDescription = dict[@"description"];
|
||||
|
||||
NSString* theInfoURL = [dict objectForKey:@"link"];
|
||||
NSString* theInfoURL = dict[@"link"];
|
||||
if( theInfoURL )
|
||||
{
|
||||
if( ![theInfoURL isKindOfClass: [NSString class]] )
|
||||
@@ -117,11 +119,12 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString* enclosureURLString = [enclosure objectForKey:@"url"];
|
||||
NSString* enclosureURLString = enclosure[@"url"];
|
||||
if( !enclosureURLString && !theInfoURL )
|
||||
{
|
||||
if (error)
|
||||
if (error) {
|
||||
*error = @"Feed item's enclosure lacks URL";
|
||||
}
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
@@ -130,16 +133,18 @@
|
||||
NSString *fileURLString = [[enclosureURLString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||
self.fileURL = [NSURL URLWithString:fileURLString];
|
||||
}
|
||||
if( enclosure )
|
||||
self.DSASignature = [enclosure objectForKey:@"sparkle:dsaSignature"];
|
||||
if (enclosure) {
|
||||
self.DSASignature = enclosure[@"sparkle:dsaSignature"];
|
||||
}
|
||||
|
||||
self.versionString = newVersion;
|
||||
self.minimumSystemVersion = [dict objectForKey:@"sparkle:minimumSystemVersion"];
|
||||
self.maximumSystemVersion = [dict objectForKey:@"sparkle:maximumSystemVersion"];
|
||||
self.minimumSystemVersion = dict[@"sparkle:minimumSystemVersion"];
|
||||
self.maximumSystemVersion = dict[@"sparkle:maximumSystemVersion"];
|
||||
|
||||
NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"];
|
||||
if (nil == shortVersionString)
|
||||
shortVersionString = [dict objectForKey:@"sparkle:shortVersionString"]; // fall back on the <item>
|
||||
NSString *shortVersionString = enclosure[@"sparkle:shortVersionString"];
|
||||
if (nil == shortVersionString) {
|
||||
shortVersionString = dict[@"sparkle:shortVersionString"]; // fall back on the <item>
|
||||
}
|
||||
|
||||
if (shortVersionString)
|
||||
self.displayVersionString = shortVersionString;
|
||||
@@ -147,25 +152,25 @@
|
||||
self.displayVersionString = [self versionString];
|
||||
|
||||
// Find the appropriate release notes URL.
|
||||
if ([dict objectForKey:@"sparkle:releaseNotesLink"])
|
||||
self.releaseNotesURL = [NSURL URLWithString:[dict objectForKey:@"sparkle:releaseNotesLink"]];
|
||||
if (dict[@"sparkle:releaseNotesLink"])
|
||||
self.releaseNotesURL = [NSURL URLWithString:dict[@"sparkle:releaseNotesLink"]];
|
||||
else if ([self.itemDescription hasPrefix:@"http://"] || [self.itemDescription hasPrefix:@"https://"]) // if the description starts with http:// or https:// use that.
|
||||
self.releaseNotesURL = [NSURL URLWithString:self.itemDescription];
|
||||
else
|
||||
self.releaseNotesURL = nil;
|
||||
|
||||
if ([dict objectForKey:@"deltas"])
|
||||
if (dict[@"deltas"])
|
||||
{
|
||||
NSMutableDictionary *deltas = [NSMutableDictionary dictionary];
|
||||
NSArray *deltaDictionaries = [dict objectForKey:@"deltas"];
|
||||
for (NSDictionary *deltaDictionary in [deltaDictionaries objectEnumerator]) {
|
||||
NSArray *deltaDictionaries = dict[@"deltas"];
|
||||
for (NSDictionary *deltaDictionary in deltaDictionaries) {
|
||||
NSMutableDictionary *fakeAppCastDict = [dict mutableCopy];
|
||||
[fakeAppCastDict removeObjectForKey:@"deltas"];
|
||||
[fakeAppCastDict setObject:deltaDictionary forKey:@"enclosure"];
|
||||
fakeAppCastDict[@"enclosure"] = deltaDictionary;
|
||||
SUAppcastItem *deltaItem = [[[self class] alloc] initWithDictionary:fakeAppCastDict];
|
||||
[fakeAppCastDict release];
|
||||
|
||||
[deltas setObject:deltaItem forKey:[deltaDictionary objectForKey:@"sparkle:deltaFrom"]];
|
||||
deltas[deltaDictionary[@"sparkle:deltaFrom"]] = deltaItem;
|
||||
[deltaItem release];
|
||||
}
|
||||
self.deltaUpdates = deltas;
|
||||
@@ -186,13 +191,8 @@
|
||||
self.versionString = nil;
|
||||
self.displayVersionString = nil;
|
||||
self.infoURL = nil;
|
||||
[propertiesDictionary release];
|
||||
self.propertiesDictionary = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSDictionary *)propertiesDictionary
|
||||
{
|
||||
return propertiesDictionary;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -21,13 +21,9 @@ typedef enum
|
||||
} SUAutomaticInstallationChoice;
|
||||
|
||||
@class SUAppcastItem, SUHost;
|
||||
@interface SUAutomaticUpdateAlert : SUWindowController {
|
||||
SUAppcastItem *updateItem;
|
||||
id<SUAutomaticUpdateAlertDelegateProtocol> delegate;
|
||||
SUHost *host;
|
||||
}
|
||||
@interface SUAutomaticUpdateAlert : SUWindowController
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)hostBundle delegate:(id<SUAutomaticUpdateAlertDelegateProtocol>)delegate;
|
||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)hostBundle delegate:(id<SUAutomaticUpdateAlertDelegateProtocol>)delegate;
|
||||
- (IBAction)installNow:sender;
|
||||
- (IBAction)installLater:sender;
|
||||
- (IBAction)doNotInstall:sender;
|
||||
|
||||
+19
-10
@@ -10,16 +10,25 @@
|
||||
|
||||
#import "SUHost.h"
|
||||
|
||||
@implementation SUAutomaticUpdateAlert
|
||||
@interface SUAutomaticUpdateAlert ()
|
||||
@property (retain) SUAppcastItem *updateItem;
|
||||
@property (assign) id<SUAutomaticUpdateAlertDelegateProtocol> delegate;
|
||||
@property (retain) SUHost *host;
|
||||
@end
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost delegate:(id<SUAutomaticUpdateAlertDelegateProtocol>)del
|
||||
@implementation SUAutomaticUpdateAlert
|
||||
@synthesize delegate;
|
||||
@synthesize host;
|
||||
@synthesize updateItem;
|
||||
|
||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost delegate:(id<SUAutomaticUpdateAlertDelegateProtocol>)del
|
||||
{
|
||||
self = [super initWithHost:aHost windowNibName:@"SUAutomaticUpdateAlert"];
|
||||
if (self)
|
||||
{
|
||||
updateItem = [item retain];
|
||||
delegate = del;
|
||||
host = [aHost retain];
|
||||
self.updateItem = item;
|
||||
self.delegate = del;
|
||||
self.host = aHost;
|
||||
[self setShouldCascadeWindows:NO];
|
||||
[[self window] center];
|
||||
}
|
||||
@@ -28,26 +37,26 @@
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[host release];
|
||||
[updateItem release];
|
||||
self.host = nil;
|
||||
self.updateItem = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [host bundlePath], [host installationPath]]; }
|
||||
|
||||
- (IBAction)installNow:sender
|
||||
- (IBAction)installNow:(id)sender
|
||||
{
|
||||
[self close];
|
||||
[delegate automaticUpdateAlert:self finishedWithChoice:SUInstallNowChoice];
|
||||
}
|
||||
|
||||
- (IBAction)installLater:sender
|
||||
- (IBAction)installLater:(id)sender
|
||||
{
|
||||
[self close];
|
||||
[delegate automaticUpdateAlert:self finishedWithChoice:SUInstallLaterChoice];
|
||||
}
|
||||
|
||||
- (IBAction)doNotInstall:sender
|
||||
- (IBAction)doNotInstall:(id)sender
|
||||
{
|
||||
[self close];
|
||||
[delegate automaticUpdateAlert:self finishedWithChoice:SUDoNotInstallChoice];
|
||||
|
||||
@@ -144,8 +144,9 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
|
||||
- (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI
|
||||
{
|
||||
if (relaunch)
|
||||
if (relaunch) {
|
||||
[self stopUpdatingOnTermination];
|
||||
}
|
||||
|
||||
showErrors = YES;
|
||||
[super installWithToolAndRelaunch:relaunch displayingUserInterface:showUI];
|
||||
|
||||
+35
-27
@@ -37,7 +37,7 @@
|
||||
[super checkForUpdatesAtURL:URL host:aHost];
|
||||
if ([aHost isRunningOnReadOnlyVolume])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:[NSDictionary dictionaryWithObject:[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]] forKey:NSLocalizedDescriptionKey]]];
|
||||
[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]]}]];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,12 +55,14 @@
|
||||
id <SUVersionComparison> comparator = nil;
|
||||
|
||||
// Give the delegate a chance to provide a custom version comparator
|
||||
if ([[updater delegate] respondsToSelector:@selector(versionComparatorForUpdater:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(versionComparatorForUpdater:)]) {
|
||||
comparator = [[updater delegate] versionComparatorForUpdater:updater];
|
||||
}
|
||||
|
||||
// If we don't get a comparator from the delegate, use the default comparator
|
||||
if (!comparator)
|
||||
if (!comparator) {
|
||||
comparator = [SUStandardVersionComparator defaultComparator];
|
||||
}
|
||||
|
||||
return comparator;
|
||||
}
|
||||
@@ -103,8 +105,9 @@
|
||||
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)]) {
|
||||
[[updater delegate] updater:updater didFinishLoadingAppcast:ac];
|
||||
}
|
||||
|
||||
NSDictionary *userInfo = (ac != nil) ? @{SUUpdaterAppcastNotificationKey : ac} : nil;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:updater userInfo:userInfo];
|
||||
@@ -125,7 +128,7 @@
|
||||
} while (item && ![self hostSupportsItem:item]);
|
||||
|
||||
if (binaryDeltaSupported()) {
|
||||
SUAppcastItem *deltaUpdateItem = [[item deltaUpdates] objectForKey:[host version]];
|
||||
SUAppcastItem *deltaUpdateItem = [item deltaUpdates][[host version]];
|
||||
if (deltaUpdateItem && [self hostSupportsItem:deltaUpdateItem]) {
|
||||
nonDeltaUpdateItem = [item retain];
|
||||
item = deltaUpdateItem;
|
||||
@@ -154,17 +157,18 @@
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
|
||||
[[updater delegate] updater:updater didFindValidUpdate:updateItem];
|
||||
NSDictionary *userInfo = (updateItem != nil) ? @{SUUpdaterAppcastItemNotificationKey : updateItem} : nil;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFinishLoadingAppCastNotification object:updater userInfo:userInfo];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification object:updater userInfo:userInfo];
|
||||
[self downloadUpdate];
|
||||
}
|
||||
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
||||
[[updater delegate] updaterDidNotFindUpdate:updater];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:updater];
|
||||
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUNoUpdateError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", nil), [host name]] forKey:NSLocalizedDescriptionKey]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUNoUpdateError userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", nil), [host name]]}]];
|
||||
}
|
||||
|
||||
- (void)downloadUpdate
|
||||
@@ -194,7 +198,7 @@
|
||||
{
|
||||
// Okay, something's really broken with this user's file structure.
|
||||
[download cancel];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUTemporaryDirectoryError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Can't make a temporary directory for the update download at %@.",tempDir] forKey:NSLocalizedDescriptionKey]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUTemporaryDirectoryError userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Can't make a temporary directory for the update download at %@.",tempDir]}]];
|
||||
}
|
||||
|
||||
downloadPath = [[tempDir stringByAppendingPathComponent:name] retain];
|
||||
@@ -224,7 +228,7 @@
|
||||
|
||||
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while downloading the update. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:@{NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while downloading the update. Please try again later.", nil), NSLocalizedFailureReasonErrorKey: [error localizedDescription]}]];
|
||||
}
|
||||
|
||||
- (BOOL)download:(NSURLDownload *)download shouldDecodeSourceDataOfMIMEType:(NSString *)encodingType
|
||||
@@ -273,7 +277,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:[NSDictionary dictionaryWithObject:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil) forKey:NSLocalizedDescriptionKey]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil)}]];
|
||||
}
|
||||
|
||||
- (BOOL)shouldInstallSynchronously { return NO; }
|
||||
@@ -289,7 +293,7 @@
|
||||
#if !ENDANGER_USERS_WITH_INSECURE_UPDATES
|
||||
if (![self validateUpdateDownloadedToPath:downloadPath extractedToPath:tempDir DSASignature:[updateItem DSASignature] publicDSAKey:[host publicDSAKey]])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUSignatureError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil), NSLocalizedDescriptionKey, @"The update is improperly signed.", NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUSignatureError userInfo:@{NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil), NSLocalizedFailureReasonErrorKey: @"The update is improperly signed."}]];
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -309,13 +313,15 @@
|
||||
[invocation setArgument:&relaunch atIndex:2];
|
||||
[invocation setTarget:self];
|
||||
postponedOnce = YES;
|
||||
if ([[updater delegate] updater:updater shouldPostponeRelaunchForUpdate:updateItem untilInvoking:invocation])
|
||||
if ([[updater delegate] updater:updater shouldPostponeRelaunchForUpdate:updateItem untilInvoking:invocation]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:willInstallUpdate:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:willInstallUpdate:)]) {
|
||||
[[updater delegate] updater:updater willInstallUpdate:updateItem];
|
||||
}
|
||||
|
||||
NSString *const finishInstallToolName = FINISH_INSTALL_TOOL_NAME_STRING;
|
||||
|
||||
@@ -327,12 +333,12 @@
|
||||
NSString *targetPath = [[host appSupportPath] stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]];
|
||||
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
|
||||
NSError *error = nil;
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath: [targetPath stringByDeletingLastPathComponent] withIntermediateDirectories: YES attributes: [NSDictionary dictionary] error: &error];
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath: [targetPath stringByDeletingLastPathComponent] withIntermediateDirectories: YES attributes: @{} error: &error];
|
||||
|
||||
if( [SUPlainInstaller copyPathWithAuthentication: relaunchPathToCopy overPath: targetPath temporaryName: nil error: &error] )
|
||||
relaunchPath = [targetPath retain];
|
||||
else
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil), NSLocalizedDescriptionKey, [NSString stringWithFormat:@"Couldn't copy relauncher (%@) to temporary path (%@)! %@", relaunchPathToCopy, targetPath, (error ? [error localizedDescription] : @"")], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:@{NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil), NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"Couldn't copy relauncher (%@) to temporary path (%@)! %@", relaunchPathToCopy, targetPath, (error ? [error localizedDescription] : @"")]}]];
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterWillRestartNotification object:self];
|
||||
@@ -342,23 +348,22 @@
|
||||
if(!relaunchPath || ![[NSFileManager defaultManager] fileExistsAtPath:relaunchPath])
|
||||
{
|
||||
// Note that we explicitly use the host app's name here, since updating plugin for Mail relaunches Mail, not just the plugin.
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.", nil), [host name]], NSLocalizedDescriptionKey, [NSString stringWithFormat:@"Couldn't find the relauncher (expected to find it at %@)", relaunchPath], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.", nil), [host name]], NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"Couldn't find the relauncher (expected to find it at %@)", relaunchPath]}]];
|
||||
// We intentionally don't abandon the update here so that the host won't initiate another.
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *pathToRelaunch = [host bundlePath];
|
||||
if ([[updater delegate] respondsToSelector:@selector(pathToRelaunchForUpdater:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(pathToRelaunchForUpdater:)]) {
|
||||
pathToRelaunch = [[updater delegate] pathToRelaunchForUpdater:updater];
|
||||
}
|
||||
NSString *relaunchToolPath = [[relaunchPath stringByAppendingPathComponent: @"/Contents/MacOS"] stringByAppendingPathComponent: finishInstallToolName];
|
||||
[NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:[NSArray arrayWithObjects:
|
||||
[host bundlePath],
|
||||
[NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:@[[host bundlePath],
|
||||
pathToRelaunch,
|
||||
[NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]],
|
||||
tempDir,
|
||||
relaunch ? @"1" : @"0",
|
||||
showUI ? @"1" : @"0",
|
||||
nil]];
|
||||
showUI ? @"1" : @"0"]];
|
||||
|
||||
[NSApp terminate:self];
|
||||
}
|
||||
@@ -371,7 +376,7 @@
|
||||
NSError * error = nil;
|
||||
success = [[NSFileManager defaultManager] removeItemAtPath: tempDir error: &error]; // Clean up the copied relauncher
|
||||
if( !success )
|
||||
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[tempDir stringByDeletingLastPathComponent] destination:@"" files:[NSArray arrayWithObject:[tempDir lastPathComponent]] tag:NULL];
|
||||
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[tempDir stringByDeletingLastPathComponent] destination:@"" files:@[[tempDir lastPathComponent]] tag:NULL];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +385,7 @@
|
||||
if (aHost != host) { return; }
|
||||
NSError * dontThrow = nil;
|
||||
[[NSFileManager defaultManager] removeItemAtPath: relaunchPath error: &dontThrow]; // Clean up the copied relauncher
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while installing the update. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while installing the update. Please try again later.", nil), NSLocalizedFailureReasonErrorKey: [error localizedDescription]}]];
|
||||
}
|
||||
|
||||
- (void)abortUpdate
|
||||
@@ -393,12 +398,15 @@
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
if ([error code] != SUNoUpdateError) // Let's not bother logging this.
|
||||
if ([error code] != SUNoUpdateError) { // Let's not bother logging this.
|
||||
SULog(@"Sparkle Error: %@", [error localizedDescription]);
|
||||
if ([error localizedFailureReason])
|
||||
}
|
||||
if ([error localizedFailureReason]) {
|
||||
SULog(@"Sparkle Error (continued): %@", [error localizedFailureReason]);
|
||||
if (download)
|
||||
}
|
||||
if (download) {
|
||||
[download cancel];
|
||||
}
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ int applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFil
|
||||
const char *value = 0;
|
||||
xar_subdoc_prop_get(subdoc, "before-sha1", &value);
|
||||
if (value)
|
||||
expectedBeforeHash = [NSString stringWithUTF8String:value];
|
||||
expectedBeforeHash = @(value);
|
||||
|
||||
xar_subdoc_prop_get(subdoc, "after-sha1", &value);
|
||||
if (value)
|
||||
expectedAfterHash = [NSString stringWithUTF8String:value];
|
||||
expectedAfterHash = @(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ int applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFil
|
||||
xar_file_t file;
|
||||
xar_iter_t iter = xar_iter_new();
|
||||
for (file = xar_file_first(x, iter); file; file = xar_file_next(iter)) {
|
||||
NSString *path = [NSString stringWithUTF8String:xar_get_path(file)];
|
||||
NSString *path = @(xar_get_path(file));
|
||||
NSString *sourceFilePath = [source stringByAppendingPathComponent:path];
|
||||
NSString *destinationFilePath = [destination stringByAppendingPathComponent:path];
|
||||
|
||||
|
||||
@@ -22,5 +22,5 @@ extern void removeTree(NSString *path);
|
||||
extern void copyTree(NSString *source, NSString *dest);
|
||||
extern NSString *pathRelativeToDirectory(NSString *directory, NSString *path);
|
||||
NSString *temporaryFilename(NSString *base);
|
||||
|
||||
NSString *stringWithFileSystemRepresentation(const char*);
|
||||
#endif
|
||||
+16
-8
@@ -38,12 +38,20 @@ NSString *pathRelativeToDirectory(NSString *directory, NSString *path)
|
||||
return path;
|
||||
}
|
||||
|
||||
NSString *stringWithFileSystemRepresentation(const char *input) {
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
return [fm stringWithFileSystemRepresentation:input length:strlen(input)];
|
||||
}
|
||||
|
||||
NSString *temporaryFilename(NSString *base)
|
||||
{
|
||||
NSString *template = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.XXXXXXXXXX", base]];
|
||||
char buffer[MAXPATHLEN];
|
||||
strcpy(buffer, [template fileSystemRepresentation]);
|
||||
return [NSString stringWithUTF8String:mktemp(buffer)];
|
||||
const char *fsrepr = [template fileSystemRepresentation];
|
||||
char buffer[strlen(fsrepr)+1];
|
||||
strcpy(buffer, fsrepr);
|
||||
|
||||
// mkstemp() can't be used, beause it returns a file descriptor, and XAR API requires a filename
|
||||
return stringWithFileSystemRepresentation(mktemp(buffer));
|
||||
}
|
||||
|
||||
static void _hashOfBuffer(unsigned char *hash, const char* buffer, size_t bufferLength)
|
||||
@@ -109,7 +117,7 @@ NSData *hashOfFile(FTSENT *ent)
|
||||
|
||||
NSString *hashOfTree(NSString *path)
|
||||
{
|
||||
const char *sourcePaths[] = {[path UTF8String], 0};
|
||||
const char *sourcePaths[] = {[path fileSystemRepresentation], 0};
|
||||
FTS *fts = fts_open((char* const*)sourcePaths, FTS_PHYSICAL | FTS_NOCHDIR, compareFiles);
|
||||
if (!fts) {
|
||||
perror("fts_open");
|
||||
@@ -128,9 +136,9 @@ NSString *hashOfTree(NSString *path)
|
||||
_hashOfFile(fileHash, ent);
|
||||
CC_SHA1_Update(&hashContext, fileHash, sizeof(fileHash));
|
||||
|
||||
NSString *relativePath = pathRelativeToDirectory(path, [NSString stringWithUTF8String:ent->fts_path]);
|
||||
NSData *relativePathBytes = [relativePath dataUsingEncoding:NSUTF8StringEncoding];
|
||||
CC_SHA1_Update(&hashContext, [relativePathBytes bytes], (uint32_t)[relativePathBytes length]);
|
||||
NSString *relativePath = pathRelativeToDirectory(path, stringWithFileSystemRepresentation(ent->fts_path));
|
||||
const char *relativePathBytes = [relativePath fileSystemRepresentation];
|
||||
CC_SHA1_Update(&hashContext, relativePathBytes, (CC_LONG)strlen(relativePathBytes));
|
||||
}
|
||||
fts_close(fts);
|
||||
|
||||
@@ -142,7 +150,7 @@ NSString *hashOfTree(NSString *path)
|
||||
for (i = 0; i < CC_SHA1_DIGEST_LENGTH; i++)
|
||||
sprintf(hexHash + i * 2, "%02x", hash[i]);
|
||||
|
||||
return [NSString stringWithUTF8String:hexHash];
|
||||
return @(hexHash);
|
||||
}
|
||||
|
||||
void removeTree(NSString *path)
|
||||
|
||||
+180
-171
@@ -25,47 +25,44 @@
|
||||
extern int bsdiff(int argc, const char **argv);
|
||||
|
||||
@interface CreateBinaryDeltaOperation : NSOperation
|
||||
{
|
||||
NSString *_relativePath;
|
||||
NSString *_fromPath;
|
||||
NSString *_toPath;
|
||||
NSString *_resultPath;
|
||||
}
|
||||
@property (copy) NSString *relativePath;
|
||||
@property (retain) NSString *resultPath;
|
||||
@property (retain) NSString *_fromPath;
|
||||
@property (retain) NSString *_toPath;
|
||||
- (id)initWithRelativePath:(NSString *)relativePath oldTree:(NSString *)oldTree newTree:(NSString *)newTree;
|
||||
|
||||
- (NSString *)relativePath;
|
||||
- (NSString *)resultPath;
|
||||
@end
|
||||
|
||||
@implementation CreateBinaryDeltaOperation
|
||||
@synthesize _fromPath = _fromPath;
|
||||
@synthesize _toPath = _toPath;
|
||||
|
||||
- (id)initWithRelativePath:(NSString *)relativePath oldTree:(NSString *)oldTree newTree:(NSString *)newTree
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
_relativePath = [relativePath copy];
|
||||
_fromPath = [[oldTree stringByAppendingPathComponent:relativePath] retain];
|
||||
_toPath = [[newTree stringByAppendingPathComponent:relativePath] retain];
|
||||
self.relativePath = relativePath;
|
||||
self._fromPath = [oldTree stringByAppendingPathComponent:relativePath];
|
||||
self._toPath = [newTree stringByAppendingPathComponent:relativePath];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)relativePath
|
||||
{
|
||||
return [[_relativePath retain] autorelease];
|
||||
}
|
||||
|
||||
- (NSString *)resultPath
|
||||
{
|
||||
return [[_resultPath retain] autorelease];
|
||||
}
|
||||
|
||||
- (void)main
|
||||
{
|
||||
NSString *temporaryFile = temporaryFilename(@"BinaryDelta");
|
||||
const char *argv[] = {"/usr/bin/bsdiff", [_fromPath fileSystemRepresentation], [_toPath fileSystemRepresentation], [temporaryFile fileSystemRepresentation]};
|
||||
int result = bsdiff(4, argv);
|
||||
if (!result)
|
||||
_resultPath = [temporaryFile retain];
|
||||
self.resultPath = temporaryFile;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
self.relativePath = nil;
|
||||
self.resultPath = nil;
|
||||
self._fromPath = nil;
|
||||
self._toPath = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -74,8 +71,9 @@ static NSDictionary *infoForFile(FTSENT *ent)
|
||||
{
|
||||
NSData *hash = hashOfFile(ent);
|
||||
NSNumber *size = nil;
|
||||
if (ent->fts_info != FTS_D)
|
||||
if (ent->fts_info != FTS_D) {
|
||||
size = [NSNumber numberWithUnsignedLongLong:ent->fts_statp->st_size];
|
||||
}
|
||||
return [NSDictionary dictionaryWithObjectsAndKeys:hash, @"hash", [NSNumber numberWithUnsignedShort:ent->fts_info], @"type", size, @"size", nil];
|
||||
}
|
||||
|
||||
@@ -96,174 +94,185 @@ static NSString *temporaryPatchFile(NSString *patchFile)
|
||||
static BOOL shouldSkipDeltaCompression(NSString *key, NSDictionary* originalInfo, NSDictionary *newInfo)
|
||||
{
|
||||
unsigned long long fileSize = [[newInfo objectForKey:@"size"] unsignedLongLongValue];
|
||||
if (fileSize < 4096)
|
||||
if (fileSize < 4096) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
if (!originalInfo)
|
||||
if (!originalInfo) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
if ([[originalInfo objectForKey:@"type"] unsignedShortValue] != [[newInfo objectForKey:@"type"] unsignedShortValue])
|
||||
if ([[originalInfo objectForKey:@"type"] unsignedShortValue] != [[newInfo objectForKey:@"type"] unsignedShortValue]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
static BOOL shouldDeleteThenExtract(NSString *key, NSDictionary* originalInfo, NSDictionary *newInfo)
|
||||
{
|
||||
if (!originalInfo)
|
||||
if (!originalInfo) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
if ([[originalInfo objectForKey:@"type"] unsignedShortValue] != [[newInfo objectForKey:@"type"] unsignedShortValue])
|
||||
if ([[originalInfo objectForKey:@"type"] unsignedShortValue] != [[newInfo objectForKey:@"type"] unsignedShortValue]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 5) {
|
||||
usage:
|
||||
fprintf(stderr, "Usage: BinaryDelta [create | apply] before-tree after-tree patch-file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSString *command = [NSString stringWithUTF8String:argv[1]];
|
||||
NSString *oldPath = [NSString stringWithUTF8String:argv[2]];
|
||||
NSString *newPath = [NSString stringWithUTF8String:argv[3]];
|
||||
NSString *patchFile = [NSString stringWithUTF8String:argv[4]];
|
||||
|
||||
if ([command isEqualToString:@"apply"]) {
|
||||
int result = applyBinaryDelta(oldPath, newPath, patchFile);
|
||||
[pool drain];
|
||||
return result;
|
||||
}
|
||||
if (![command isEqualToString:@"create"]) {
|
||||
[pool drain];
|
||||
goto usage;
|
||||
}
|
||||
|
||||
NSMutableDictionary *originalTreeState = [NSMutableDictionary dictionary];
|
||||
|
||||
const char *sourcePaths[] = {[oldPath fileSystemRepresentation], 0};
|
||||
FTS *fts = fts_open((char* const*)sourcePaths, FTS_PHYSICAL | FTS_NOCHDIR, compareFiles);
|
||||
if (!fts) {
|
||||
[pool drain];
|
||||
perror("fts_open");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Processing %s...", [oldPath UTF8String]);
|
||||
FTSENT *ent = 0;
|
||||
while ((ent = fts_read(fts))) {
|
||||
if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL && ent->fts_info != FTS_D)
|
||||
continue;
|
||||
|
||||
NSString *key = pathRelativeToDirectory(oldPath, [NSString stringWithUTF8String:ent->fts_path]);
|
||||
if (![key length])
|
||||
continue;
|
||||
|
||||
NSDictionary *info = infoForFile(ent);
|
||||
[originalTreeState setObject:info forKey:key];
|
||||
}
|
||||
fts_close(fts);
|
||||
|
||||
NSString *beforeHash = hashOfTree(oldPath);
|
||||
|
||||
NSMutableDictionary *newTreeState = [NSMutableDictionary dictionary];
|
||||
for (NSString *key in originalTreeState)
|
||||
{
|
||||
[newTreeState setObject:[NSNull null] forKey:key];
|
||||
}
|
||||
|
||||
fprintf(stderr, "\nProcessing %s... ", [newPath UTF8String]);
|
||||
sourcePaths[0] = [newPath fileSystemRepresentation];
|
||||
fts = fts_open((char* const*)sourcePaths, FTS_PHYSICAL | FTS_NOCHDIR, compareFiles);
|
||||
if (!fts) {
|
||||
[pool drain];
|
||||
perror("fts_open");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
while ((ent = fts_read(fts))) {
|
||||
if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL && ent->fts_info != FTS_D)
|
||||
continue;
|
||||
|
||||
NSString *key = pathRelativeToDirectory(newPath, [NSString stringWithUTF8String:ent->fts_path]);
|
||||
if (![key length])
|
||||
continue;
|
||||
|
||||
NSDictionary *info = infoForFile(ent);
|
||||
NSDictionary *oldInfo = [originalTreeState objectForKey:key];
|
||||
|
||||
if ([info isEqual:oldInfo])
|
||||
[newTreeState removeObjectForKey:key];
|
||||
else
|
||||
[newTreeState setObject:info forKey:key];
|
||||
}
|
||||
fts_close(fts);
|
||||
|
||||
NSString *afterHash = hashOfTree(newPath);
|
||||
|
||||
fprintf(stderr, "\nGenerating delta... ");
|
||||
|
||||
NSString *temporaryFile = temporaryPatchFile(patchFile);
|
||||
xar_t x = xar_open([temporaryFile fileSystemRepresentation], WRITE);
|
||||
xar_opt_set(x, XAR_OPT_COMPRESSION, "bzip2");
|
||||
xar_subdoc_t attributes = xar_subdoc_new(x, "binary-delta-attributes");
|
||||
xar_subdoc_prop_set(attributes, "before-sha1", [beforeHash UTF8String]);
|
||||
xar_subdoc_prop_set(attributes, "after-sha1", [afterHash UTF8String]);
|
||||
|
||||
NSOperationQueue *deltaQueue = [[NSOperationQueue alloc] init];
|
||||
NSMutableArray *deltaOperations = [NSMutableArray array];
|
||||
|
||||
NSArray *keys = [[newTreeState allKeys] sortedArrayUsingSelector:@selector(compare:)];
|
||||
for (NSString* key in keys) {
|
||||
id value = [newTreeState valueForKey:key];
|
||||
|
||||
if ([value isEqual:[NSNull null]]) {
|
||||
xar_file_t newFile = xar_add_frombuffer(x, 0, [key fileSystemRepresentation], (char *)"", 1);
|
||||
assert(newFile);
|
||||
xar_prop_set(newFile, "delete", "true");
|
||||
continue;
|
||||
@autoreleasepool {
|
||||
if (argc != 5) {
|
||||
usage:
|
||||
fprintf(stderr, "Usage: BinaryDelta [create | apply] before-tree after-tree patch-file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
NSDictionary *originalInfo = [originalTreeState objectForKey:key];
|
||||
NSDictionary *newInfo = [newTreeState objectForKey:key];
|
||||
if (shouldSkipDeltaCompression(key, originalInfo, newInfo)) {
|
||||
NSString *path = [newPath stringByAppendingPathComponent:key];
|
||||
xar_file_t newFile = xar_add_frompath(x, 0, [key fileSystemRepresentation], [path fileSystemRepresentation]);
|
||||
assert(newFile);
|
||||
if (shouldDeleteThenExtract(key, originalInfo, newInfo))
|
||||
xar_prop_set(newFile, "delete-then-extract", "true");
|
||||
} else {
|
||||
CreateBinaryDeltaOperation *operation = [[CreateBinaryDeltaOperation alloc] initWithRelativePath:key oldTree:oldPath newTree:newPath];
|
||||
[deltaQueue addOperation:operation];
|
||||
[deltaOperations addObject:operation];
|
||||
[operation release];
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSString *command = [NSString stringWithUTF8String:argv[1]];
|
||||
NSString *oldPath = stringWithFileSystemRepresentation(argv[2]);
|
||||
NSString *newPath = stringWithFileSystemRepresentation(argv[3]);
|
||||
NSString *patchFile = stringWithFileSystemRepresentation(argv[4]);
|
||||
|
||||
if ([command isEqualToString:@"apply"]) {
|
||||
int result = applyBinaryDelta(oldPath, newPath, patchFile);
|
||||
[pool drain];
|
||||
return result;
|
||||
}
|
||||
if (![command isEqualToString:@"create"]) {
|
||||
[pool drain];
|
||||
goto usage;
|
||||
}
|
||||
|
||||
NSMutableDictionary *originalTreeState = [NSMutableDictionary dictionary];
|
||||
|
||||
const char *sourcePaths[] = {[oldPath fileSystemRepresentation], 0};
|
||||
FTS *fts = fts_open((char* const*)sourcePaths, FTS_PHYSICAL | FTS_NOCHDIR, compareFiles);
|
||||
if (!fts) {
|
||||
[pool drain];
|
||||
perror("fts_open");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Processing %s...", [oldPath UTF8String]);
|
||||
FTSENT *ent = 0;
|
||||
while ((ent = fts_read(fts))) {
|
||||
if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL && ent->fts_info != FTS_D) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NSString *key = pathRelativeToDirectory(oldPath, stringWithFileSystemRepresentation(ent->fts_path));
|
||||
if (![key length]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NSDictionary *info = infoForFile(ent);
|
||||
[originalTreeState setObject:info forKey:key];
|
||||
}
|
||||
fts_close(fts);
|
||||
|
||||
NSString *beforeHash = hashOfTree(oldPath);
|
||||
|
||||
NSMutableDictionary *newTreeState = [NSMutableDictionary dictionary];
|
||||
for (NSString *key in originalTreeState)
|
||||
{
|
||||
[newTreeState setObject:[NSNull null] forKey:key];
|
||||
}
|
||||
|
||||
fprintf(stderr, "\nProcessing %s... ", [newPath UTF8String]);
|
||||
sourcePaths[0] = [newPath fileSystemRepresentation];
|
||||
fts = fts_open((char* const*)sourcePaths, FTS_PHYSICAL | FTS_NOCHDIR, compareFiles);
|
||||
if (!fts) {
|
||||
[pool drain];
|
||||
perror("fts_open");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
while ((ent = fts_read(fts))) {
|
||||
if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL && ent->fts_info != FTS_D) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NSString *key = pathRelativeToDirectory(newPath, stringWithFileSystemRepresentation(ent->fts_path));
|
||||
if (![key length]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NSDictionary *info = infoForFile(ent);
|
||||
NSDictionary *oldInfo = [originalTreeState objectForKey:key];
|
||||
|
||||
if ([info isEqual:oldInfo])
|
||||
[newTreeState removeObjectForKey:key];
|
||||
else
|
||||
[newTreeState setObject:info forKey:key];
|
||||
}
|
||||
fts_close(fts);
|
||||
|
||||
NSString *afterHash = hashOfTree(newPath);
|
||||
|
||||
fprintf(stderr, "\nGenerating delta... ");
|
||||
|
||||
NSString *temporaryFile = temporaryPatchFile(patchFile);
|
||||
xar_t x = xar_open([temporaryFile fileSystemRepresentation], WRITE);
|
||||
xar_opt_set(x, XAR_OPT_COMPRESSION, "bzip2");
|
||||
xar_subdoc_t attributes = xar_subdoc_new(x, "binary-delta-attributes");
|
||||
xar_subdoc_prop_set(attributes, "before-sha1", [beforeHash UTF8String]);
|
||||
xar_subdoc_prop_set(attributes, "after-sha1", [afterHash UTF8String]);
|
||||
|
||||
NSOperationQueue *deltaQueue = [[NSOperationQueue alloc] init];
|
||||
NSMutableArray *deltaOperations = [NSMutableArray array];
|
||||
|
||||
NSArray *keys = [[newTreeState allKeys] sortedArrayUsingSelector:@selector(compare:)];
|
||||
for (NSString* key in keys) {
|
||||
id value = [newTreeState valueForKey:key];
|
||||
|
||||
if ([value isEqual:[NSNull null]]) {
|
||||
xar_file_t newFile = xar_add_frombuffer(x, 0, [key fileSystemRepresentation], (char *)"", 1);
|
||||
assert(newFile);
|
||||
xar_prop_set(newFile, "delete", "true");
|
||||
continue;
|
||||
}
|
||||
|
||||
NSDictionary *originalInfo = [originalTreeState objectForKey:key];
|
||||
NSDictionary *newInfo = [newTreeState objectForKey:key];
|
||||
if (shouldSkipDeltaCompression(key, originalInfo, newInfo)) {
|
||||
NSString *path = [newPath stringByAppendingPathComponent:key];
|
||||
xar_file_t newFile = xar_add_frompath(x, 0, [key fileSystemRepresentation], [path fileSystemRepresentation]);
|
||||
assert(newFile);
|
||||
if (shouldDeleteThenExtract(key, originalInfo, newInfo)) {
|
||||
xar_prop_set(newFile, "delete-then-extract", "true");
|
||||
}
|
||||
} else {
|
||||
CreateBinaryDeltaOperation *operation = [[CreateBinaryDeltaOperation alloc] initWithRelativePath:key oldTree:oldPath newTree:newPath];
|
||||
[deltaQueue addOperation:operation];
|
||||
[deltaOperations addObject:operation];
|
||||
[operation release];
|
||||
}
|
||||
}
|
||||
|
||||
[deltaQueue waitUntilAllOperationsAreFinished];
|
||||
[deltaQueue release];
|
||||
|
||||
for (CreateBinaryDeltaOperation *operation in deltaOperations) {
|
||||
NSString *resultPath = [operation resultPath];
|
||||
xar_file_t newFile = xar_add_frompath(x, 0, [[operation relativePath] fileSystemRepresentation], [resultPath fileSystemRepresentation]);
|
||||
assert(newFile);
|
||||
xar_prop_set(newFile, "binary-delta", "true");
|
||||
unlink([resultPath fileSystemRepresentation]);
|
||||
}
|
||||
|
||||
xar_close(x);
|
||||
|
||||
unlink([patchFile fileSystemRepresentation]);
|
||||
link([temporaryFile fileSystemRepresentation], [patchFile fileSystemRepresentation]);
|
||||
unlink([temporaryFile fileSystemRepresentation]);
|
||||
fprintf(stderr, "Done!\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
[deltaQueue waitUntilAllOperationsAreFinished];
|
||||
[deltaQueue release];
|
||||
|
||||
for (CreateBinaryDeltaOperation *operation in deltaOperations) {
|
||||
NSString *resultPath = [operation resultPath];
|
||||
xar_file_t newFile = xar_add_frompath(x, 0, [[operation relativePath] fileSystemRepresentation], [resultPath fileSystemRepresentation]);
|
||||
assert(newFile);
|
||||
xar_prop_set(newFile, "binary-delta", "true");
|
||||
unlink([resultPath fileSystemRepresentation]);
|
||||
}
|
||||
|
||||
xar_close(x);
|
||||
|
||||
unlink([patchFile fileSystemRepresentation]);
|
||||
link([temporaryFile fileSystemRepresentation], [patchFile fileSystemRepresentation]);
|
||||
unlink([temporaryFile fileSystemRepresentation]);
|
||||
fprintf(stderr, "Done!\n");
|
||||
|
||||
[pool drain];
|
||||
return 0;
|
||||
}
|
||||
+19
-12
@@ -22,22 +22,29 @@
|
||||
|
||||
- (void)applyBinaryDelta
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString *sourcePath = [[updateHost bundle] bundlePath];
|
||||
NSString *targetPath = [[archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
||||
|
||||
int result = applyBinaryDelta(sourcePath, targetPath, archivePath);
|
||||
if (!result)
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfSuccess) withObject:nil waitUntilDone:NO];
|
||||
else
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfFailure) withObject:nil waitUntilDone:NO];
|
||||
|
||||
[pool drain];
|
||||
@autoreleasepool {
|
||||
NSString *sourcePath = [[updateHost bundle] bundlePath];
|
||||
NSString *targetPath = [[archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
||||
|
||||
int result = applyBinaryDelta(sourcePath, targetPath, archivePath);
|
||||
if (!result) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self notifyDelegateOfSuccess];
|
||||
});
|
||||
}
|
||||
else {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self notifyDelegateOfFailure];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)start
|
||||
{
|
||||
[NSThread detachNewThreadSelector:@selector(applyBinaryDelta) toTarget:self withObject:nil];
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[self applyBinaryDelta];
|
||||
});
|
||||
}
|
||||
|
||||
+ (void)load
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
// Notifications:
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
extern NSString *const SUUpdaterWillRestartNotification;
|
||||
|
||||
extern NSString *const SUTechnicalErrorInformationKey;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "SUConstants.h"
|
||||
|
||||
NSString *const SUUpdaterWillRestartNotification = @"SUUpdaterWillRestartNotificationName";
|
||||
NSString *const SUTechnicalErrorInformationKey = @"SUTechnicalErrorInformation";
|
||||
|
||||
NSString *const SUHasLaunchedBeforeKey = @"SUHasLaunchedBefore";
|
||||
|
||||
+97
-108
@@ -22,132 +22,121 @@
|
||||
// Called on a non-main thread.
|
||||
- (void)extractDMG
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
[self extractDMGWithPassword:nil];
|
||||
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
[self extractDMGWithPassword:nil];
|
||||
}
|
||||
}
|
||||
|
||||
// Called on a non-main thread.
|
||||
- (void)extractDMGWithPassword:(NSString *)password
|
||||
{
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
BOOL mountedSuccessfully = NO;
|
||||
|
||||
SULog(@"Extracting %@ as a DMG", archivePath);
|
||||
|
||||
// get a unique mount point path
|
||||
NSString *mountPointName = nil;
|
||||
NSString *mountPoint = nil;
|
||||
FSRef tmpRef;
|
||||
do
|
||||
{
|
||||
CFUUIDRef uuid = CFUUIDCreate(NULL);
|
||||
if (uuid)
|
||||
@autoreleasepool {
|
||||
BOOL mountedSuccessfully = NO;
|
||||
|
||||
SULog(@"Extracting %@ as a DMG", archivePath);
|
||||
|
||||
// get a unique mount point path
|
||||
NSString *mountPoint = nil;
|
||||
FSRef tmpRef;
|
||||
do
|
||||
{
|
||||
CFStringRef uuidString = CFUUIDCreateString(NULL, uuid);
|
||||
if (uuidString)
|
||||
// Using NSUUID would make creating UUIDs be done in Cocoa,
|
||||
// and thus managed under ARC. Sadly, the class is in 10.8 and later.
|
||||
CFUUIDRef uuid = CFUUIDCreate(NULL);
|
||||
if (uuid)
|
||||
{
|
||||
mountPoint = [@"/Volumes" stringByAppendingPathComponent:(NSString*)uuidString];
|
||||
CFRelease(uuidString);
|
||||
NSString *uuidString = CFBridgingRelease(CFUUIDCreateString(NULL, uuid));
|
||||
if (uuidString)
|
||||
{
|
||||
mountPoint = [@"/Volumes" stringByAppendingPathComponent:uuidString];
|
||||
}
|
||||
CFRelease(uuid);
|
||||
}
|
||||
CFRelease(uuid);
|
||||
}
|
||||
}
|
||||
while (noErr == FSPathMakeRefWithOptions((UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL));
|
||||
|
||||
NSData *promptData = nil;
|
||||
promptData = [NSData dataWithBytes:"yes\n" length:4];
|
||||
|
||||
NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, /*@"-noverify",*/ @"-nobrowse", @"-noautoopen", nil];
|
||||
|
||||
NSData *output = nil;
|
||||
NSInteger taskResult = -1;
|
||||
@try
|
||||
{
|
||||
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
|
||||
while (noErr == FSPathMakeRefWithOptions((UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL));
|
||||
|
||||
[task run:@"/usr/bin/hdiutil" directory:@"/" withArgs:arguments input:promptData];
|
||||
NSData *promptData = nil;
|
||||
promptData = [NSData dataWithBytes:"yes\n" length:4];
|
||||
|
||||
taskResult = [task result];
|
||||
output = [[[task output] copy] autorelease];
|
||||
[task release];
|
||||
}
|
||||
@catch (NSException *localException)
|
||||
{
|
||||
goto reportError;
|
||||
}
|
||||
|
||||
if (taskResult != 0)
|
||||
{
|
||||
NSString* resultStr = output ? [[[NSString alloc] initWithData: output encoding: NSUTF8StringEncoding] autorelease] : nil;
|
||||
SULog( @"hdiutil failed with code: %d data: <<%@>>", taskResult, resultStr );
|
||||
goto reportError;
|
||||
}
|
||||
mountedSuccessfully = YES;
|
||||
|
||||
// Now that we've mounted it, we need to copy out its contents.
|
||||
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) {
|
||||
// On 10.7 and later we don't want to use the File Manager API and instead want to use NSFileManager (fixes #827357).
|
||||
NSArray* arguments = @[@"attach", archivePath, @"-mountpoint", mountPoint, /*@"-noverify",*/ @"-nobrowse", @"-noautoopen"];
|
||||
|
||||
NSData *output = nil;
|
||||
NSInteger taskResult = -1;
|
||||
@try
|
||||
{
|
||||
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
|
||||
|
||||
[task run:@"/usr/bin/hdiutil" directory:@"/" withArgs:arguments input:promptData];
|
||||
|
||||
taskResult = [task result];
|
||||
output = [[[task output] copy] autorelease];
|
||||
[task release];
|
||||
}
|
||||
@catch (NSException *localException)
|
||||
{
|
||||
goto reportError;
|
||||
}
|
||||
|
||||
if (taskResult != 0)
|
||||
{
|
||||
NSString* resultStr = output ? [[[NSString alloc] initWithData: output encoding: NSUTF8StringEncoding] autorelease] : nil;
|
||||
SULog( @"hdiutil failed with code: %d data: <<%@>>", taskResult, resultStr );
|
||||
goto reportError;
|
||||
}
|
||||
mountedSuccessfully = YES;
|
||||
|
||||
// Now that we've mounted it, we need to copy out its contents.
|
||||
NSFileManager *manager = [[[NSFileManager alloc] init] autorelease];
|
||||
NSError *error = nil;
|
||||
NSArray *contents = [manager contentsOfDirectoryAtPath:mountPoint error:&error];
|
||||
if (error)
|
||||
{
|
||||
SULog(@"Couldn't enumerate contents of archive mounted at %@: %@", mountPoint, error);
|
||||
goto reportError;
|
||||
}
|
||||
|
||||
for (NSString *item in contents)
|
||||
{
|
||||
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
|
||||
NSString *toPath = [[archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
|
||||
|
||||
// We skip any files in the DMG which are not readable.
|
||||
if (![manager isReadableFileAtPath:fromPath])
|
||||
continue;
|
||||
|
||||
SULog(@"copyItemAtPath:%@ toPath:%@", fromPath, toPath);
|
||||
|
||||
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
|
||||
{
|
||||
SULog(@"Couldn't copy item: %@ : %@", error, error.userInfo ? error.userInfo : @"");
|
||||
goto reportError;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
FSRef srcRef, dstRef;
|
||||
OSStatus err;
|
||||
err = FSPathMakeRef((UInt8 *)[mountPoint fileSystemRepresentation], &srcRef, NULL);
|
||||
if (err != noErr) goto reportError;
|
||||
err = FSPathMakeRef((UInt8 *)[[archivePath stringByDeletingLastPathComponent] fileSystemRepresentation], &dstRef, NULL);
|
||||
if (err != noErr) goto reportError;
|
||||
NSError *error = nil;
|
||||
NSArray *contents = [manager contentsOfDirectoryAtPath:mountPoint error:&error];
|
||||
if (error)
|
||||
{
|
||||
SULog(@"Couldn't enumerate contents of archive mounted at %@: %@", mountPoint, error);
|
||||
goto reportError;
|
||||
}
|
||||
|
||||
err = FSCopyObjectSync(&srcRef, &dstRef, (CFStringRef)mountPointName, NULL, kFSFileOperationSkipSourcePermissionErrors);
|
||||
if (err != noErr) goto reportError;
|
||||
for (NSString *item in contents)
|
||||
{
|
||||
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
|
||||
NSString *toPath = [[archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
|
||||
|
||||
// We skip any files in the DMG which are not readable.
|
||||
if (![manager isReadableFileAtPath:fromPath]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SULog(@"copyItemAtPath:%@ toPath:%@", fromPath, toPath);
|
||||
|
||||
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
|
||||
{
|
||||
SULog(@"Couldn't copy item: %@ : %@", error, error.userInfo ? error.userInfo : @"");
|
||||
goto reportError;
|
||||
}
|
||||
}
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self notifyDelegateOfSuccess];
|
||||
});
|
||||
goto finally;
|
||||
|
||||
reportError:
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self notifyDelegateOfFailure];
|
||||
});
|
||||
|
||||
finally:
|
||||
if (mountedSuccessfully)
|
||||
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:@[@"detach", mountPoint, @"-force"]];
|
||||
else
|
||||
SULog(@"Can't mount DMG %@",archivePath);
|
||||
}
|
||||
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfSuccess) withObject:nil waitUntilDone:NO];
|
||||
goto finally;
|
||||
|
||||
reportError:
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfFailure) withObject:nil waitUntilDone:NO];
|
||||
|
||||
finally:
|
||||
if (mountedSuccessfully)
|
||||
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray arrayWithObjects:@"detach", mountPoint, @"-force", nil]];
|
||||
else
|
||||
SULog(@"Can't mount DMG %@",archivePath);
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
- (void)start
|
||||
{
|
||||
[NSThread detachNewThreadSelector:@selector(extractDMG) toTarget:self withObject:nil];
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[self extractDMG];
|
||||
});
|
||||
}
|
||||
|
||||
+ (void)load
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
@interface SUHost : NSObject
|
||||
{
|
||||
@private
|
||||
NSBundle *bundle;
|
||||
NSString *defaultsDomain;
|
||||
BOOL usesStandardUserDefaults;
|
||||
}
|
||||
@@ -21,18 +20,18 @@
|
||||
|
||||
+ (NSString *)systemVersionString;
|
||||
|
||||
- (id)initWithBundle:(NSBundle *)aBundle;
|
||||
- (NSString *)bundlePath;
|
||||
- (NSString *)appSupportPath;
|
||||
- (NSString *)installationPath;
|
||||
- (NSString *)name;
|
||||
- (NSString *)version;
|
||||
- (NSString *)displayVersion;
|
||||
- (NSImage *)icon;
|
||||
- (BOOL)isRunningOnReadOnlyVolume;
|
||||
- (BOOL)isBackgroundApplication;
|
||||
- (NSString *)publicDSAKey;
|
||||
- (NSArray *)systemProfile;
|
||||
- (instancetype)initWithBundle:(NSBundle *)aBundle;
|
||||
@property (readonly, copy) NSString *bundlePath;
|
||||
@property (readonly, copy) NSString *appSupportPath;
|
||||
@property (readonly, copy) NSString *installationPath;
|
||||
@property (readonly, copy) NSString *name;
|
||||
@property (readonly, copy) NSString *version;
|
||||
@property (readonly, copy) NSString *displayVersion;
|
||||
@property (readonly, copy) NSImage *icon;
|
||||
@property (getter=isRunningOnReadOnlyVolume, readonly) BOOL runningOnReadOnlyVolume;
|
||||
@property (getter=isBackgroundApplication, readonly) BOOL backgroundApplication;
|
||||
@property (readonly, copy) NSString *publicDSAKey;
|
||||
@property (readonly, copy) NSArray *systemProfile;
|
||||
|
||||
- (id)objectForInfoDictionaryKey:(NSString *)key;
|
||||
- (BOOL)boolForInfoDictionaryKey:(NSString *)key;
|
||||
|
||||
@@ -19,18 +19,20 @@
|
||||
@implementation SUHost
|
||||
@synthesize bundle;
|
||||
|
||||
- (id)initWithBundle:(NSBundle *)aBundle
|
||||
- (instancetype)initWithBundle:(NSBundle *)aBundle
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
if (aBundle == nil) aBundle = [NSBundle mainBundle];
|
||||
self.bundle = aBundle;
|
||||
if (![bundle bundleIdentifier])
|
||||
if (![bundle bundleIdentifier]) {
|
||||
SULog(@"Sparkle Error: the bundle being updated at %@ has no CFBundleIdentifier! This will cause preference read/write to not work properly.", bundle);
|
||||
}
|
||||
|
||||
defaultsDomain = [[bundle objectForInfoDictionaryKey:SUDefaultsDomainKey] retain];
|
||||
if (!defaultsDomain)
|
||||
if (!defaultsDomain) {
|
||||
defaultsDomain = [[bundle bundleIdentifier] retain];
|
||||
}
|
||||
|
||||
// If we're using the main bundle's defaults we'll use the standard user defaults mechanism, otherwise we have to get CF-y.
|
||||
usesStandardUserDefaults = [defaultsDomain isEqualToString:[[NSBundle mainBundle] bundleIdentifier]];
|
||||
@@ -61,8 +63,9 @@
|
||||
SULog(@"Failed to find app support directory! Using ~/Library/Application Support...");
|
||||
appSupportPath = [@"~/Library/Application Support" stringByExpandingTildeInPath];
|
||||
}
|
||||
else
|
||||
appSupportPath = [appSupportPaths objectAtIndex:0];
|
||||
else {
|
||||
appSupportPath = appSupportPaths[0];
|
||||
}
|
||||
appSupportPath = [appSupportPath stringByAppendingPathComponent:[self name]];
|
||||
appSupportPath = [appSupportPath stringByAppendingPathComponent:@".Sparkle"];
|
||||
return appSupportPath;
|
||||
@@ -73,8 +76,9 @@
|
||||
#if NORMALIZE_INSTALLED_APP_NAME
|
||||
// We'll install to "#{CFBundleName}.app", but only if that path doesn't already exist. If we're "Foo 4.2.app," and there's a "Foo.app" in this directory, we don't want to overwrite it! But if there's no "Foo.app," we'll take that name.
|
||||
NSString *normalizedAppPath = [[[bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent: [NSString stringWithFormat: @"%@.%@", [bundle objectForInfoDictionaryKey:@"CFBundleName"], [[bundle bundlePath] pathExtension]]];
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:[[[bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent: [NSString stringWithFormat: @"%@.%@", [bundle objectForInfoDictionaryKey:@"CFBundleName"], [[bundle bundlePath] pathExtension]]]])
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:[[[bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent: [NSString stringWithFormat: @"%@.%@", [bundle objectForInfoDictionaryKey:@"CFBundleName"], [[bundle bundlePath] pathExtension]]]]) {
|
||||
return normalizedAppPath;
|
||||
}
|
||||
#endif
|
||||
return [bundle bundlePath];
|
||||
}
|
||||
@@ -116,8 +120,9 @@
|
||||
// extension, although it may."
|
||||
//
|
||||
// However, if it *does* include the '.icns' the above method fails (tested on OS X 10.3.9) so we'll also try:
|
||||
if (!iconPath)
|
||||
if (!iconPath) {
|
||||
iconPath = [bundle pathForResource:[bundle objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType: nil];
|
||||
}
|
||||
NSImage *icon = [[[NSImage alloc] initWithContentsOfFile:iconPath] autorelease];
|
||||
// Use a default icon if none is defined.
|
||||
if (!icon) {
|
||||
@@ -138,13 +143,7 @@
|
||||
|
||||
- (BOOL)isBackgroundApplication
|
||||
{
|
||||
ProcessSerialNumber PSN;
|
||||
GetCurrentProcess(&PSN);
|
||||
CFDictionaryRef processInfo = ProcessInformationCopyDictionary(&PSN, kProcessDictionaryIncludeAllInformationMask);
|
||||
BOOL isElement = [[(NSDictionary *)processInfo objectForKey:@"LSUIElement"] boolValue];
|
||||
if (processInfo)
|
||||
CFRelease(processInfo);
|
||||
return isElement;
|
||||
return ([[NSApplication sharedApplication] activationPolicy] == NSApplicationActivationPolicyAccessory);
|
||||
}
|
||||
|
||||
- (NSString *)publicDSAKey
|
||||
@@ -180,11 +179,12 @@
|
||||
// Under Tiger, CFPreferencesCopyAppValue doesn't get values from NSRegistrationDomain, so anything
|
||||
// passed into -[NSUserDefaults registerDefaults:] is ignored. The following line falls
|
||||
// back to using NSUserDefaults, but only if the host bundle is the main bundle.
|
||||
if (usesStandardUserDefaults)
|
||||
if (usesStandardUserDefaults) {
|
||||
return [[NSUserDefaults standardUserDefaults] objectForKey:defaultName];
|
||||
}
|
||||
|
||||
CFPropertyListRef obj = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)defaultsDomain);
|
||||
return [(id)CFMakeCollectable(obj) autorelease];
|
||||
return CFBridgingRelease(obj);
|
||||
}
|
||||
|
||||
- (void)setObject:(id)value forUserDefaultsKey:(NSString *)defaultName;
|
||||
@@ -202,13 +202,15 @@
|
||||
|
||||
- (BOOL)boolForUserDefaultsKey:(NSString *)defaultName
|
||||
{
|
||||
if (usesStandardUserDefaults)
|
||||
if (usesStandardUserDefaults) {
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:defaultName];
|
||||
}
|
||||
|
||||
BOOL value;
|
||||
CFPropertyListRef plr = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)defaultsDomain);
|
||||
if (plr == NULL)
|
||||
if (plr == NULL) {
|
||||
value = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = (BOOL)CFBooleanGetValue((CFBooleanRef)plr);
|
||||
@@ -225,7 +227,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
CFPreferencesSetValue((CFStringRef)defaultName, (CFBooleanRef)[NSNumber numberWithBool:value], (CFStringRef)defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
CFPreferencesSetValue((CFStringRef)defaultName, (CFBooleanRef)@(value), (CFStringRef)defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
CFPreferencesSynchronize((CFStringRef)defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
}
|
||||
}
|
||||
@@ -240,24 +242,8 @@
|
||||
|
||||
+ (NSString *)systemVersionString
|
||||
{
|
||||
// This returns a version string of the form X.Y.Z
|
||||
// There may be a better way to deal with the problem that gestaltSystemVersionMajor
|
||||
// et al. are not defined in 10.3, but this is probably good enough.
|
||||
NSString* verStr = nil;
|
||||
SInt32 major, minor, bugfix;
|
||||
OSErr err1 = Gestalt(gestaltSystemVersionMajor, &major);
|
||||
OSErr err2 = Gestalt(gestaltSystemVersionMinor, &minor);
|
||||
OSErr err3 = Gestalt(gestaltSystemVersionBugFix, &bugfix);
|
||||
if (!err1 && !err2 && !err3)
|
||||
{
|
||||
verStr = [NSString stringWithFormat:@"%ld.%ld.%ld", (long)major, (long)minor, (long)bugfix];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *versionPlistPath = @"/System/Library/CoreServices/SystemVersion.plist";
|
||||
verStr = [[NSDictionary dictionaryWithContentsOfFile:versionPlistPath] objectForKey:@"ProductVersion"];
|
||||
}
|
||||
return verStr;
|
||||
NSString *versionPlistPath = @"/System/Library/CoreServices/SystemVersion.plist";
|
||||
return [NSDictionary dictionaryWithContentsOfFile:versionPlistPath][@"ProductVersion"];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -18,7 +18,6 @@
|
||||
+ (void) installFromUpdateFolder:(NSString *)updateFolder overHost:(SUHost *)host installationPath:(NSString *)installationPath delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator;
|
||||
+ (void) finishInstallationToPath:(NSString *)installationPath withResult:(BOOL)result host:(SUHost *)host error:(NSError *)error delegate:delegate;
|
||||
+ (NSString*) updateFolder;
|
||||
+ (void) notifyDelegateOfFailure: (NSDictionary*)dict;
|
||||
@end
|
||||
|
||||
@interface NSObject (SUInstallerDelegateInformalProtocol)
|
||||
|
||||
+13
-13
@@ -124,7 +124,7 @@ static NSString* sUpdateFolder = nil;
|
||||
|
||||
if (newAppDownloadPath == nil)
|
||||
{
|
||||
[self finishInstallationToPath:installationPath withResult:NO host:host error:[NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingUpdateError userInfo:[NSDictionary dictionaryWithObject:@"Couldn't find an appropriate update in the downloaded package." forKey:NSLocalizedDescriptionKey]] delegate:delegate];
|
||||
[self finishInstallationToPath:installationPath withResult:NO host:host error:[NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingUpdateError userInfo:@{NSLocalizedDescriptionKey: @"Couldn't find an appropriate update in the downloaded package."}] delegate:delegate];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -140,7 +140,7 @@ static NSString* sUpdateFolder = nil;
|
||||
|
||||
NSTask *mdimport = [[[NSTask alloc] init] autorelease];
|
||||
[mdimport setLaunchPath:@"/usr/bin/mdimport"];
|
||||
[mdimport setArguments:[NSArray arrayWithObject:installationPath]];
|
||||
[mdimport setArguments:@[installationPath]];
|
||||
@try
|
||||
{
|
||||
[mdimport launch];
|
||||
@@ -163,20 +163,20 @@ static NSString* sUpdateFolder = nil;
|
||||
if (result)
|
||||
{
|
||||
[self mdimportInstallationPath:installationPath];
|
||||
if ([delegate respondsToSelector:@selector(installerFinishedForHost:)])
|
||||
[delegate performSelectorOnMainThread: @selector(installerFinishedForHost:) withObject: host waitUntilDone: NO];
|
||||
if ([delegate respondsToSelector:@selector(installerFinishedForHost:)]) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[delegate installerFinishedForHost:host];
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(installerForHost:failedWithError:)])
|
||||
[self performSelectorOnMainThread: @selector(notifyDelegateOfFailure:) withObject: [NSDictionary dictionaryWithObjectsAndKeys: host, SUNotifyDictHostKey, error, SUNotifyDictErrorKey, delegate, SUNotifyDictDelegateKey, nil] waitUntilDone: NO];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+(void) notifyDelegateOfFailure: (NSDictionary*)dict
|
||||
{
|
||||
[[dict objectForKey: SUNotifyDictDelegateKey] installerForHost: [dict objectForKey: SUNotifyDictHostKey] failedWithError: [dict objectForKey: SUNotifyDictErrorKey]];
|
||||
if ([delegate respondsToSelector:@selector(installerForHost:failedWithError:)]) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[delegate installerForHost:host failedWithError:error];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>iMac4,1</key>
|
||||
<string>iMac (Core Duo)</string>
|
||||
<key>iMac4,2</key>
|
||||
<string>iMac for Education (17-inch, Core Duo)</string>
|
||||
<string>iMac for Education (17 inch, Core Duo)</string>
|
||||
<key>iMac5,1</key>
|
||||
<string>iMac (Core 2 Duo, 17 or 20 inch, SuperDrive)</string>
|
||||
<key>iMac5,2</key>
|
||||
@@ -17,19 +17,65 @@
|
||||
<key>iMac6,1</key>
|
||||
<string>iMac (Core 2 Duo, 24 inch, SuperDrive)</string>
|
||||
<key>iMac8,1</key>
|
||||
<string>iMac (April 2008)</string>
|
||||
<string>iMac (Core 2 Duo, 20 or 24 inch, Early 2008 )</string>
|
||||
<key>iMac9,1</key>
|
||||
<string>iMac (Core 2 Duo, 20 or 24 inch, Early or Mid 2009 )</string>
|
||||
<key>iMac10,1</key>
|
||||
<string>iMac (Core 2 Duo, 21.5 or 27 inch, Late 2009 )</string>
|
||||
<key>iMac11,1</key>
|
||||
<string>iMac (Core i5 or i7, 27 inch Late 2009)</string>
|
||||
<key>iMac11,2</key>
|
||||
<string>iMac (Core i3 or i5, 27 inch Mid 2010)</string>
|
||||
<key>iMac11,3</key>
|
||||
<string>iMac (Core i5 or i7, 27 inch Mid 2010)</string>
|
||||
<key>iMac12,1</key>
|
||||
<string>iMac (Core i3 or i5 or i7, 21.5 inch Mid 2010 or Late 2011)</string>
|
||||
<key>iMac12,2</key>
|
||||
<string>iMac (Core i5 or i7, 27 inch Mid 2011)</string>
|
||||
<key>iMac13,1</key>
|
||||
<string>iMac (Core i3 or i5 or i7, 21.5 inch Late 2012 or Early 2013)</string>
|
||||
<key>iMac13,2</key>
|
||||
<string>iMac (Core i5 or i7, 27 inch Late 2012)</string>
|
||||
<key>iMac14,1</key>
|
||||
<string>iMac (Core i5, 21.5 inch Late 2013)</string>
|
||||
<key>iMac14,2</key>
|
||||
<string>iMac (Core i5 or i7, 27 inch Late 2013)</string>
|
||||
<key>iMac14,3</key>
|
||||
<string>iMac (Core i5 or i7, 21.5 inch Late 2013)</string>
|
||||
<key>MacBook1,1</key>
|
||||
<string>MacBook (Core Duo)</string>
|
||||
<key>MacBook2,1</key>
|
||||
<string>MacBook (Core 2 Duo)</string>
|
||||
<key>MacBook4,1</key>
|
||||
<string>MacBook (Core 2 Duo Feb 2008)</string>
|
||||
<key>MacBook5,1</key>
|
||||
<string>MacBook (Core 2 Duo, Late 2008, Unibody)</string>
|
||||
<key>MacBook5,2</key>
|
||||
<string>MacBook (Core 2 Duo, Early 2009, White)</string>
|
||||
<key>MacBook6,1</key>
|
||||
<string>MacBook (Core 2 Duo, Late 2009, Unibody)</string>
|
||||
<key>MacBook7,1</key>
|
||||
<string>MacBook (Core 2 Duo, Mid 2010, White)</string>
|
||||
<key>MacBookAir1,1</key>
|
||||
<string>MacBook Air (January 2008)</string>
|
||||
<string>MacBook Air (Core 2 Duo, 13 inch, Early 2008)</string>
|
||||
<key>MacBookAir2,1</key>
|
||||
<string>MacBook Air (June 2009)</string>
|
||||
<string>MacBook Air (Core 2 Duo, 13 inch, Mid 2009)</string>
|
||||
<key>MacBookAir3,1</key>
|
||||
<string>MacBook Air (October 2010)</string>
|
||||
<string>MacBook Air (Core 2 Duo, 11 inch, Late 2010)</string>
|
||||
<key>MacBookAir3,2</key>
|
||||
<string>MacBook Air (Core 2 Duo, 13 inch, Late 2010)</string>
|
||||
<key>MacBookAir4,1</key>
|
||||
<string>MacBook Air (Core i5 or i7, 11 inch, Mid 2011)</string>
|
||||
<key>MacBookAir4,2</key>
|
||||
<string>MacBook Air (Core i5 or i7, 13 inch, Mid 2011)</string>
|
||||
<key>MacBookAir5,1</key>
|
||||
<string>MacBook Air (Core i5 or i7, 11 inch, Mid 2012)</string>
|
||||
<key>MacBookAir5,2</key>
|
||||
<string>MacBook Air (Core i5 or i7, 13 inch, Mid 2012)</string>
|
||||
<key>MacBookAir6,1</key>
|
||||
<string>MacBook Air (Core i5 or i7, 11 inch, Mid 2013 or Early 2014)</string>
|
||||
<key>MacBookAir6,2</key>
|
||||
<string>MacBook Air (Core i5 or i7, 13 inch, Mid 2013 or Early 2014)</string>
|
||||
<key>MacBookPro1,1</key>
|
||||
<string>MacBook Pro Core Duo (15-inch)</string>
|
||||
<key>MacBookPro1,2</key>
|
||||
|
||||
+18
-15
@@ -20,20 +20,20 @@ NSString *SUPackageInstallerInstallationPathKey = @"SUPackageInstallerInstallati
|
||||
|
||||
+ (void)finishInstallationWithInfo:(NSDictionary *)info
|
||||
{
|
||||
[self finishInstallationToPath:[info objectForKey:SUPackageInstallerInstallationPathKey] withResult:YES host:[info objectForKey:SUPackageInstallerHostKey] error:nil delegate:[info objectForKey:SUPackageInstallerDelegateKey]];
|
||||
[self finishInstallationToPath:info[SUPackageInstallerInstallationPathKey] withResult:YES host:info[SUPackageInstallerHostKey] error:nil delegate:info[SUPackageInstallerDelegateKey]];
|
||||
}
|
||||
|
||||
+ (void)performInstallationWithInfo:(NSDictionary *)info
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSTask *installer = [NSTask launchedTaskWithLaunchPath:[info objectForKey:SUPackageInstallerCommandKey] arguments:[info objectForKey:SUPackageInstallerArgumentsKey]];
|
||||
[installer waitUntilExit];
|
||||
|
||||
// Known bug: if the installation fails or is canceled, Sparkle goes ahead and restarts, thinking everything is fine.
|
||||
[self performSelectorOnMainThread:@selector(finishInstallationWithInfo:) withObject:info waitUntilDone:NO];
|
||||
|
||||
[pool drain];
|
||||
@autoreleasepool {
|
||||
NSTask *installer = [NSTask launchedTaskWithLaunchPath:info[SUPackageInstallerCommandKey] arguments:info[SUPackageInstallerArgumentsKey]];
|
||||
[installer waitUntilExit];
|
||||
|
||||
// Known bug: if the installation fails or is canceled, Sparkle goes ahead and restarts, thinking everything is fine.
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self finishInstallationWithInfo:info];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)performInstallationToPath:(NSString *)installationPath fromPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator
|
||||
@@ -46,20 +46,23 @@ NSString *SUPackageInstallerInstallationPathKey = @"SUPackageInstallerInstallati
|
||||
// -n = Open another instance if already open.
|
||||
// -b = app bundle identifier
|
||||
command = @"/usr/bin/open";
|
||||
args = [NSArray arrayWithObjects:@"-W", @"-n", @"-b", @"com.apple.installer", path, nil];
|
||||
args = @[@"-W", @"-n", @"-b", @"com.apple.installer", path];
|
||||
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:command])
|
||||
{
|
||||
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingInstallerToolError userInfo:[NSDictionary dictionaryWithObject:@"Couldn't find Apple's installer tool!" forKey:NSLocalizedDescriptionKey]];
|
||||
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingInstallerToolError userInfo:@{NSLocalizedDescriptionKey: @"Couldn't find Apple's installer tool!"}];
|
||||
[self finishInstallationToPath:installationPath withResult:NO host:host error:error delegate:delegate];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:command, SUPackageInstallerCommandKey, args, SUPackageInstallerArgumentsKey, host, SUPackageInstallerHostKey, delegate, SUPackageInstallerDelegateKey, installationPath, SUPackageInstallerInstallationPathKey, nil];
|
||||
NSDictionary *info = @{SUPackageInstallerCommandKey: command, SUPackageInstallerArgumentsKey: args, SUPackageInstallerHostKey: host, SUPackageInstallerDelegateKey: delegate, SUPackageInstallerInstallationPathKey: installationPath};
|
||||
if (synchronously)
|
||||
[self performInstallationWithInfo:info];
|
||||
else
|
||||
[NSThread detachNewThreadSelector:@selector(performInstallationWithInfo:) toTarget:self withObject:info];
|
||||
else {
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[self performInstallationWithInfo:info];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+60
-55
@@ -17,16 +17,16 @@
|
||||
{
|
||||
static NSDictionary *typeSelectorDictionary;
|
||||
if (!typeSelectorDictionary)
|
||||
typeSelectorDictionary = [[NSDictionary dictionaryWithObjectsAndKeys:@"extractZIP", @".zip", @"extractTAR", @".tar",
|
||||
@"extractTGZ", @".tar.gz", @"extractTGZ", @".tgz",
|
||||
@"extractTBZ", @".tar.bz2", @"extractTBZ", @".tbz", nil] retain];
|
||||
typeSelectorDictionary = [@{@".zip": @"extractZIP", @".tar": @"extractTAR",
|
||||
@".tar.gz": @"extractTGZ", @".tgz": @"extractTGZ",
|
||||
@".tar.bz2": @"extractTBZ", @".tbz": @"extractTBZ"} retain];
|
||||
|
||||
NSString *lastPathComponent = [path lastPathComponent];
|
||||
for (id currentType in typeSelectorDictionary)
|
||||
{
|
||||
if ([currentType length] > [lastPathComponent length]) continue;
|
||||
if ([[lastPathComponent substringFromIndex:[lastPathComponent length] - [currentType length]] isEqualToString:currentType])
|
||||
return NSSelectorFromString([typeSelectorDictionary objectForKey:currentType]);
|
||||
return NSSelectorFromString(typeSelectorDictionary[currentType]);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -45,61 +45,66 @@
|
||||
- (void)extractArchivePipingDataToCommand:(NSString *)command
|
||||
{
|
||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
||||
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
FILE *fp = NULL, *cmdFP = NULL;
|
||||
char *oldDestinationString = NULL;
|
||||
|
||||
SULog(@"Extracting %@ using '%@'",archivePath,command);
|
||||
|
||||
// Get the file size.
|
||||
NSNumber *fs = [[[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:nil] objectForKey:NSFileSize];
|
||||
if (fs == nil) goto reportError;
|
||||
|
||||
// Thank you, Allan Odgaard!
|
||||
// (who wrote the following extraction alg.)
|
||||
fp = fopen([archivePath fileSystemRepresentation], "r");
|
||||
if (!fp) goto reportError;
|
||||
|
||||
oldDestinationString = getenv("DESTINATION");
|
||||
setenv("DESTINATION", [[archivePath stringByDeletingLastPathComponent] fileSystemRepresentation], 1);
|
||||
cmdFP = popen([command fileSystemRepresentation], "w");
|
||||
size_t written;
|
||||
if (!cmdFP) goto reportError;
|
||||
|
||||
char buf[32*1024];
|
||||
size_t len;
|
||||
while((len = fread(buf, 1, 32*1024, fp)))
|
||||
{
|
||||
written = fwrite(buf, 1, len, cmdFP);
|
||||
if( written < len )
|
||||
@autoreleasepool {
|
||||
FILE *fp = NULL, *cmdFP = NULL;
|
||||
char *oldDestinationString = NULL;
|
||||
|
||||
SULog(@"Extracting %@ using '%@'",archivePath,command);
|
||||
|
||||
// Get the file size.
|
||||
NSNumber *fs = [[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:nil][NSFileSize];
|
||||
if (fs == nil) goto reportError;
|
||||
|
||||
// Thank you, Allan Odgaard!
|
||||
// (who wrote the following extraction alg.)
|
||||
fp = fopen([archivePath fileSystemRepresentation], "r");
|
||||
if (!fp) goto reportError;
|
||||
|
||||
oldDestinationString = getenv("DESTINATION");
|
||||
setenv("DESTINATION", [[archivePath stringByDeletingLastPathComponent] fileSystemRepresentation], 1);
|
||||
cmdFP = popen([command fileSystemRepresentation], "w");
|
||||
size_t written;
|
||||
if (!cmdFP) goto reportError;
|
||||
|
||||
char buf[32*1024];
|
||||
size_t len;
|
||||
while((len = fread(buf, 1, 32*1024, fp)))
|
||||
{
|
||||
pclose(cmdFP);
|
||||
written = fwrite(buf, 1, len, cmdFP);
|
||||
if( written < len )
|
||||
{
|
||||
pclose(cmdFP);
|
||||
goto reportError;
|
||||
}
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self notifyDelegateOfExtractedLength:len];
|
||||
});
|
||||
}
|
||||
pclose(cmdFP);
|
||||
|
||||
if (ferror(fp)) {
|
||||
goto reportError;
|
||||
}
|
||||
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfExtractedLength:) withObject:[NSNumber numberWithUnsignedLong:len] waitUntilDone:NO];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self notifyDelegateOfSuccess];
|
||||
});
|
||||
goto finally;
|
||||
|
||||
reportError:
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self notifyDelegateOfFailure];
|
||||
});
|
||||
|
||||
finally:
|
||||
if (fp)
|
||||
fclose(fp);
|
||||
if (oldDestinationString)
|
||||
setenv("DESTINATION", oldDestinationString, 1);
|
||||
else
|
||||
unsetenv("DESTINATION");
|
||||
}
|
||||
pclose(cmdFP);
|
||||
|
||||
if( ferror( fp ) )
|
||||
goto reportError;
|
||||
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfSuccess) withObject:nil waitUntilDone:NO];
|
||||
goto finally;
|
||||
|
||||
reportError:
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfFailure) withObject:nil waitUntilDone:NO];
|
||||
|
||||
finally:
|
||||
if (fp)
|
||||
fclose(fp);
|
||||
if (oldDestinationString)
|
||||
setenv("DESTINATION", oldDestinationString, 1);
|
||||
else
|
||||
unsetenv("DESTINATION");
|
||||
[pool release];
|
||||
}
|
||||
|
||||
- (void)extractTAR
|
||||
|
||||
+30
-27
@@ -26,36 +26,36 @@ static NSString * const SUInstallerInstallationPathKey = @"SUInstallerInstallati
|
||||
{
|
||||
// *** GETS CALLED ON NON-MAIN THREAD!
|
||||
|
||||
[self finishInstallationToPath:[info objectForKey:SUInstallerInstallationPathKey] withResult:[[info objectForKey:SUInstallerResultKey] boolValue] host:[info objectForKey:SUInstallerHostKey] error:[info objectForKey:SUInstallerErrorKey] delegate:[info objectForKey:SUInstallerDelegateKey]];
|
||||
[self finishInstallationToPath:info[SUInstallerInstallationPathKey] withResult:[info[SUInstallerResultKey] boolValue] host:info[SUInstallerHostKey] error:info[SUInstallerErrorKey] delegate:info[SUInstallerDelegateKey]];
|
||||
}
|
||||
|
||||
+ (void)performInstallationWithInfo:(NSDictionary *)info
|
||||
{
|
||||
// *** GETS CALLED ON NON-MAIN THREAD!
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSError *error = nil;
|
||||
|
||||
NSString * oldPath = [[info objectForKey:SUInstallerHostKey] bundlePath];
|
||||
NSString * installationPath = [info objectForKey:SUInstallerInstallationPathKey];
|
||||
BOOL result = [self copyPathWithAuthentication:[info objectForKey:SUInstallerPathKey] overPath: installationPath temporaryName:[info objectForKey:SUInstallerTempNameKey] error:&error];
|
||||
|
||||
if( result )
|
||||
{
|
||||
BOOL haveOld = [[NSFileManager defaultManager] fileExistsAtPath: oldPath];
|
||||
BOOL differentFromNew = ![oldPath isEqualToString: installationPath];
|
||||
if( haveOld && differentFromNew )
|
||||
[self _movePathToTrash: oldPath]; // On success, trash old copy if there's still one due to renaming.
|
||||
@autoreleasepool {
|
||||
NSError *error = nil;
|
||||
|
||||
NSString * oldPath = [info[SUInstallerHostKey] bundlePath];
|
||||
NSString * installationPath = info[SUInstallerInstallationPathKey];
|
||||
BOOL result = [self copyPathWithAuthentication:info[SUInstallerPathKey] overPath: installationPath temporaryName:info[SUInstallerTempNameKey] error:&error];
|
||||
|
||||
if( result )
|
||||
{
|
||||
BOOL haveOld = [[NSFileManager defaultManager] fileExistsAtPath: oldPath];
|
||||
BOOL differentFromNew = ![oldPath isEqualToString: installationPath];
|
||||
if( haveOld && differentFromNew )
|
||||
[self _movePathToTrash: oldPath]; // On success, trash old copy if there's still one due to renaming.
|
||||
}
|
||||
NSMutableDictionary *mutableInfo = [[info mutableCopy] autorelease];
|
||||
mutableInfo[SUInstallerResultKey] = @(result);
|
||||
mutableInfo[SUInstallerInstallationPathKey] = installationPath;
|
||||
if (!result && error)
|
||||
mutableInfo[SUInstallerErrorKey] = error;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self finishInstallationWithInfo:mutableInfo];
|
||||
});
|
||||
}
|
||||
NSMutableDictionary *mutableInfo = [[info mutableCopy] autorelease];
|
||||
[mutableInfo setObject:[NSNumber numberWithBool:result] forKey:SUInstallerResultKey];
|
||||
[mutableInfo setObject:installationPath forKey:SUInstallerInstallationPathKey];
|
||||
if (!result && error)
|
||||
[mutableInfo setObject:error forKey:SUInstallerErrorKey];
|
||||
[self performSelectorOnMainThread:@selector(finishInstallationWithInfo:) withObject:mutableInfo waitUntilDone:NO];
|
||||
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
+ (void)performInstallationToPath:(NSString *)installationPath fromPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator
|
||||
@@ -65,7 +65,7 @@ static NSString * const SUInstallerInstallationPathKey = @"SUInstallerInstallati
|
||||
if ([comparator compareVersion:[host version] toVersion:[[NSBundle bundleWithPath:path] objectForInfoDictionaryKey:@"CFBundleVersion"]] == NSOrderedDescending)
|
||||
{
|
||||
NSString * errorMessage = [NSString stringWithFormat:@"Sparkle Updater: Possible attack in progress! Attempting to \"upgrade\" from %@ to %@. Aborting update.", [host version], [[NSBundle bundleWithPath:path] objectForInfoDictionaryKey:@"CFBundleVersion"]];
|
||||
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUDowngradeError userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]];
|
||||
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUDowngradeError userInfo:@{NSLocalizedDescriptionKey: errorMessage}];
|
||||
[self finishInstallationToPath:installationPath withResult:NO host:host error:error delegate:delegate];
|
||||
return;
|
||||
}
|
||||
@@ -73,11 +73,14 @@ static NSString * const SUInstallerInstallationPathKey = @"SUInstallerInstallati
|
||||
|
||||
NSString *targetPath = [host installationPath];
|
||||
NSString *tempName = [self temporaryNameForPath:targetPath];
|
||||
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:path, SUInstallerPathKey, targetPath, SUInstallerTargetPathKey, tempName, SUInstallerTempNameKey, host, SUInstallerHostKey, delegate, SUInstallerDelegateKey, installationPath, SUInstallerInstallationPathKey, nil];
|
||||
NSDictionary *info = @{SUInstallerPathKey: path, SUInstallerTargetPathKey: targetPath, SUInstallerTempNameKey: tempName, SUInstallerHostKey: host, SUInstallerDelegateKey: delegate, SUInstallerInstallationPathKey: installationPath};
|
||||
if (synchronously)
|
||||
[self performInstallationWithInfo:info];
|
||||
else
|
||||
[NSThread detachNewThreadSelector:@selector(performInstallationWithInfo:) toTarget:self withObject:info];
|
||||
else {
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[self performInstallationWithInfo:info];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
+34
-17
@@ -23,6 +23,14 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
static inline void PerformOnMainThreadSync(dispatch_block_t theBlock)
|
||||
{
|
||||
if ([NSThread isMainThread]) {
|
||||
theBlock();
|
||||
} else {
|
||||
dispatch_sync(dispatch_get_main_queue(), theBlock);
|
||||
}
|
||||
}
|
||||
|
||||
@interface SUPlainInstaller (MMExtendedAttributes)
|
||||
// Removes the directory tree rooted at |root| from the file quarantine.
|
||||
@@ -136,8 +144,9 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
[validCharacters formUnionWithCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@".-()"]];
|
||||
postFix = [version stringByTrimmingCharactersInSet:[validCharacters invertedSet]];
|
||||
}
|
||||
else
|
||||
else {
|
||||
postFix = @"old";
|
||||
}
|
||||
NSString *prefix = [NSString stringWithFormat: @"%@ (%@)", [[path lastPathComponent] stringByDeletingPathExtension], postFix];
|
||||
#else
|
||||
NSString *prefix = [[path lastPathComponent] stringByDeletingPathExtension];
|
||||
@@ -147,8 +156,9 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
|
||||
// Now let's make sure we get a unique path.
|
||||
int cnt=2;
|
||||
while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt <= 9999)
|
||||
while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt <= 9999) {
|
||||
tempDir = [[tempDir stringByDeletingLastPathComponent] stringByAppendingPathComponent: [NSString stringWithFormat:@"%@ %d.%@", prefix, cnt++, [path pathExtension]]];
|
||||
}
|
||||
|
||||
return tempDir;
|
||||
}
|
||||
@@ -169,7 +179,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
{
|
||||
NSString *errorMessage = [NSString stringWithFormat:@"Stat on %@ during authenticated file copy failed.", dst];
|
||||
if (error != NULL)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:@{NSLocalizedDescriptionKey: errorMessage}];
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
@@ -206,7 +216,9 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
if (res)
|
||||
{
|
||||
SULog(@"releaseFromQuarantine");
|
||||
[self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:src waitUntilDone:YES];
|
||||
PerformOnMainThreadSync(^{
|
||||
[self releaseFromQuarantine:src];
|
||||
});
|
||||
}
|
||||
|
||||
if( res ) // Set permissions while it's still in source, so we have it with working and correct perms when it arrives at destination.
|
||||
@@ -262,7 +274,9 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
if (res)
|
||||
{
|
||||
SULog(@"releaseFromQuarantine after installing");
|
||||
[self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:dst waitUntilDone:YES];
|
||||
PerformOnMainThreadSync(^{
|
||||
[self releaseFromQuarantine:dst];
|
||||
});
|
||||
}
|
||||
|
||||
if (!res)
|
||||
@@ -270,13 +284,13 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
// Something went wrong somewhere along the way, but we're not sure exactly where.
|
||||
NSString *errorMessage = [NSString stringWithFormat:@"Authenticated file copy from %@ to %@ failed.", src, dst];
|
||||
if (error != nil)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{NSLocalizedDescriptionKey: errorMessage}];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (error != nil)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:@"Couldn't get permission to authenticate." forKey:NSLocalizedDescriptionKey]];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{NSLocalizedDescriptionKey: @"Couldn't get permission to authenticate."}];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -343,13 +357,13 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
// Something went wrong somewhere along the way, but we're not sure exactly where.
|
||||
NSString *errorMessage = [NSString stringWithFormat:@"Authenticated file move from %@ to %@ failed.", src, dst];
|
||||
if (error != NULL)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{NSLocalizedDescriptionKey: errorMessage}];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (error != NULL)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:@"Couldn't get permission to authenticate." forKey:NSLocalizedDescriptionKey]];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{NSLocalizedDescriptionKey: @"Couldn't get permission to authenticate."}];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -391,13 +405,13 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
// Something went wrong somewhere along the way, but we're not sure exactly where.
|
||||
NSString *errorMessage = [NSString stringWithFormat:@"Authenticated file remove from %@ failed.", src];
|
||||
if (error != NULL)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{NSLocalizedDescriptionKey: errorMessage}];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (error != NULL)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:@"Couldn't get permission to authenticate." forKey:NSLocalizedDescriptionKey]];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{NSLocalizedDescriptionKey: @"Couldn't get permission to authenticate."}];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -417,7 +431,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
{
|
||||
//SULog(@"Moving %@ to the trash.", path);
|
||||
NSInteger tag = 0;
|
||||
if (![[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[path stringByDeletingLastPathComponent] destination:@"" files:[NSArray arrayWithObject:[path lastPathComponent]] tag:&tag])
|
||||
if (![[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[path stringByDeletingLastPathComponent] destination:@"" files:@[[path lastPathComponent]] tag:&tag])
|
||||
{
|
||||
BOOL didFindTrash = NO;
|
||||
NSString* trashPath = [self _temporaryCopyNameForPath: path didFindTrash: &didFindTrash];
|
||||
@@ -476,7 +490,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
if (!success && hadFileAtDest)
|
||||
{
|
||||
if (error != NULL)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath]}];
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
@@ -489,10 +503,11 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
if (!success)
|
||||
{
|
||||
// We better move the old version back to its old location
|
||||
if( hadFileAtDest )
|
||||
if (hadFileAtDest) {
|
||||
success = [manager moveItemAtPath:tmpPath toPath:dst error:error];
|
||||
}
|
||||
if (!success && error != NULL)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath]}];
|
||||
return NO;
|
||||
|
||||
}
|
||||
@@ -507,7 +522,9 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
// new home in case it's moved across filesystems: if that
|
||||
// happens, the move is actually a copy, and it may result
|
||||
// in the application being quarantined.
|
||||
[self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:dst waitUntilDone:YES];
|
||||
PerformOnMainThreadSync(^{
|
||||
[self releaseFromQuarantine:dst];
|
||||
});
|
||||
|
||||
return YES;
|
||||
}
|
||||
@@ -556,7 +573,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
// Only recurse if it's actually a directory. Don't recurse into a
|
||||
// root-level symbolic link.
|
||||
NSDictionary* rootAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:root error:nil];
|
||||
NSString* rootType = [rootAttributes objectForKey:NSFileType];
|
||||
NSString* rootType = rootAttributes[NSFileType];
|
||||
|
||||
if (rootType == NSFileTypeDirectory) {
|
||||
// The NSDirectoryEnumerator will avoid recursing into any contained
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#import "SUBasicUpdateDriver.h"
|
||||
|
||||
// This replaces the old SUStatusChecker.
|
||||
@interface SUProbingUpdateDriver : SUBasicUpdateDriver { }
|
||||
@interface SUProbingUpdateDriver : SUBasicUpdateDriver
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -24,8 +24,9 @@
|
||||
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
||||
[[updater delegate] updaterDidNotFindUpdate:updater];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:updater];
|
||||
|
||||
[self abortUpdate];
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
||||
[[updater delegate] updaterDidNotFindUpdate:updater];
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:updater];
|
||||
|
||||
[self abortUpdate]; // Don't tell the user that no update was found; this was a scheduled update.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
@abstract Sparkle's default version comparator.
|
||||
@discussion This comparator is adapted from MacPAD, by Kevin Ballard. It's "dumb" in that it does essentially string comparison, in components split by character type.
|
||||
*/
|
||||
@interface SUStandardVersionComparator : NSObject <SUVersionComparison> { }
|
||||
@interface SUStandardVersionComparator : NSObject <SUVersionComparison>
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
+ (SUStandardVersionComparator *)defaultComparator
|
||||
{
|
||||
static SUStandardVersionComparator *defaultComparator = nil;
|
||||
if (defaultComparator == nil)
|
||||
if (defaultComparator == nil) {
|
||||
defaultComparator = [[SUStandardVersionComparator alloc] init];
|
||||
}
|
||||
return defaultComparator;
|
||||
}
|
||||
|
||||
@@ -90,8 +91,8 @@ typedef enum {
|
||||
|
||||
n = MIN([partsA count], [partsB count]);
|
||||
for (i = 0; i < n; ++i) {
|
||||
partA = [partsA objectAtIndex:i];
|
||||
partB = [partsB objectAtIndex:i];
|
||||
partA = partsA[i];
|
||||
partB = partsB[i];
|
||||
|
||||
typeA = [self typeOfCharacter:partA];
|
||||
typeB = [self typeOfCharacter:partB];
|
||||
@@ -141,11 +142,11 @@ typedef enum {
|
||||
NSComparisonResult shorterResult, largerResult;
|
||||
|
||||
if ([partsA count] > [partsB count]) {
|
||||
missingPart = [partsA objectAtIndex:n];
|
||||
missingPart = partsA[n];
|
||||
shorterResult = NSOrderedAscending;
|
||||
largerResult = NSOrderedDescending;
|
||||
} else {
|
||||
missingPart = [partsB objectAtIndex:n];
|
||||
missingPart = partsB[n];
|
||||
shorterResult = NSOrderedDescending;
|
||||
largerResult = NSOrderedAscending;
|
||||
}
|
||||
|
||||
@@ -13,21 +13,15 @@
|
||||
|
||||
@class SUHost;
|
||||
@interface SUStatusController : SUWindowController
|
||||
{
|
||||
@private
|
||||
double progressValue, maxProgressValue;
|
||||
NSString *title, *statusText, *buttonTitle;
|
||||
IBOutlet NSButton *actionButton;
|
||||
IBOutlet NSProgressIndicator* progressBar;
|
||||
SUHost *host;
|
||||
}
|
||||
@property (assign) IBOutlet NSButton *actionButton;
|
||||
@property (assign) IBOutlet NSProgressIndicator* progressBar;
|
||||
|
||||
@property (copy) NSString *statusText;
|
||||
@property double progressValue;
|
||||
@property (nonatomic) double maxProgressValue;
|
||||
@property (getter = isButtonEnabled) BOOL buttonEnabled;
|
||||
|
||||
- (id)initWithHost:(SUHost *)host;
|
||||
- (instancetype)initWithHost:(SUHost *)host;
|
||||
|
||||
// Pass 0 for the max progress value to get an indeterminate progress bar.
|
||||
// Pass nil for the status text to not show it.
|
||||
|
||||
@@ -26,8 +26,10 @@
|
||||
@synthesize title;
|
||||
@synthesize buttonTitle;
|
||||
@synthesize host;
|
||||
@synthesize actionButton;
|
||||
@synthesize progressBar;
|
||||
|
||||
- (id)initWithHost:(SUHost *)aHost
|
||||
- (instancetype)initWithHost:(SUHost *)aHost
|
||||
{
|
||||
self = [super initWithHost:aHost windowNibName:@"SUStatus"];
|
||||
if (self)
|
||||
|
||||
+44
-28
@@ -16,8 +16,9 @@
|
||||
+ (SUSystemProfiler *)sharedSystemProfiler
|
||||
{
|
||||
static SUSystemProfiler *sharedSystemProfiler = nil;
|
||||
if (!sharedSystemProfiler)
|
||||
if (!sharedSystemProfiler) {
|
||||
sharedSystemProfiler = [[self alloc] init];
|
||||
}
|
||||
return sharedSystemProfiler;
|
||||
}
|
||||
|
||||
@@ -33,15 +34,16 @@
|
||||
|
||||
// Gather profile information and append it to the URL.
|
||||
NSMutableArray *profileArray = [NSMutableArray array];
|
||||
NSArray *profileDictKeys = [NSArray arrayWithObjects:@"key", @"displayKey", @"value", @"displayValue", nil];
|
||||
NSArray *profileDictKeys = @[@"key", @"displayKey", @"value", @"displayValue"];
|
||||
int error = 0;
|
||||
int value = 0;
|
||||
size_t length = sizeof(value);
|
||||
|
||||
// OS version
|
||||
NSString *currentSystemVersion = [SUHost systemVersionString];
|
||||
if (currentSystemVersion != nil)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"osVersion",@"OS Version",currentSystemVersion,currentSystemVersion,nil] forKeys:profileDictKeys]];
|
||||
if (currentSystemVersion != nil) {
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"osVersion",@"OS Version",currentSystemVersion,currentSystemVersion] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// CPU type (decoder info for values found here is in mach/machine.h)
|
||||
error = sysctlbyname("hw.cputype", &value, &length, NULL, 0);
|
||||
@@ -54,25 +56,28 @@
|
||||
case CPU_TYPE_POWERPC: visibleCPUType = @"PowerPC"; break;
|
||||
default: visibleCPUType = @"Unknown"; break;
|
||||
}
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cputype",@"CPU Type", [NSNumber numberWithInt:value], visibleCPUType,nil] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"cputype",@"CPU Type", @(value), visibleCPUType] forKeys:profileDictKeys]];
|
||||
}
|
||||
error = sysctlbyname("hw.cpu64bit_capable", &value, &length, NULL, 0);
|
||||
if(error != 0)
|
||||
if (error != 0) {
|
||||
error = sysctlbyname("hw.optional.x86_64", &value, &length, NULL, 0); //x86 specific
|
||||
if(error != 0)
|
||||
}
|
||||
if (error != 0) {
|
||||
error = sysctlbyname("hw.optional.64bitops", &value, &length, NULL, 0); //PPC specific
|
||||
}
|
||||
|
||||
BOOL is64bit = NO;
|
||||
|
||||
if (error == 0) {
|
||||
is64bit = value == 1;
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpu64bit", @"CPU is 64-Bit?", [NSNumber numberWithBool:is64bit], is64bit ? @"Yes" : @"No", nil] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"cpu64bit", @"CPU is 64-Bit?", @(is64bit), is64bit ? @"Yes" : @"No"] forKeys:profileDictKeys]];
|
||||
}
|
||||
error = sysctlbyname("hw.cpusubtype", &value, &length, NULL, 0);
|
||||
if (error == 0) {
|
||||
NSString *visibleCPUSubType;
|
||||
if (cpuType == 7) {
|
||||
// Intel
|
||||
// TODO: other Intel processors, like Core i7, i5, i3, Xeon?
|
||||
visibleCPUSubType = is64bit ? @"Intel Core 2" : @"Intel Core"; // If anyone knows how to tell a Core Duo from a Core Solo, please email tph@atomicbird.com
|
||||
} else if (cpuType == 18) {
|
||||
// PowerPC
|
||||
@@ -85,7 +90,7 @@
|
||||
} else {
|
||||
visibleCPUSubType = @"Other";
|
||||
}
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpusubtype",@"CPU Subtype", [NSNumber numberWithInt:value], visibleCPUSubType,nil] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"cpusubtype",@"CPU Subtype", @(value), visibleCPUSubType] forKeys:profileDictKeys]];
|
||||
}
|
||||
error = sysctlbyname("hw.model", NULL, &length, NULL, 0);
|
||||
if (error == 0) {
|
||||
@@ -93,11 +98,12 @@
|
||||
if (cpuModel != NULL) {
|
||||
error = sysctlbyname("hw.model", cpuModel, &length, NULL, 0);
|
||||
if (error == 0) {
|
||||
NSString *rawModelName = [NSString stringWithUTF8String:cpuModel];
|
||||
NSString *visibleModelName = [modelTranslation objectForKey:rawModelName];
|
||||
if (visibleModelName == nil)
|
||||
NSString *rawModelName = @(cpuModel);
|
||||
NSString *visibleModelName = modelTranslation[rawModelName];
|
||||
if (visibleModelName == nil) {
|
||||
visibleModelName = rawModelName;
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"model",@"Mac Model", rawModelName, visibleModelName, nil] forKeys:profileDictKeys]];
|
||||
}
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"model",@"Mac Model", rawModelName, visibleModelName] forKeys:profileDictKeys]];
|
||||
}
|
||||
free(cpuModel);
|
||||
}
|
||||
@@ -105,34 +111,44 @@
|
||||
|
||||
// Number of CPUs
|
||||
error = sysctlbyname("hw.ncpu", &value, &length, NULL, 0);
|
||||
if (error == 0)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"ncpu",@"Number of CPUs", [NSNumber numberWithInt:value], [NSNumber numberWithInt:value],nil] forKeys:profileDictKeys]];
|
||||
if (error == 0) {
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"ncpu",@"Number of CPUs", @(value), @(value)] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// User preferred language
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
NSArray *languages = [defs objectForKey:@"AppleLanguages"];
|
||||
if ([languages count] > 0)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"lang",@"Preferred Language", [languages objectAtIndex:0], [languages objectAtIndex:0],nil] forKeys:profileDictKeys]];
|
||||
if ([languages count] > 0) {
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"lang",@"Preferred Language", languages[0], languages[0]] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// Application sending the request
|
||||
NSString *appName = [host name];
|
||||
if (appName)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"appName",@"Application Name", appName, appName,nil] forKeys:profileDictKeys]];
|
||||
if (appName) {
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"appName",@"Application Name", appName, appName] forKeys:profileDictKeys]];
|
||||
}
|
||||
NSString *appVersion = [host version];
|
||||
if (appVersion)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"appVersion",@"Application Version", appVersion, appVersion,nil] forKeys:profileDictKeys]];
|
||||
if (appVersion) {
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"appVersion",@"Application Version", appVersion, appVersion] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// Number of displays?
|
||||
|
||||
// CPU speed
|
||||
SInt32 gestaltInfo;
|
||||
OSErr err = Gestalt(gestaltProcClkSpeedMHz,&gestaltInfo);
|
||||
if (err == noErr)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpuFreqMHz",@"CPU Speed (GHz)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithDouble:gestaltInfo/1000.0],nil] forKeys:profileDictKeys]];
|
||||
unsigned long hz;
|
||||
size_t hz_size = sizeof(unsigned long);
|
||||
if (sysctlbyname("hw.cpufrequency", &hz, &hz_size, NULL, 0) == 0) {
|
||||
unsigned long mhz = hz / 1000000;
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"cpuFreqMHz",@"CPU Speed (GHz)", @(mhz), @(mhz / 1000.)] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// amount of RAM
|
||||
err = Gestalt(gestaltPhysicalRAMSizeInMegabytes,&gestaltInfo);
|
||||
if (err == noErr)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"ramMB",@"Memory (MB)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithInt:gestaltInfo],nil] forKeys:profileDictKeys]];
|
||||
unsigned long bytes;
|
||||
size_t bytes_size = sizeof(unsigned long);
|
||||
if (sysctlbyname("hw.memsize", &bytes, &bytes_size, NULL, 0) == 0) {
|
||||
double megabytes = bytes / (1024.*1024.);
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[@"ramMB",@"Memory (MB)", @(megabytes), @(megabytes)] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
return profileArray;
|
||||
}
|
||||
|
||||
+13
-7
@@ -22,12 +22,14 @@
|
||||
[updateAlert setDelegate:self];
|
||||
|
||||
id<SUVersionDisplay> versDisp = nil;
|
||||
if ([[updater delegate] respondsToSelector:@selector(versionDisplayerForUpdater:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(versionDisplayerForUpdater:)]) {
|
||||
versDisp = [[updater delegate] versionDisplayerForUpdater: updater];
|
||||
}
|
||||
[updateAlert setVersionDisplayer: versDisp];
|
||||
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
|
||||
[[updater delegate] updater:updater didFindValidUpdate:updateItem];
|
||||
}
|
||||
|
||||
// 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
|
||||
@@ -99,14 +101,17 @@
|
||||
|
||||
- (NSString *)humanReadableSizeFromDouble:(double)value
|
||||
{
|
||||
if (value < 1000)
|
||||
if (value < 1000) {
|
||||
return [NSString stringWithFormat:@"%.0lf %@", value, SULocalizedString(@"B", @"the unit for bytes")];
|
||||
}
|
||||
|
||||
if (value < 1000 * 1000)
|
||||
if (value < 1000 * 1000) {
|
||||
return [NSString stringWithFormat:@"%.0lf %@", value / 1000.0, SULocalizedString(@"KB", @"the unit for kilobytes")];
|
||||
}
|
||||
|
||||
if (value < 1000 * 1000 * 1000)
|
||||
if (value < 1000 * 1000 * 1000) {
|
||||
return [NSString stringWithFormat:@"%.1lf %@", value / 1000.0 / 1000.0, SULocalizedString(@"MB", @"the unit for megabytes")];
|
||||
}
|
||||
|
||||
return [NSString stringWithFormat:@"%.2lf %@", value / 1000.0 / 1000.0 / 1000.0, SULocalizedString(@"GB", @"the unit for gigabytes")];
|
||||
}
|
||||
@@ -142,7 +147,7 @@
|
||||
{
|
||||
NSDictionary * attributes;
|
||||
attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:downloadPath error:nil];
|
||||
[statusController setMaxProgressValue:[[attributes objectForKey:NSFileSize] doubleValue]];
|
||||
[statusController setMaxProgressValue:[attributes[NSFileSize] doubleValue]];
|
||||
}
|
||||
[statusController setProgressValue:[statusController progressValue] + (double)length];
|
||||
}
|
||||
@@ -202,8 +207,9 @@
|
||||
|
||||
- (void)showModalAlert:(NSAlert *)alert
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterWillShowModalAlert:)])
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterWillShowModalAlert:)]) {
|
||||
[[updater delegate] updaterWillShowModalAlert: updater];
|
||||
}
|
||||
|
||||
// When showing a modal alert we need to ensure that background applications
|
||||
// are focused to inform the user since there is no dock icon to notify them.
|
||||
|
||||
+2
-1
@@ -22,8 +22,9 @@
|
||||
{
|
||||
for (id current in [self unarchiverImplementations])
|
||||
{
|
||||
if ([current canUnarchivePath:path])
|
||||
if ([current canUnarchivePath:path]) {
|
||||
return [[[current alloc] initWithPath:path host:host] autorelease];
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
+ (void)registerImplementation:(Class)implementation;
|
||||
+ (NSArray *)unarchiverImplementations;
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path;
|
||||
- (id)initWithPath:(NSString *)path host:(SUHost *)host;
|
||||
- (instancetype)initWithPath:(NSString *)path host:(SUHost *)host;
|
||||
|
||||
- (void)notifyDelegateOfExtractedLength:(NSNumber *)length;
|
||||
- (void)notifyDelegateOfExtractedLength:(size_t)length;
|
||||
- (void)notifyDelegateOfSuccess;
|
||||
- (void)notifyDelegateOfFailure;
|
||||
@end
|
||||
|
||||
+13
-9
@@ -10,7 +10,7 @@
|
||||
|
||||
@implementation SUUnarchiver (Private)
|
||||
|
||||
- (id)initWithPath:(NSString *)path host:(SUHost *)host
|
||||
- (instancetype)initWithPath:(NSString *)path host:(SUHost *)host
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
@@ -32,30 +32,34 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)notifyDelegateOfExtractedLength:(NSNumber *)length
|
||||
- (void)notifyDelegateOfExtractedLength:(size_t)length
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(unarchiver:extractedLength:)])
|
||||
[delegate unarchiver:self extractedLength:[length unsignedLongValue]];
|
||||
if ([delegate respondsToSelector:@selector(unarchiver:extractedLength:)]) {
|
||||
[delegate unarchiver:self extractedLength:length];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)notifyDelegateOfSuccess
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(unarchiverDidFinish:)])
|
||||
[delegate performSelector:@selector(unarchiverDidFinish:) withObject:self];
|
||||
if ([delegate respondsToSelector:@selector(unarchiverDidFinish:)]) {
|
||||
[delegate unarchiverDidFinish:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)notifyDelegateOfFailure
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(unarchiverDidFail:)])
|
||||
[delegate performSelector:@selector(unarchiverDidFail:) withObject:self];
|
||||
if ([delegate respondsToSelector:@selector(unarchiverDidFail:)]) {
|
||||
[delegate unarchiverDidFail:self];
|
||||
}
|
||||
}
|
||||
|
||||
static NSMutableArray *gUnarchiverImplementations;
|
||||
|
||||
+ (void)registerImplementation:(Class)implementation
|
||||
{
|
||||
if (!gUnarchiverImplementations)
|
||||
if (!gUnarchiverImplementations) {
|
||||
gUnarchiverImplementations = [[NSMutableArray alloc] init];
|
||||
}
|
||||
[gUnarchiverImplementations addObject:implementation];
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -26,8 +26,6 @@ typedef enum
|
||||
@interface SUUpdateAlert : SUWindowController {
|
||||
SUAppcastItem *updateItem;
|
||||
SUHost *host;
|
||||
id<SUUpdateAlertDelegate> delegate;
|
||||
id<SUVersionDisplay> versionDisplayer;
|
||||
|
||||
IBOutlet WebView *releaseNotesView;
|
||||
IBOutlet NSTextField *description;
|
||||
@@ -38,15 +36,14 @@ typedef enum
|
||||
BOOL webViewFinishedLoading;
|
||||
}
|
||||
@property (assign) id<SUUpdateAlertDelegate> delegate;
|
||||
@property (assign) id<SUVersionDisplay> versionDisplayer;
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)host;
|
||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)host;
|
||||
|
||||
- (IBAction)installUpdate:sender;
|
||||
- (IBAction)skipThisVersion:sender;
|
||||
- (IBAction)remindMeLater:sender;
|
||||
|
||||
- (void)setVersionDisplayer: (id<SUVersionDisplay>)disp;
|
||||
|
||||
@end
|
||||
|
||||
@protocol SUUpdateAlertDelegate <NSObject>
|
||||
|
||||
+11
-11
@@ -27,8 +27,9 @@
|
||||
|
||||
@implementation SUUpdateAlert
|
||||
@synthesize delegate;
|
||||
@synthesize versionDisplayer;
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost
|
||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost
|
||||
{
|
||||
self = [super initWithHost:host windowNibName:@"SUUpdateAlert"];
|
||||
if (self)
|
||||
@@ -54,11 +55,6 @@
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)setVersionDisplayer: (id<SUVersionDisplay>)disp
|
||||
{
|
||||
versionDisplayer = disp;
|
||||
}
|
||||
|
||||
- (void)endWithSelection:(SUUpdateAlertChoice)choice
|
||||
{
|
||||
[releaseNotesView stopLoading:self];
|
||||
@@ -162,8 +158,9 @@
|
||||
{
|
||||
NSString* sizeStr = [host objectForInfoDictionaryKey:SUFixedHTMLDisplaySizeKey];
|
||||
|
||||
if( [host isBackgroundApplication] )
|
||||
if ([host isBackgroundApplication]) {
|
||||
[[self window] setLevel:NSFloatingWindowLevel]; // This means the window will float over all other apps, if our app is switched out ?! UK 2007-09-04
|
||||
}
|
||||
[[self window] setFrameAutosaveName: sizeStr ? @"" : @"SUUpdateAlertFrame"];
|
||||
|
||||
// We're gonna do some frame magic to match the window's size to the description field and the presence of the release notes view.
|
||||
@@ -174,8 +171,9 @@
|
||||
// Resize the window to be appropriate for not having a huge release notes view.
|
||||
frame.size.height -= [releaseNotesView frame].size.height + 40; // Extra 40 is for the release notes label and margin.
|
||||
|
||||
if ([self allowsAutomaticUpdates])
|
||||
if ([self allowsAutomaticUpdates]) {
|
||||
frame.size.height += 10; // Make room for the check box.
|
||||
}
|
||||
|
||||
// Hiding the resize handles is not enough on 10.5, you can still click
|
||||
// where they would be, so we set the min/max sizes to be equal to
|
||||
@@ -203,7 +201,7 @@
|
||||
#define DISTANCE_BETWEEN_BUTTON_GROUPS 12
|
||||
|
||||
CGFloat minimumWindowWidth = [[self window] frame].size.width -NSMaxX([installButton frame]) +NSMinX([skipButton frame]); // Distance between contents and left/right edge.
|
||||
NSDictionary* attrs = [NSDictionary dictionaryWithObjectsAndKeys: [installButton font], NSFontAttributeName, nil];
|
||||
NSDictionary* attrs = @{NSFontAttributeName: [installButton font]};
|
||||
NSSize titleSize = [[installButton title] sizeWithAttributes: attrs];
|
||||
titleSize.width += (16 + 8) * 2; // 16 px for the end caps plus 8 px padding at each end or it'll look as ugly as calling -sizeToFit.
|
||||
NSRect installBtnBox = [installButton frame];
|
||||
@@ -250,8 +248,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
if( frame.size.width < minimumWindowWidth )
|
||||
if (frame.size.width < minimumWindowWidth) {
|
||||
frame.size.width = minimumWindowWidth;
|
||||
}
|
||||
|
||||
[[self window] setFrame: frame display: NO];
|
||||
[[self window] center];
|
||||
@@ -297,8 +296,9 @@
|
||||
updateItemVersion = [updateItemVersion stringByAppendingFormat:@" (%@)", [updateItem versionString]];
|
||||
hostVersion = [hostVersion stringByAppendingFormat:@" (%@)", [host version]];
|
||||
}
|
||||
else
|
||||
else {
|
||||
[versionDisplayer formatVersion: &updateItemVersion andVersion: &hostVersion];
|
||||
}
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available--you have %@. Would you like to download it now?", nil), [host name], updateItemVersion, hostVersion];
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -17,7 +17,7 @@ extern NSString * const SUUpdateDriverFinishedNotification;
|
||||
@interface SUUpdateDriver : NSObject<NSURLDownloadDelegate>
|
||||
{
|
||||
SUHost *host;
|
||||
SUUpdater *updater;
|
||||
SUUpdater *updater; //assigned
|
||||
NSURL *appcastURL;
|
||||
|
||||
BOOL finished;
|
||||
@@ -25,11 +25,11 @@ extern NSString * const SUUpdateDriverFinishedNotification;
|
||||
}
|
||||
@property (retain) SUHost *host;
|
||||
|
||||
- initWithUpdater:(SUUpdater *)updater;
|
||||
- (instancetype) initWithUpdater:(SUUpdater *)updater;
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
|
||||
- (void)abortUpdate;
|
||||
- (BOOL)isInterruptible;
|
||||
- (BOOL)finished;
|
||||
@property (getter=isInterruptible, readonly) BOOL interruptible;
|
||||
@property (readonly) BOOL finished;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
+6
-8
@@ -12,13 +12,15 @@
|
||||
NSString * const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
|
||||
|
||||
@implementation SUUpdateDriver
|
||||
|
||||
@synthesize host;
|
||||
@synthesize interruptible = isInterruptible;
|
||||
@synthesize finished;
|
||||
|
||||
- initWithUpdater:(SUUpdater *)anUpdater
|
||||
- (instancetype) initWithUpdater:(SUUpdater *)anUpdater
|
||||
{
|
||||
if ((self = [super init]))
|
||||
if ((self = [super init])) {
|
||||
updater = anUpdater;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -32,14 +34,10 @@ NSString * const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
|
||||
|
||||
- (void)abortUpdate
|
||||
{
|
||||
[self setValue:[NSNumber numberWithBool:YES] forKey:@"finished"];
|
||||
[self setValue:@YES forKey:@"finished"];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdateDriverFinishedNotification object:self];
|
||||
}
|
||||
|
||||
- (BOOL)isInterruptible { return isInterruptible; }
|
||||
|
||||
- (BOOL)finished { return finished; }
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
self.host = nil;
|
||||
|
||||
@@ -16,23 +16,24 @@ typedef enum {
|
||||
SUDoNotAutomaticallyCheck
|
||||
} SUPermissionPromptResult;
|
||||
|
||||
@protocol SUUpdatePermissionPromptDelegateProtocol;
|
||||
|
||||
@class SUHost;
|
||||
@interface SUUpdatePermissionPrompt : SUWindowController {
|
||||
SUHost *host;
|
||||
NSArray *systemProfileInformationArray;
|
||||
id delegate;
|
||||
id<SUUpdatePermissionPromptDelegateProtocol> delegate;
|
||||
IBOutlet NSTextField *descriptionTextField;
|
||||
IBOutlet NSView *moreInfoView;
|
||||
IBOutlet NSButton *moreInfoButton;
|
||||
IBOutlet NSTableView *profileTableView;
|
||||
BOOL isShowingMoreInfo, shouldSendProfile;
|
||||
}
|
||||
+ (void)promptWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id)d;
|
||||
+ (void)promptWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id<SUUpdatePermissionPromptDelegateProtocol>)d;
|
||||
- (IBAction)toggleMoreInfo:(id)sender;
|
||||
- (IBAction)finishPrompt:(id)sender;
|
||||
@end
|
||||
|
||||
@interface NSObject (SUUpdatePermissionPromptDelegateInformalProtocol)
|
||||
@protocol SUUpdatePermissionPromptDelegateProtocol <NSObject>
|
||||
- (void)updatePermissionPromptFinishedWithResult:(SUPermissionPromptResult)result;
|
||||
@end
|
||||
|
||||
|
||||
+13
-10
@@ -11,6 +11,10 @@
|
||||
#import "SUHost.h"
|
||||
#import "SUConstants.h"
|
||||
|
||||
@interface SUUpdatePermissionPrompt ()
|
||||
@property BOOL isShowingMoreInfo, shouldSendProfile;
|
||||
@end
|
||||
|
||||
@implementation SUUpdatePermissionPrompt
|
||||
|
||||
- (BOOL)shouldAskAboutProfile
|
||||
@@ -18,15 +22,15 @@
|
||||
return [[host objectForInfoDictionaryKey:SUEnableSystemProfilingKey] boolValue];
|
||||
}
|
||||
|
||||
- (id)initWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id)d
|
||||
- (instancetype)initWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id<SUUpdatePermissionPromptDelegateProtocol>)d
|
||||
{
|
||||
self = [super initWithHost:aHost windowNibName:@"SUUpdatePermissionPrompt"];
|
||||
if (self)
|
||||
{
|
||||
host = [aHost retain];
|
||||
delegate = d;
|
||||
isShowingMoreInfo = NO;
|
||||
shouldSendProfile = [self shouldAskAboutProfile];
|
||||
self.isShowingMoreInfo = NO;
|
||||
self.shouldSendProfile = [self shouldAskAboutProfile];
|
||||
systemProfileInformationArray = [profile retain];
|
||||
[self setShouldCascadeWindows:NO];
|
||||
}
|
||||
@@ -80,9 +84,7 @@
|
||||
|
||||
- (IBAction)toggleMoreInfo:(id)sender
|
||||
{
|
||||
[self willChangeValueForKey:@"isShowingMoreInfo"];
|
||||
isShowingMoreInfo = !isShowingMoreInfo;
|
||||
[self didChangeValueForKey:@"isShowingMoreInfo"];
|
||||
self.isShowingMoreInfo = !_isShowingMoreInfo;
|
||||
|
||||
NSView *contentView = [[self window] contentView];
|
||||
NSRect contentViewFrame = [contentView frame];
|
||||
@@ -92,7 +94,7 @@
|
||||
NSRect profileMoreInfoButtonFrame = [moreInfoButton frame];
|
||||
NSRect descriptionFrame = [descriptionTextField frame];
|
||||
|
||||
if (isShowingMoreInfo)
|
||||
if (_isShowingMoreInfo)
|
||||
{
|
||||
// Add the subview
|
||||
contentViewFrame.size.height += profileMoreInfoViewFrame.size.height;
|
||||
@@ -120,14 +122,15 @@
|
||||
[[self window] setFrame:windowFrame display:YES animate:YES];
|
||||
[contentView setFrame:contentViewFrame];
|
||||
[contentView setNeedsDisplay:YES];
|
||||
[moreInfoView setHidden:(!isShowingMoreInfo)];
|
||||
[moreInfoView setHidden:(!_isShowingMoreInfo)];
|
||||
}
|
||||
|
||||
- (IBAction)finishPrompt:(id)sender
|
||||
{
|
||||
if (![delegate respondsToSelector:@selector(updatePermissionPromptFinishedWithResult:)])
|
||||
if (![delegate respondsToSelector:@selector(updatePermissionPromptFinishedWithResult:)]) {
|
||||
[NSException raise:@"SUInvalidDelegate" format:@"SUUpdatePermissionPrompt's delegate (%@) doesn't respond to updatePermissionPromptFinishedWithResult:!", delegate];
|
||||
[host setBool:shouldSendProfile forUserDefaultsKey:SUSendProfileInfoKey];
|
||||
}
|
||||
[host setBool:_shouldSendProfile forUserDefaultsKey:SUSendProfileInfoKey];
|
||||
[delegate updatePermissionPromptFinishedWithResult:([sender tag] == 1 ? SUAutomaticallyCheck : SUDoNotAutomaticallyCheck)];
|
||||
[[self window] close];
|
||||
[NSApp stopModal];
|
||||
|
||||
+14
-26
@@ -17,38 +17,29 @@
|
||||
@interface SUUpdater : NSObject
|
||||
{
|
||||
@private
|
||||
NSTimer *checkTimer;
|
||||
SUUpdateDriver *driver;
|
||||
|
||||
NSString *customUserAgentString;
|
||||
SUHost *host;
|
||||
IBOutlet id delegate;
|
||||
}
|
||||
@property (assign) id delegate;
|
||||
@property (assign) IBOutlet id delegate;
|
||||
|
||||
+ (SUUpdater *)sharedUpdater;
|
||||
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
|
||||
- (instancetype)initForBundle:(NSBundle *)bundle;
|
||||
|
||||
- (NSBundle *)hostBundle;
|
||||
@property (readonly, strong) NSBundle *hostBundle;
|
||||
|
||||
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
|
||||
- (BOOL)automaticallyChecksForUpdates;
|
||||
@property BOOL automaticallyChecksForUpdates;
|
||||
|
||||
- (void)setUpdateCheckInterval:(NSTimeInterval)interval;
|
||||
- (NSTimeInterval)updateCheckInterval;
|
||||
@property NSTimeInterval updateCheckInterval;
|
||||
|
||||
- (void)setFeedURL:(NSURL *)feedURL;
|
||||
- (NSURL *)feedURL; // *** MUST BE CALLED ON MAIN THREAD ***
|
||||
@property (copy) NSURL *feedURL; // *** MUST BE CALLED ON MAIN THREAD ***
|
||||
|
||||
- (void)setUserAgentString:(NSString *)userAgent;
|
||||
- (NSString *)userAgentString;
|
||||
@property (nonatomic, copy) NSString *userAgentString;
|
||||
|
||||
- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile;
|
||||
- (BOOL)sendsSystemProfile;
|
||||
@property BOOL sendsSystemProfile;
|
||||
|
||||
- (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyDownloadsUpdates;
|
||||
- (BOOL)automaticallyDownloadsUpdates;
|
||||
@property BOOL automaticallyDownloadsUpdates;
|
||||
|
||||
// This IBAction is meant for a main menu item. Hook up any menu item to this action,
|
||||
// and Sparkle will check for updates and report back its findings verbosely.
|
||||
@@ -60,7 +51,7 @@
|
||||
- (void)checkForUpdatesInBackground;
|
||||
|
||||
// Date of last update check. Returns nil if no check has been performed.
|
||||
- (NSDate*)lastUpdateCheckDate;
|
||||
@property (readonly, copy) NSDate *lastUpdateCheckDate;
|
||||
|
||||
// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though,
|
||||
// (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI.
|
||||
@@ -69,7 +60,7 @@
|
||||
// Call this to appropriately schedule or cancel the update checking timer according to the preferences for time interval and automatic checks. This call does not change the date of the next check, but only the internal NSTimer.
|
||||
- (void)resetUpdateCycle;
|
||||
|
||||
- (BOOL)updateInProgress;
|
||||
@property (readonly) BOOL updateInProgress;
|
||||
|
||||
@end
|
||||
|
||||
@@ -80,10 +71,11 @@
|
||||
extern NSString *const SUUpdaterDidFinishLoadingAppCastNotification;
|
||||
extern NSString *const SUUpdaterDidFindValidUpdateNotification;
|
||||
extern NSString *const SUUpdaterDidNotFindUpdateNotification;
|
||||
extern NSString *const SUUpdaterWillInstallUpdateNotification;
|
||||
extern NSString *const SUUpdaterWillRelaunchApplicationNotification;
|
||||
extern NSString *const SUUpdaterWillRestartNotification;
|
||||
#define SUUpdaterWillRelaunchApplicationNotification SUUpdaterWillRestartNotification;
|
||||
#define SUUpdaterWillInstallUpdateNotification SUUpdaterWillRestartNotification;
|
||||
|
||||
// Key for the SUAppcastItem object in the SUUpdaterDidFindValidUpdateNotification & SUUpdaterWillInstallUpdateNotification userInfos
|
||||
// Key for the SUAppcastItem object in the SUUpdaterDidFindValidUpdateNotification userInfo
|
||||
extern NSString *const SUUpdaterAppcastItemNotificationKey;
|
||||
// Key for the SUAppcast object in the SUUpdaterDidFinishLoadingAppCastNotification userInfo
|
||||
extern NSString *const SUUpdaterAppcastNotificationKey;
|
||||
@@ -162,10 +154,6 @@ extern NSString *const SUUpdaterAppcastNotificationKey;
|
||||
// Constants:
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DEBUG
|
||||
#define DEBUG 0
|
||||
#endif
|
||||
|
||||
// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds.
|
||||
#if defined(DEBUG) && DEBUG && 0
|
||||
#define SU_MIN_CHECK_INTERVAL 60
|
||||
|
||||
+87
-75
@@ -23,22 +23,20 @@
|
||||
NSString *const SUUpdaterDidFinishLoadingAppCastNotification = @"SUUpdaterDidFinishLoadingAppCastNotification";
|
||||
NSString *const SUUpdaterDidFindValidUpdateNotification = @"SUUpdaterDidFindValidUpdateNotification";
|
||||
NSString *const SUUpdaterDidNotFindUpdateNotification = @"SUUpdaterDidNotFindUpdateNotification";
|
||||
NSString *const SUUpdaterWillInstallUpdateNotification = @"SUUpdaterWillInstallUpdateNotification";
|
||||
NSString *const SUUpdaterWillRelaunchApplicationNotification = @"SUUpdaterWillRelaunchApplicationNotification";
|
||||
NSString *const SUUpdaterWillRestartNotification = @"SUUpdaterWillRestartNotificationName";
|
||||
NSString *const SUUpdaterAppcastItemNotificationKey = @"SUUpdaterAppcastItemNotificationKey";
|
||||
NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotificationKey";
|
||||
|
||||
@interface SUUpdater ()
|
||||
@interface SUUpdater () <SUUpdatePermissionPromptDelegateProtocol>
|
||||
@property (retain) NSTimer *checkTimer;
|
||||
- (id)initForBundle:(NSBundle *)bundle;
|
||||
- (instancetype)initForBundle:(NSBundle *)bundle;
|
||||
- (void)startUpdateCycle;
|
||||
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)updateDriver;
|
||||
- (BOOL)automaticallyDownloadsUpdates;
|
||||
- (void)scheduleNextUpdateCheck;
|
||||
- (void)registerAsObserver;
|
||||
- (void)unregisterAsObserver;
|
||||
- (void)updateDriverDidFinish:(NSNotification *)note;
|
||||
- (NSURL *)parameterizedFeedURL;
|
||||
@property (readonly, copy) NSURL *parameterizedFeedURL;
|
||||
|
||||
-(void) notifyWillShowModalAlert;
|
||||
-(void) notifyDidShowModalAlert;
|
||||
@@ -48,6 +46,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
@implementation SUUpdater
|
||||
@synthesize delegate;
|
||||
@synthesize checkTimer;
|
||||
@synthesize userAgentString = customUserAgentString;
|
||||
|
||||
#pragma mark Initialization
|
||||
|
||||
@@ -63,23 +62,25 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle
|
||||
{
|
||||
if (bundle == nil) bundle = [NSBundle mainBundle];
|
||||
id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]];
|
||||
if (updater == nil)
|
||||
id updater = sharedUpdaters[[NSValue valueWithNonretainedObject:bundle]];
|
||||
if (updater == nil) {
|
||||
updater = [[[[self class] alloc] initForBundle:bundle] autorelease];
|
||||
}
|
||||
return updater;
|
||||
}
|
||||
|
||||
// This is the designated initializer for SUUpdater, important for subclasses
|
||||
- (id)initForBundle:(NSBundle *)bundle
|
||||
- (instancetype)initForBundle:(NSBundle *)bundle
|
||||
{
|
||||
self = [super init];
|
||||
if (bundle == nil) bundle = [NSBundle mainBundle];
|
||||
|
||||
// Register as observer straight away to avoid exceptions on -dealloc when -unregisterAsObserver is called:
|
||||
if (self)
|
||||
if (self) {
|
||||
[self registerAsObserver];
|
||||
}
|
||||
|
||||
id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]];
|
||||
id updater = sharedUpdaters[[NSValue valueWithNonretainedObject:bundle]];
|
||||
if (updater)
|
||||
{
|
||||
[self release];
|
||||
@@ -87,9 +88,10 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
}
|
||||
else if (self)
|
||||
{
|
||||
if (sharedUpdaters == nil)
|
||||
if (sharedUpdaters == nil) {
|
||||
sharedUpdaters = [[NSMutableDictionary alloc] init];
|
||||
[sharedUpdaters setObject:self forKey:[NSValue valueWithNonretainedObject:bundle]];
|
||||
}
|
||||
sharedUpdaters[[NSValue valueWithNonretainedObject:bundle]] = self;
|
||||
host = [[SUHost alloc] initWithBundle:bundle];
|
||||
|
||||
#if !ENDANGER_USERS_WITH_INSECURE_UPDATES
|
||||
@@ -115,7 +117,7 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
|
||||
|
||||
// This will be used when the updater is instantiated in a nib such as MainMenu
|
||||
- (id)init
|
||||
- (instancetype)init
|
||||
{
|
||||
return [self initForBundle:[NSBundle mainBundle]];
|
||||
}
|
||||
@@ -154,8 +156,9 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
// Has he been asked already? And don't ask if the host has a default value set in its Info.plist.
|
||||
else if ([host objectForKey:SUEnableAutomaticChecksKey] == nil)
|
||||
{
|
||||
if ([host objectForUserDefaultsKey:SUEnableAutomaticChecksKeyOld])
|
||||
if ([host objectForUserDefaultsKey:SUEnableAutomaticChecksKeyOld]) {
|
||||
[self setAutomaticallyChecksForUpdates:[host boolForUserDefaultsKey:SUEnableAutomaticChecksKeyOld]];
|
||||
}
|
||||
// Now, we don't want to ask the user for permission to do a weird thing on the first launch.
|
||||
// We wait until the second launch, unless explicitly overridden via SUPromptUserOnFirstLaunchKey.
|
||||
else if (![host objectForKey:SUPromptUserOnFirstLaunchKey])
|
||||
@@ -173,8 +176,9 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
{
|
||||
NSArray *profileInfo = [host systemProfile];
|
||||
// Always say we're sending the system profile here so that the delegate displays the parameters it would send.
|
||||
if ([delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)])
|
||||
if ([delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) {
|
||||
profileInfo = [profileInfo arrayByAddingObjectsFromArray:[delegate feedParametersForUpdater:self sendingSystemProfile:YES]];
|
||||
}
|
||||
[SUUpdatePermissionPrompt promptWithHost:host systemProfile:profileInfo delegate:self];
|
||||
// We start the update checks and register as observer for changes after the prompt finishes
|
||||
}
|
||||
@@ -234,55 +238,59 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
|
||||
-(void) putFeedURLIntoDictionary: (NSMutableDictionary*)theDict // You release this.
|
||||
{
|
||||
[theDict setObject: [self feedURL] forKey: @"feedURL"];
|
||||
theDict[@"feedURL"] = [self feedURL];
|
||||
}
|
||||
|
||||
-(void) checkForUpdatesInBgReachabilityCheckWithDriver: (SUUpdateDriver*)inDriver /* RUNS ON ITS OWN THREAD */
|
||||
{
|
||||
NS_DURING
|
||||
@try {
|
||||
// This method *must* be called on its own thread. SCNetworkReachabilityCheckByName
|
||||
// can block, and it can be waiting a long time on slow networks, and we
|
||||
// wouldn't want to beachball the main thread for a background operation.
|
||||
// We could use asynchronous reachability callbacks, but those aren't
|
||||
// reliable enough and can 'get lost' sometimes, which we don't want.
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
SCNetworkConnectionFlags flags = 0;
|
||||
BOOL isNetworkReachable = YES;
|
||||
|
||||
// Don't perform automatic checks on unconnected laptops or dial-up connections that aren't online:
|
||||
NSMutableDictionary* theDict = [NSMutableDictionary dictionary];
|
||||
[self performSelectorOnMainThread: @selector(putFeedURLIntoDictionary:) withObject: theDict waitUntilDone: YES]; // Get feed URL on main thread, it's not safe to call elsewhere.
|
||||
|
||||
const char *hostname = [[[theDict objectForKey: @"feedURL"] host] cStringUsingEncoding: NSUTF8StringEncoding];
|
||||
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, hostname);
|
||||
Boolean reachabilityResult = NO;
|
||||
// If the feed's using a file:// URL, we won't be able to use reachability.
|
||||
if (reachability != NULL) {
|
||||
SCNetworkReachabilityGetFlags(reachability, &flags);
|
||||
CFRelease(reachability);
|
||||
}
|
||||
|
||||
if( reachabilityResult )
|
||||
{
|
||||
BOOL reachable = (flags & kSCNetworkFlagsReachable) == kSCNetworkFlagsReachable;
|
||||
BOOL automatic = (flags & kSCNetworkFlagsConnectionAutomatic) == kSCNetworkFlagsConnectionAutomatic;
|
||||
BOOL local = (flags & kSCNetworkFlagsIsLocalAddress) == kSCNetworkFlagsIsLocalAddress;
|
||||
@autoreleasepool {
|
||||
SCNetworkConnectionFlags flags = 0;
|
||||
BOOL isNetworkReachable = YES;
|
||||
|
||||
//NSLog(@"reachable = %s, automatic = %s, local = %s", (reachable?"YES":"NO"), (automatic?"YES":"NO"), (local?"YES":"NO"));
|
||||
// Don't perform automatic checks on unconnected laptops or dial-up connections that aren't online:
|
||||
NSMutableDictionary* theDict = [NSMutableDictionary dictionary];
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[self putFeedURLIntoDictionary:theDict]; // Get feed URL on main thread, it's not safe to call elsewhere.
|
||||
});
|
||||
|
||||
const char *hostname = [[theDict[@"feedURL"] host] cStringUsingEncoding: NSUTF8StringEncoding];
|
||||
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, hostname);
|
||||
Boolean reachabilityResult = NO;
|
||||
// If the feed's using a file:// URL, we won't be able to use reachability.
|
||||
if (reachability != NULL) {
|
||||
SCNetworkReachabilityGetFlags(reachability, &flags);
|
||||
CFRelease(reachability);
|
||||
}
|
||||
|
||||
if( reachabilityResult )
|
||||
{
|
||||
BOOL reachable = (flags & kSCNetworkFlagsReachable) == kSCNetworkFlagsReachable;
|
||||
BOOL automatic = (flags & kSCNetworkFlagsConnectionAutomatic) == kSCNetworkFlagsConnectionAutomatic;
|
||||
BOOL local = (flags & kSCNetworkFlagsIsLocalAddress) == kSCNetworkFlagsIsLocalAddress;
|
||||
|
||||
//NSLog(@"reachable = %s, automatic = %s, local = %s", (reachable?"YES":"NO"), (automatic?"YES":"NO"), (local?"YES":"NO"));
|
||||
|
||||
if( !(reachable || automatic || local) )
|
||||
isNetworkReachable = NO;
|
||||
}
|
||||
|
||||
// If the network's not reachable, we pass a nil driver into checkForUpdatesWithDriver, which will then reschedule the next update so we try again later.
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self checkForUpdatesWithDriver: isNetworkReachable ? inDriver : nil];
|
||||
});
|
||||
|
||||
if( !(reachable || automatic || local) )
|
||||
isNetworkReachable = NO;
|
||||
}
|
||||
|
||||
// If the network's not reachable, we pass a nil driver into checkForUpdatesWithDriver, which will then reschedule the next update so we try again later.
|
||||
[self performSelectorOnMainThread: @selector(checkForUpdatesWithDriver:) withObject: isNetworkReachable ? inDriver : nil waitUntilDone: NO];
|
||||
|
||||
[pool release];
|
||||
NS_HANDLER
|
||||
} @catch (NSException *localException) {
|
||||
SULog(@"UNCAUGHT EXCEPTION IN UPDATE CHECK TIMER: %@",[localException reason]);
|
||||
// Don't propagate the exception beyond here. In Carbon apps that would trash the stack.
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -293,7 +301,9 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
// hour or so:
|
||||
SUUpdateDriver * theUpdateDriver = [[[([self automaticallyDownloadsUpdates] ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class]) alloc] initWithUpdater:self] autorelease];
|
||||
|
||||
[NSThread detachNewThreadSelector: @selector(checkForUpdatesInBgReachabilityCheckWithDriver:) toTarget: self withObject: theUpdateDriver];
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
[self checkForUpdatesInBgReachabilityCheckWithDriver:theUpdateDriver];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -304,8 +314,9 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
|
||||
- (IBAction)checkForUpdates: (id)sender
|
||||
{
|
||||
if (driver && [driver isInterruptible])
|
||||
if (driver && [driver isInterruptible]) {
|
||||
[driver abortUpdate];
|
||||
}
|
||||
|
||||
[self checkForUpdatesWithDriver:[[[SUUserInitiatedUpdateDriver alloc] initWithUpdater:self] autorelease]];
|
||||
}
|
||||
@@ -396,8 +407,9 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
[host setBool:automaticallyCheckForUpdates forUserDefaultsKey:SUEnableAutomaticChecksKey];
|
||||
// Hack to support backwards compatibility with older Sparkle versions, which supported
|
||||
// disabling updates by setting the check interval to 0.
|
||||
if (automaticallyCheckForUpdates && [self updateCheckInterval] == 0)
|
||||
if (automaticallyCheckForUpdates && [self updateCheckInterval] == 0) {
|
||||
[self setUpdateCheckInterval:SU_DEFAULT_CHECK_INTERVAL];
|
||||
}
|
||||
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetUpdateCycle) object:nil];
|
||||
// Provide a small delay in case multiple preferences are being updated simultaneously.
|
||||
[self performSelector:@selector(resetUpdateCycle) withObject:nil afterDelay:1];
|
||||
@@ -406,8 +418,9 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
- (BOOL)automaticallyChecksForUpdates
|
||||
{
|
||||
// Don't automatically update when the check interval is 0, to be compatible with 1.1 settings.
|
||||
if ([self updateCheckInterval] == 0)
|
||||
if ([self updateCheckInterval] == 0) {
|
||||
return NO;
|
||||
}
|
||||
return [host boolForKey:SUEnableAutomaticChecksKey];
|
||||
}
|
||||
|
||||
@@ -419,8 +432,9 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
- (BOOL)automaticallyDownloadsUpdates
|
||||
{
|
||||
// If the SUAllowsAutomaticUpdatesKey exists and is set to NO, return NO.
|
||||
if ([host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] && [host boolForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] == NO)
|
||||
if ([host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] && [host boolForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] == NO) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Otherwise, automatically downloading updates is allowed. Does the user want it?
|
||||
return [host boolForUserDefaultsKey:SUAutomaticallyUpdateKey];
|
||||
@@ -447,19 +461,11 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
return [NSURL URLWithString: castUrlStr];
|
||||
}
|
||||
|
||||
- (void)setUserAgentString:(NSString *)userAgent
|
||||
{
|
||||
if (customUserAgentString == userAgent)
|
||||
return;
|
||||
|
||||
[customUserAgentString release];
|
||||
customUserAgentString = [userAgent copy];
|
||||
}
|
||||
|
||||
- (NSString *)userAgentString
|
||||
{
|
||||
if (customUserAgentString)
|
||||
if (customUserAgentString) {
|
||||
return customUserAgentString;
|
||||
}
|
||||
|
||||
NSString *version = [SPARKLE_BUNDLE objectForInfoDictionaryKey:@"CFBundleVersion"];
|
||||
NSString *userAgent = [NSString stringWithFormat:@"%@/%@ Sparkle/%@", [host name], [host displayVersion], version ? version : @"?"];
|
||||
@@ -486,14 +492,16 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
|
||||
// Let's only send the system profiling information once per week at most, so we normalize daily-checkers vs. biweekly-checkers and the such.
|
||||
NSDate *lastSubmitDate = [host objectForUserDefaultsKey:SULastProfileSubmitDateKey];
|
||||
if(!lastSubmitDate)
|
||||
if (!lastSubmitDate) {
|
||||
lastSubmitDate = [NSDate distantPast];
|
||||
}
|
||||
const NSTimeInterval oneWeek = 60 * 60 * 24 * 7;
|
||||
sendingSystemProfile &= (-[lastSubmitDate timeIntervalSinceNow] >= oneWeek);
|
||||
|
||||
NSArray *parameters = [NSArray array];
|
||||
if ([delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)])
|
||||
NSArray *parameters = @[];
|
||||
if ([delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) {
|
||||
parameters = [parameters arrayByAddingObjectsFromArray:[delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile]];
|
||||
}
|
||||
if (sendingSystemProfile)
|
||||
{
|
||||
parameters = [parameters arrayByAddingObjectsFromArray:[host systemProfile]];
|
||||
@@ -503,12 +511,14 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
|
||||
// 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]]];
|
||||
for (NSDictionary *currentProfileInfo in parameters) {
|
||||
[parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", [[currentProfileInfo[@"key"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [[currentProfileInfo[@"value"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
|
||||
}
|
||||
|
||||
NSString *separatorCharacter = @"?";
|
||||
if ([baseFeedURL query])
|
||||
if ([baseFeedURL query]) {
|
||||
separatorCharacter = @"&"; // In case the URL is already http://foo.org/baz.xml?bat=4
|
||||
}
|
||||
NSString *appcastStringWithProfile = [NSString stringWithFormat:@"%@%@%@", [baseFeedURL absoluteString], separatorCharacter, [parameterStrings componentsJoinedByString:@"&"]];
|
||||
|
||||
// Clean it up so it's a valid URL
|
||||
@@ -517,9 +527,10 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
|
||||
- (void)setUpdateCheckInterval:(NSTimeInterval)updateCheckInterval
|
||||
{
|
||||
[host setObject:[NSNumber numberWithDouble:updateCheckInterval] forUserDefaultsKey:SUScheduledCheckIntervalKey];
|
||||
if (updateCheckInterval == 0) // For compatibility with 1.1's settings.
|
||||
[host setObject:@(updateCheckInterval) forUserDefaultsKey:SUScheduledCheckIntervalKey];
|
||||
if (updateCheckInterval == 0) { // For compatibility with 1.1's settings.
|
||||
[self setAutomaticallyChecksForUpdates:NO];
|
||||
}
|
||||
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetUpdateCycle) object:nil];
|
||||
|
||||
// Provide a small delay in case multiple preferences are being updated simultaneously.
|
||||
@@ -540,14 +551,15 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
|
||||
{
|
||||
[self unregisterAsObserver];
|
||||
[host release];
|
||||
if (checkTimer) { [checkTimer invalidate]; [checkTimer release]; self.checkTimer = nil; } // UK 2009-03-16 Timer is non-repeating, may have invalidated itself, so we had to retain it.
|
||||
if (checkTimer) { [checkTimer invalidate]; self.checkTimer = nil; } // UK 2009-03-16 Timer is non-repeating, may have invalidated itself, so we had to retain it.
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
||||
{
|
||||
if ([item action] == @selector(checkForUpdates:))
|
||||
if ([item action] == @selector(checkForUpdates:)) {
|
||||
return ![self updateInProgress];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -10,6 +10,6 @@
|
||||
|
||||
@interface SUUpdater (Private)
|
||||
|
||||
- (BOOL)mayUpdateAndRestart;
|
||||
@property (readonly) BOOL mayUpdateAndRestart;
|
||||
|
||||
@end
|
||||
@@ -12,9 +12,9 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class SUHost;
|
||||
@interface SUWindowController : NSWindowController { }
|
||||
@interface SUWindowController : NSWindowController
|
||||
// We use this instead of plain old NSWindowController initWithWindowNibName so that we'll be able to find the right path when running in a bundle loaded from another app.
|
||||
- (id)initWithHost:(SUHost *)host windowNibName:(NSString *)nibName;
|
||||
- (instancetype)initWithHost:(SUHost *)host windowNibName:(NSString *)nibName;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
@implementation SUWindowController
|
||||
|
||||
- (id)initWithHost:(SUHost *)host windowNibName:(NSString *)nibName
|
||||
- (instancetype)initWithHost:(SUHost *)host windowNibName:(NSString *)nibName
|
||||
{
|
||||
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:nibName ofType:@"nib"];
|
||||
if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations.
|
||||
|
||||
-12
@@ -6,18 +6,6 @@
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NSAppKitVersionNumber10_4
|
||||
#define NSAppKitVersionNumber10_4 824
|
||||
#endif
|
||||
|
||||
#ifndef NSAppKitVersionNumber10_5
|
||||
#define NSAppKitVersionNumber10_5 949
|
||||
#endif
|
||||
|
||||
#ifndef NSAppKitVersionNumber10_6
|
||||
#define NSAppKitVersionNumber10_6 1038
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
|
||||
#define SPARKLE_BUNDLE [NSBundle bundleWithIdentifier:@"org.andymatuschak.Sparkle"]
|
||||
|
||||
@@ -83,7 +83,6 @@
|
||||
6158A1C5137904B300487EC1 /* SUUpdater_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 6158A1C4137904B300487EC1 /* SUUpdater_Private.h */; };
|
||||
615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */ = {isa = PBXBuildFile; fileRef = 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */; };
|
||||
6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61699BCC0DDB92BD005878A4 /* SUVersionComparisonTest.h in Headers */ = {isa = PBXBuildFile; fileRef = 61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */; settings = {ATTRIBUTES = (); }; };
|
||||
618E9CFD0E7328F1004646D8 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 618E9CFC0E7328F1004646D8 /* dsa_pub.pem */; };
|
||||
618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (); }; };
|
||||
618FA5020DAE88B40026945C /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; };
|
||||
@@ -180,20 +179,22 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
004D57371766A31600E4B27E /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
004D57381766A31600E4B27E /* ro */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ro; path = ro.lproj/SUUpdatePermissionPrompt.xib; sourceTree = "<group>"; };
|
||||
004D57391766A31600E4B27E /* ro */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ro; path = ro.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
||||
004D573A1766A31600E4B27E /* ro */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ro; path = ro.lproj/SUAutomaticUpdateAlert.xib; sourceTree = "<group>"; };
|
||||
004D573C1766A31600E4B27E /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
004D573D1766A31600E4B27E /* ro */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ro; path = ro.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
004A8652192A492B00C9730D /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
004A8653192A492B00C9730D /* ro */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ro; path = ro.lproj/SUAutomaticUpdateAlert.xib; sourceTree = "<group>"; };
|
||||
004A8654192A492B00C9730D /* ro */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ro; path = ro.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
||||
004A8655192A492B00C9730D /* ro */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ro; path = ro.lproj/SUUpdatePermissionPrompt.xib; sourceTree = "<group>"; };
|
||||
0263187214FEBB31005EBF43 /* uk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
0263187514FEBB42005EBF43 /* uk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = uk; path = uk.lproj/SUAutomaticUpdateAlert.xib; sourceTree = "<group>"; };
|
||||
0263187614FEBB42005EBF43 /* uk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = uk; path = uk.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
||||
0263187714FEBB42005EBF43 /* uk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = uk; path = uk.lproj/SUUpdatePermissionPrompt.xib; sourceTree = "<group>"; };
|
||||
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
3772FEA813DE0B6B00F79537 /* SUVersionDisplayProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUVersionDisplayProtocol.h; sourceTree = "<group>"; };
|
||||
525A278F133D6AE900FD8D70 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
4607BEA21948443800EF8DA4 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
4607BEA31948443800EF8DA4 /* nb */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nb; path = nb.lproj/SUAutomaticUpdateAlert.xib; sourceTree = "<group>"; };
|
||||
4607BEA41948443800EF8DA4 /* nb */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nb; path = nb.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
||||
4607BEA51948443800EF8DA4 /* nb */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nb; path = nb.lproj/SUUpdatePermissionPrompt.xib; sourceTree = "<group>"; };
|
||||
525A278F133D6AE900FD8D70 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
550347001370023A00AE7681 /* Sparkle.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Sparkle.icns; sourceTree = "<group>"; };
|
||||
55C14BB7136EEF1500649790 /* Autoupdate.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Autoupdate.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
55C14BB9136EEF1500649790 /* finish_installation-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "finish_installation-Info.plist"; sourceTree = "<group>"; };
|
||||
@@ -265,16 +266,16 @@
|
||||
5D06E8E00FD68CC7005AE3F6 /* SUBinaryDeltaApply.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaApply.m; sourceTree = "<group>"; };
|
||||
5D06E8E10FD68CC7005AE3F6 /* SUBinaryDeltaCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBinaryDeltaCommon.h; sourceTree = "<group>"; };
|
||||
5D06E8E20FD68CC7005AE3F6 /* SUBinaryDeltaCommon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaCommon.m; sourceTree = "<group>"; };
|
||||
5D06E8E30FD68CC7005AE3F6 /* SUBinaryDeltaTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaTool.m; sourceTree = "<group>"; };
|
||||
5D06E8E30FD68CC7005AE3F6 /* SUBinaryDeltaTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaTool.m; sourceTree = "<group>"; usesTabs = 0; };
|
||||
5D06E8F10FD68D21005AE3F6 /* ConfigBinaryDelta.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigBinaryDelta.xcconfig; sourceTree = "<group>"; };
|
||||
5D06E8F20FD68D21005AE3F6 /* ConfigBinaryDeltaDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigBinaryDeltaDebug.xcconfig; sourceTree = "<group>"; };
|
||||
5D06E8F30FD68D21005AE3F6 /* ConfigBinaryDeltaRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigBinaryDeltaRelease.xcconfig; sourceTree = "<group>"; };
|
||||
5D06E8FB0FD68D61005AE3F6 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = /usr/lib/libbz2.dylib; sourceTree = "<absolute>"; };
|
||||
5D06E8FB0FD68D61005AE3F6 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; };
|
||||
5D06E9370FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBinaryDeltaUnarchiver.h; sourceTree = "<group>"; };
|
||||
5D06E9380FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaUnarchiver.m; sourceTree = "<group>"; };
|
||||
5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxar.1.dylib; path = /usr/lib/libxar.1.dylib; sourceTree = "<absolute>"; };
|
||||
5D1AF58F0FD767AD0065DB48 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; };
|
||||
5D1AF5990FD767E50065DB48 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
|
||||
5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxar.1.dylib; path = usr/lib/libxar.1.dylib; sourceTree = SDKROOT; };
|
||||
5D1AF58F0FD767AD0065DB48 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
|
||||
5D1AF5990FD767E50065DB48 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
|
||||
610134710DD250470049ACDF /* SUUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdateDriver.h; sourceTree = "<group>"; };
|
||||
610134720DD250470049ACDF /* SUUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdateDriver.m; sourceTree = "<group>"; };
|
||||
610134790DD2541A0049ACDF /* SUProbingUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUProbingUpdateDriver.h; sourceTree = "<group>"; };
|
||||
@@ -290,16 +291,15 @@
|
||||
61131A050F846CE600E97AF6 /* da */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61131A090F846D0A00E97AF6 /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61131A0A0F846D1100E97AF6 /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
6117796E0D1112E000749C97 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
|
||||
6117796E0D1112E000749C97 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
|
||||
61180BC80D64138900B4E0D1 /* SUWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUWindowController.h; sourceTree = "<group>"; };
|
||||
61180BC90D64138900B4E0D1 /* SUWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUWindowController.m; sourceTree = "<group>"; };
|
||||
611A904210240DD300CC659E /* pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
611A904610240DF700CC659E /* ja */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAutomaticUpdateAlert.h; sourceTree = "<group>"; };
|
||||
6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAutomaticUpdateAlert.m; sourceTree = "<group>"; };
|
||||
612279D90DB5470200AB99EA /* Sparkle Unit Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Sparkle Unit Tests.octest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
612279D90DB5470200AB99EA /* Sparkle Unit Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Sparkle Unit Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
612279DA0DB5470200AB99EA /* Sparkle Unit Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Sparkle Unit Tests-Info.plist"; path = "Tests/Sparkle Unit Tests-Info.plist"; sourceTree = "<group>"; };
|
||||
61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUVersionComparisonTest.h; path = Tests/SUVersionComparisonTest.h; sourceTree = "<group>"; };
|
||||
61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUVersionComparisonTest.m; path = Tests/SUVersionComparisonTest.m; sourceTree = "<group>"; };
|
||||
6129984309C9E2DA00B7442F /* SUPlainInstallerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPlainInstallerInternals.h; sourceTree = "<group>"; };
|
||||
61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUDSAVerifier.h; sourceTree = "<group>"; };
|
||||
@@ -355,7 +355,7 @@
|
||||
61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SUUpdater.h; sourceTree = "<group>"; };
|
||||
61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUUpdater.m; sourceTree = "<group>"; };
|
||||
61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUPlainInstallerInternals.m; sourceTree = "<group>"; };
|
||||
61B5F8F609C4CEB300B25A18 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
|
||||
61B5F8F609C4CEB300B25A18 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Sparkle Test App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
61B5F90409C4CEE200B25A18 /* Test Application-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Test Application-Info.plist"; path = "Test Application/Test Application-Info.plist"; sourceTree = "<group>"; };
|
||||
61B5F92409C4CFC900B25A18 /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = main.m; path = "Test Application/main.m"; sourceTree = "<group>"; };
|
||||
@@ -363,7 +363,7 @@
|
||||
61B5F92D09C4CFD800B25A18 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = "Test Application/English.lproj/MainMenu.xib"; sourceTree = "<group>"; };
|
||||
61B5FB9409C4F04600B25A18 /* SUAppcast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAppcast.h; sourceTree = "<group>"; };
|
||||
61B5FB9509C4F04600B25A18 /* SUAppcast.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAppcast.m; sourceTree = "<group>"; };
|
||||
61B5FC3F09C4FD4000B25A18 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = "<absolute>"; };
|
||||
61B5FC3F09C4FD4000B25A18 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
61B5FC5309C5182000B25A18 /* SUAppcastItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAppcastItem.h; sourceTree = "<group>"; };
|
||||
61B5FC5409C5182000B25A18 /* SUAppcastItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAppcastItem.m; sourceTree = "<group>"; };
|
||||
61B5FCA009C5228F00B25A18 /* SUUpdateAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdateAlert.h; sourceTree = "<group>"; };
|
||||
@@ -474,9 +474,9 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5D06E8D00FD68C7C005AE3F6 /* BinaryDelta */,
|
||||
55C14BB7136EEF1500649790 /* finish_installation.app */,
|
||||
55C14BB7136EEF1500649790 /* Autoupdate.app */,
|
||||
61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */,
|
||||
612279D90DB5470200AB99EA /* Sparkle Unit Tests.octest */,
|
||||
612279D90DB5470200AB99EA /* Sparkle Unit Tests.xctest */,
|
||||
8DC2EF5B0486A6940098B216 /* Sparkle.framework */,
|
||||
);
|
||||
name = Products;
|
||||
@@ -495,14 +495,14 @@
|
||||
089C1665FE841158C02AAC07 /* Framework Resources */,
|
||||
61227A100DB5484000AB99EA /* Tests */,
|
||||
61B5F91D09C4CF7F00B25A18 /* Test Application Sources */,
|
||||
0867D69AFE84028FC02AAC07 /* Apple Frameworks and Libraries */,
|
||||
0867D69AFE84028FC02AAC07 /* Frameworks */,
|
||||
FA1941C40D94A6EA00DD942E /* Configurations */,
|
||||
034768DFFF38A50411DB9C8B /* Products */,
|
||||
);
|
||||
name = Sparkle;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0867D69AFE84028FC02AAC07 /* Apple Frameworks and Libraries */ = {
|
||||
0867D69AFE84028FC02AAC07 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0867D6A5FE840307C02AAC07 /* AppKit.framework */,
|
||||
@@ -517,7 +517,7 @@
|
||||
55C14F31136EFC2400649790 /* SystemConfiguration.framework */,
|
||||
61B5FC3F09C4FD4000B25A18 /* WebKit.framework */,
|
||||
);
|
||||
name = "Apple Frameworks and Libraries";
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
089C1665FE841158C02AAC07 /* Framework Resources */ = {
|
||||
@@ -585,7 +585,6 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
612279DA0DB5470200AB99EA /* Sparkle Unit Tests-Info.plist */,
|
||||
61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */,
|
||||
61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */,
|
||||
);
|
||||
name = Tests;
|
||||
@@ -781,7 +780,6 @@
|
||||
6158A1C5137904B300487EC1 /* SUUpdater_Private.h in Headers */,
|
||||
61A354550DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h in Headers */,
|
||||
61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */,
|
||||
61699BCC0DDB92BD005878A4 /* SUVersionComparisonTest.h in Headers */,
|
||||
3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */,
|
||||
61180BCA0D64138900B4E0D1 /* SUWindowController.h in Headers */,
|
||||
);
|
||||
@@ -803,6 +801,7 @@
|
||||
dependencies = (
|
||||
);
|
||||
name = finish_installation;
|
||||
productName = finish_installation;
|
||||
productReference = 55C14BB7136EEF1500649790 /* Autoupdate.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
@@ -840,8 +839,8 @@
|
||||
);
|
||||
name = "Sparkle Unit Tests";
|
||||
productName = "Sparkle Unit Tests";
|
||||
productReference = 612279D90DB5470200AB99EA /* Sparkle Unit Tests.octest */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
productReference = 612279D90DB5470200AB99EA /* Sparkle Unit Tests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
61B5F90109C4CEE200B25A18 /* Sparkle Test App */ = {
|
||||
isa = PBXNativeTarget;
|
||||
@@ -937,6 +936,7 @@
|
||||
sl,
|
||||
uk,
|
||||
ar,
|
||||
nb,
|
||||
);
|
||||
mainGroup = 0867D691FE84028FC02AAC07 /* Sparkle */;
|
||||
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
|
||||
@@ -985,7 +985,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
55C14F3B136EFCB300649790 /* finish_installation.app in Resources */,
|
||||
55C14F3B136EFCB300649790 /* Autoupdate.app in Resources */,
|
||||
61C2680A0E2DB5D000175E6C /* License.txt in Resources */,
|
||||
61AAE8280A321A7F00D8810D /* Sparkle.strings in Resources */,
|
||||
55C14BEE136EF20D00649790 /* SUAutomaticUpdateAlert.xib in Resources */,
|
||||
@@ -1210,7 +1210,6 @@
|
||||
55C14BE6136EF20D00649790 /* pl */,
|
||||
55C14BE7136EF20D00649790 /* pt_BR */,
|
||||
6158A1BA1378F68100487EC1 /* pt_PT */,
|
||||
004D573A1766A31600E4B27E /* ro */,
|
||||
55C14BE9136EF20D00649790 /* ru */,
|
||||
55C14BEA136EF20D00649790 /* sk */,
|
||||
61BA66DA14BDFC5500D02D86 /* sl */,
|
||||
@@ -1220,6 +1219,8 @@
|
||||
0263187514FEBB42005EBF43 /* uk */,
|
||||
55C14BEC136EF20D00649790 /* zh_CN */,
|
||||
55C14BED136EF20D00649790 /* zh_TW */,
|
||||
004A8653192A492B00C9730D /* ro */,
|
||||
4607BEA31948443800EF8DA4 /* nb */,
|
||||
);
|
||||
name = SUAutomaticUpdateAlert.xib;
|
||||
sourceTree = "<group>";
|
||||
@@ -1242,7 +1243,6 @@
|
||||
55C14BFC136EF26100649790 /* pl */,
|
||||
55C14BFD136EF26100649790 /* pt_BR */,
|
||||
6158A1BB1378F68100487EC1 /* pt_PT */,
|
||||
004D57391766A31600E4B27E /* ro */,
|
||||
55C14BFF136EF26100649790 /* ru */,
|
||||
55C14C00136EF26100649790 /* sk */,
|
||||
61BA66DB14BDFC5500D02D86 /* sl */,
|
||||
@@ -1252,6 +1252,8 @@
|
||||
0263187614FEBB42005EBF43 /* uk */,
|
||||
55C14C02136EF26100649790 /* zh_CN */,
|
||||
55C14C03136EF26100649790 /* zh_TW */,
|
||||
004A8654192A492B00C9730D /* ro */,
|
||||
4607BEA41948443800EF8DA4 /* nb */,
|
||||
);
|
||||
name = SUUpdateAlert.xib;
|
||||
sourceTree = "<group>";
|
||||
@@ -1274,7 +1276,6 @@
|
||||
55C14C11136EF2C700649790 /* pl */,
|
||||
55C14C12136EF2C700649790 /* pt_BR */,
|
||||
6158A1B81378F64700487EC1 /* pt_PT */,
|
||||
004D57381766A31600E4B27E /* ro */,
|
||||
55C14C14136EF2C700649790 /* ru */,
|
||||
55C14C15136EF2C700649790 /* sk */,
|
||||
61BA66DC14BDFC5500D02D86 /* sl */,
|
||||
@@ -1284,6 +1285,8 @@
|
||||
0263187714FEBB42005EBF43 /* uk */,
|
||||
55C14C17136EF2C700649790 /* zh_CN */,
|
||||
55C14C18136EF2C700649790 /* zh_TW */,
|
||||
004A8655192A492B00C9730D /* ro */,
|
||||
4607BEA51948443800EF8DA4 /* nb */,
|
||||
);
|
||||
name = SUUpdatePermissionPrompt.xib;
|
||||
sourceTree = "<group>";
|
||||
@@ -1306,7 +1309,6 @@
|
||||
611A904210240DD300CC659E /* pl */,
|
||||
61E31A80103299500051D188 /* pt_BR */,
|
||||
6186554310D7484E00B1E074 /* pt_PT */,
|
||||
004D57371766A31600E4B27E /* ro */,
|
||||
6195D4920E404AD700D41A50 /* ru */,
|
||||
FE5536F617A2C6AB007CB333 /* sk */,
|
||||
61BA66CC14BDFA0400D02D86 /* sl */,
|
||||
@@ -1316,6 +1318,8 @@
|
||||
0263187214FEBB31005EBF43 /* uk */,
|
||||
61131A090F846D0A00E97AF6 /* zh_CN */,
|
||||
61131A0A0F846D1100E97AF6 /* zh_TW */,
|
||||
004A8652192A492B00C9730D /* ro */,
|
||||
4607BEA21948443800EF8DA4 /* nb */,
|
||||
);
|
||||
name = Sparkle.strings;
|
||||
sourceTree = "<group>";
|
||||
@@ -1324,7 +1328,6 @@
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
61B5F92B09C4CFD800B25A18 /* English */,
|
||||
004D573C1766A31600E4B27E /* ro */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
@@ -1333,7 +1336,6 @@
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
61B5F92D09C4CFD800B25A18 /* English */,
|
||||
004D573D1766A31600E4B27E /* ro */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
@@ -1360,7 +1362,7 @@
|
||||
1DEB91B208733DA50010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
@@ -1369,7 +1371,7 @@
|
||||
1DEB91B308733DA50010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
@@ -1385,6 +1387,7 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = finish_installation.pch;
|
||||
INFOPLIST_FILE = "finish_installation-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
Foundation,
|
||||
@@ -1406,6 +1409,7 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = finish_installation.pch;
|
||||
INFOPLIST_FILE = "finish_installation-Info.plist";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
Foundation,
|
||||
@@ -1454,6 +1458,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = FA1941CB0D94A70100DD942E /* ConfigTestAppDebug.xcconfig */;
|
||||
buildSettings = {
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -1461,6 +1466,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = FA1941D20D94A70100DD942E /* ConfigTestAppRelease.xcconfig */;
|
||||
buildSettings = {
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// SUVersionComparisonTest.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 4/15/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import <SenTestingKit/SenTestingKit.h>
|
||||
|
||||
|
||||
@interface SUVersionComparisonTest : SenTestCase {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -6,12 +6,17 @@
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUVersionComparisonTest.h"
|
||||
#import "SUStandardVersionComparator.h"
|
||||
|
||||
@implementation SUVersionComparisonTest
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#define SUAssertOrder(a,b,c) STAssertTrue([[SUStandardVersionComparator defaultComparator] compareVersion:a toVersion:b] == c, @"b should be newer than a!")
|
||||
@interface SUVersionComparisonTestCase : XCTestCase {
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation SUVersionComparisonTestCase
|
||||
|
||||
#define SUAssertOrder(a,b,c) XCTAssertTrue([[SUStandardVersionComparator defaultComparator] compareVersion:a toVersion:b] == c, @"b should be newer than a!")
|
||||
#define SUAssertAscending(a, b) SUAssertOrder(a,b,NSOrderedAscending)
|
||||
#define SUAssertDescending(a, b) SUAssertOrder(a,b,NSOrderedDescending)
|
||||
#define SUAssertEqual(a, b) SUAssertOrder(a,b,NSOrderedSame)
|
||||
@@ -46,7 +51,9 @@
|
||||
SUAssertAscending(@"1.0b5 (1234)", @"1.0b5 (1235)");
|
||||
SUAssertAscending(@"1.0b5 (1234)", @"1.0.1b5 (1234)");
|
||||
SUAssertAscending(@"1.0.1b5 (1234)", @"1.0.1b6 (1234)");
|
||||
|
||||
SUAssertAscending(@"2.0.0.2429", @"2.0.0.2430");
|
||||
SUAssertAscending(@"1.1.1.1818", @"2.0.0.2430");
|
||||
|
||||
SUAssertAscending(@"3.3 (5847)", @"3.3.1b1 (5902)");
|
||||
}
|
||||
|
||||
|
||||
+40
-38
@@ -39,10 +39,11 @@
|
||||
|
||||
@implementation TerminationListener
|
||||
|
||||
- (id) initWithHostPath:(const char *)inhostpath executablePath:(const char *)execpath parentProcessId:(pid_t)ppid folderPath:(const char*)infolderpath shouldRelaunch:(BOOL)relaunch shouldShowUI:(BOOL)showUI selfPath:(NSString*)inSelfPath
|
||||
- (instancetype) initWithHostPath:(const char *)inhostpath executablePath:(const char *)execpath parentProcessId:(pid_t)ppid folderPath:(const char*)infolderpath shouldRelaunch:(BOOL)relaunch shouldShowUI:(BOOL)showUI selfPath:(NSString*)inSelfPath
|
||||
{
|
||||
if( !(self = [super init]) )
|
||||
if (!(self = [super init])) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
hostpath = inhostpath;
|
||||
executablepath = execpath;
|
||||
@@ -99,10 +100,10 @@
|
||||
|
||||
- (void) watchdog:(NSTimer *)aTimer
|
||||
{
|
||||
ProcessSerialNumber psn;
|
||||
if (GetProcessForPID(parentprocessid, &psn) == procNotFound)
|
||||
if (![NSRunningApplication runningApplicationWithProcessIdentifier:parentprocessid]) {
|
||||
[self parentHasQuit];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showAppIconInDock:(NSTimer *)aTimer;
|
||||
{
|
||||
@@ -173,44 +174,45 @@
|
||||
|
||||
int main (int argc, const char * argv[])
|
||||
{
|
||||
if( argc < 5 || argc > 7 )
|
||||
if (argc < 5 || argc > 7) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
//ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
//TransformProcessType( &psn, kProcessTransformToForegroundApplication );
|
||||
@autoreleasepool {
|
||||
//ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
//TransformProcessType( &psn, kProcessTransformToForegroundApplication );
|
||||
|
||||
#if 0 // Cmdline tool
|
||||
NSString* selfPath = nil;
|
||||
if (argv[0][0] == '/') {
|
||||
selfPath = [[NSFileManager defaultManager] stringWithFileSystemRepresentation: argv[0] length: strlen(argv[0])];
|
||||
}
|
||||
else
|
||||
{
|
||||
selfPath = [[NSFileManager defaultManager] currentDirectoryPath];
|
||||
selfPath = [selfPath stringByAppendingPathComponent: [[NSFileManager defaultManager] stringWithFileSystemRepresentation: argv[0] length: strlen(argv[0])]];
|
||||
}
|
||||
#else
|
||||
NSString* selfPath = [[NSBundle mainBundle] bundlePath];
|
||||
#endif
|
||||
|
||||
BOOL shouldShowUI = (argc > 6) ? atoi(argv[6]) : 1;
|
||||
if (shouldShowUI)
|
||||
{
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
|
||||
}
|
||||
|
||||
[NSApplication sharedApplication];
|
||||
[[[TerminationListener alloc] initWithHostPath: (argc > 1) ? argv[1] : NULL
|
||||
executablePath: (argc > 2) ? argv[2] : NULL
|
||||
parentProcessId: (argc > 3) ? atoi(argv[3]) : 0
|
||||
folderPath: (argc > 4) ? argv[4] : NULL
|
||||
shouldRelaunch: (argc > 5) ? atoi(argv[5]) : 1
|
||||
shouldShowUI: shouldShowUI
|
||||
selfPath: selfPath] autorelease];
|
||||
[[NSApplication sharedApplication] run];
|
||||
|
||||
#if 0 // Cmdline tool
|
||||
NSString* selfPath = nil;
|
||||
if( argv[0][0] == '/' )
|
||||
selfPath = [[NSFileManager defaultManager] stringWithFileSystemRepresentation: argv[0] length: strlen(argv[0])];
|
||||
else
|
||||
{
|
||||
selfPath = [[NSFileManager defaultManager] currentDirectoryPath];
|
||||
selfPath = [selfPath stringByAppendingPathComponent: [[NSFileManager defaultManager] stringWithFileSystemRepresentation: argv[0] length: strlen(argv[0])]];
|
||||
}
|
||||
#else
|
||||
NSString* selfPath = [[NSBundle mainBundle] bundlePath];
|
||||
#endif
|
||||
|
||||
BOOL shouldShowUI = (argc > 6) ? atoi(argv[6]) : 1;
|
||||
if (shouldShowUI)
|
||||
{
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
|
||||
}
|
||||
|
||||
[NSApplication sharedApplication];
|
||||
[[[TerminationListener alloc] initWithHostPath: (argc > 1) ? argv[1] : NULL
|
||||
executablePath: (argc > 2) ? argv[2] : NULL
|
||||
parentProcessId: (argc > 3) ? atoi(argv[3]) : 0
|
||||
folderPath: (argc > 4) ? argv[4] : NULL
|
||||
shouldRelaunch: (argc > 5) ? atoi(argv[5]) : 1
|
||||
shouldShowUI: shouldShowUI
|
||||
selfPath: selfPath] autorelease];
|
||||
[[NSApplication sharedApplication] run];
|
||||
|
||||
[pool drain];
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/ruby
|
||||
["dsaparam.pem", "dsa_priv.pem", "dsa_pub.pem"].each do |file|
|
||||
if File.exist? file
|
||||
puts "There's already a #{file} here! Move it aside or be more careful!"
|
||||
exit
|
||||
end
|
||||
end
|
||||
openssl = "/usr/bin/openssl"
|
||||
`#{openssl} dsaparam 1024 < /dev/urandom > dsaparam.pem`
|
||||
`#{openssl} gendsa dsaparam.pem -out dsa_priv.pem`
|
||||
`#{openssl} dsa -in dsa_priv.pem -pubout -out dsa_pub.pem`
|
||||
`rm dsaparam.pem`
|
||||
puts "\nGenerated private and public keys: dsa_priv.pem and dsa_pub.pem.\n
|
||||
BACK UP YOUR PRIVATE KEY AND KEEP IT SAFE!\n
|
||||
If you lose it, your users will be unable to upgrade!\n"
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
for file in "dsaparam.pem" "dsa_priv.pem" "dsa_pub.pem"; do
|
||||
if [ -e "$file" ]; then
|
||||
echo "There's already a $file here! Move it aside or be more careful!"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
openssl="/usr/bin/openssl"
|
||||
$openssl gendsa <($openssl dsaparam 4096) -out dsa_priv.pem
|
||||
chmod 0400 dsa_priv.pem
|
||||
$openssl dsa -in dsa_priv.pem -pubout -out dsa_pub.pem
|
||||
chmod 0444 dsa_pub.pem
|
||||
|
||||
echo "
|
||||
Generated private and public keys: dsa_priv.pem and dsa_pub.pem.
|
||||
BACK UP YOUR PRIVATE KEY AND KEEP IT SAFE!
|
||||
If you lose it, your users will be unable to upgrade!"
|
||||
|
||||
open -R dsa_priv.pem
|
||||
+193
-1077
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13D65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="1050" defaultVersion="1060" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SUAutomaticUpdateAlert">
|
||||
<connections>
|
||||
<outlet property="window" destination="5" id="22"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Window">
|
||||
<windowStyleMask key="styleMask" titled="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="114" y="521" width="616" height="152"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
|
||||
<value key="minSize" type="size" width="511" height="152"/>
|
||||
<view key="contentView" id="6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="616" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView id="7">
|
||||
<rect key="frame" x="23" y="73" width="64" height="64"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSApplicationIcon" id="38"/>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="applicationIcon" id="10"/>
|
||||
</connections>
|
||||
</imageView>
|
||||
<textField verticalHuggingPriority="750" id="8">
|
||||
<rect key="frame" x="105" y="120" width="497" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="39">
|
||||
<font key="font" metaFont="systemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="titleText" id="11"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="9">
|
||||
<rect key="frame" x="105" y="81" width="497" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="40">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="descriptionText" id="14"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" id="15">
|
||||
<rect key="frame" x="429" y="12" width="181" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Installer og start på ny" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="41">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
DQ
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="installNow:" target="-2" id="33"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" id="16">
|
||||
<rect key="frame" x="273" y="12" width="156" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Installer og avslutt" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="42">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
Gw
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="installLater:" target="-2" id="34"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" id="30">
|
||||
<rect key="frame" x="100" y="12" width="121" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<buttonCell key="cell" type="push" title="Ikke installer" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="44">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="doNotInstall:" target="-2" id="35"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button id="17">
|
||||
<rect key="frame" x="105" y="58" width="619" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<buttonCell key="cell" type="check" title="Last ned og installer automatisk i fremtiden" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="43">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="18" name="value" keyPath="values.SUAutomaticallyUpdate" id="19"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
</window>
|
||||
<userDefaultsController representsSharedInstance="YES" id="18" userLabel="Shared Defaults"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="128" height="128"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13D65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="1050" defaultVersion="1060" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
|
||||
<plugIn identifier="com.apple.WebKitIBPlugin" version="5056"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SUUpdateAlert">
|
||||
<connections>
|
||||
<outlet property="description" destination="101" id="105"/>
|
||||
<outlet property="installButton" destination="76" id="176"/>
|
||||
<outlet property="laterButton" destination="22" id="177"/>
|
||||
<outlet property="releaseNotesView" destination="18" id="32"/>
|
||||
<outlet property="skipButton" destination="23" id="178"/>
|
||||
<outlet property="window" destination="5" id="69"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<window title="Programoppdatering" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="248" y="468" width="575" height="370"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
|
||||
<value key="minSize" type="size" width="575" height="370"/>
|
||||
<view key="contentView" id="6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="575" height="370"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView id="7">
|
||||
<rect key="frame" x="24" y="291" width="64" height="64"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSApplicationIcon" id="168"/>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="applicationIcon" id="9"/>
|
||||
</connections>
|
||||
</imageView>
|
||||
<textField verticalHuggingPriority="750" id="10">
|
||||
<rect key="frame" x="106" y="338" width="452" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="169">
|
||||
<font key="font" metaFont="systemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="titleText" id="11"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="17">
|
||||
<rect key="frame" x="106" y="280" width="452" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Om oppdateringen:" id="170">
|
||||
<font key="font" metaFont="smallSystemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="hidden" keyPath="showsReleaseNotes" id="72">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSNegateBoolean</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" id="22">
|
||||
<rect key="frame" x="315" y="12" width="111" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Utsett" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="171">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
Gw
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="remindMeLater:" target="-2" id="34"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" id="23">
|
||||
<rect key="frame" x="103" y="12" width="165" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Hopp over" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="172">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="skipThisVersion:" target="-2" id="33"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" id="76">
|
||||
<rect key="frame" x="426" y="12" width="135" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Installer" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" inset="2" id="173">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
DQ
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="installUpdate:" target="-2" id="77"/>
|
||||
</connections>
|
||||
</button>
|
||||
<box boxType="oldStyle" borderType="line" titlePosition="noTitle" id="89">
|
||||
<rect key="frame" x="110" y="76" width="445" height="199"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<view key="contentView">
|
||||
<rect key="frame" x="1" y="1" width="443" height="197"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<webView maintainsBackForwardList="NO" id="18">
|
||||
<rect key="frame" x="-2" y="-1" width="445" height="199"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12"/>
|
||||
<connections>
|
||||
<binding destination="-2" name="hidden" keyPath="showsReleaseNotes" id="161">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSNegateBoolean</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</webView>
|
||||
</subviews>
|
||||
</view>
|
||||
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
||||
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<font key="titleFont" size="11" name="LucidaGrande"/>
|
||||
<connections>
|
||||
<binding destination="-2" name="hidden" keyPath="showsReleaseNotes" id="164">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSNegateBoolean</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</box>
|
||||
<textField verticalHuggingPriority="750" id="101">
|
||||
<rect key="frame" x="106" y="302" width="452" height="28"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="left" id="174">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="descriptionText" id="103"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<button id="117">
|
||||
<rect key="frame" x="106" y="50" width="451" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Last ned og installer automatisk i fremtiden" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="175">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="hidden" keyPath="allowsAutomaticUpdates" id="141">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSNegateBoolean</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<binding destination="93" name="value" keyPath="values.SUAutomaticallyUpdate" id="135"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="50"/>
|
||||
</connections>
|
||||
</window>
|
||||
<userDefaultsController representsSharedInstance="YES" id="93" userLabel="Shared Defaults"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="128" height="128"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,224 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13D65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment version="1050" defaultVersion="1060" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SUUpdatePermissionPrompt">
|
||||
<connections>
|
||||
<outlet property="descriptionTextField" destination="33" id="133"/>
|
||||
<outlet property="moreInfoButton" destination="71" id="132"/>
|
||||
<outlet property="moreInfoView" destination="39" id="127"/>
|
||||
<outlet property="profileTableView" destination="41" id="187"/>
|
||||
<outlet property="window" destination="5" id="126"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="5" userLabel="Profile Info">
|
||||
<windowStyleMask key="styleMask" titled="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="83" y="492" width="438" height="168"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1418"/>
|
||||
<value key="minSize" type="size" width="213" height="107"/>
|
||||
<view key="contentView" id="6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="438" height="168"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" tag="1" id="13">
|
||||
<rect key="frame" x="286" y="12" width="137" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Søk automatisk" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" tag="1" inset="2" id="176">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
DQ
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="finishPrompt:" target="-2" id="144"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" id="14">
|
||||
<rect key="frame" x="194" y="12" width="92" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Ikke søk" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="177">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
Gw
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="finishPrompt:" target="-2" id="145"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" id="32">
|
||||
<rect key="frame" x="104" y="114" width="289" height="34"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Søk etter oppdateringer automatisk?" id="178">
|
||||
<font key="font" metaFont="systemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="33">
|
||||
<rect key="frame" x="104" y="81" width="315" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="DO NOT LOCALIZE" id="179">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="promptDescription" id="161"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<button focusRingType="none" id="34">
|
||||
<rect key="frame" x="104" y="53" width="278" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Inkluder anonym systemprofil" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" focusRingType="none" inset="2" id="180">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="hidden" keyPath="shouldAskAboutProfile" id="143">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSNegateBoolean</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<binding destination="-2" name="value" keyPath="shouldSendProfile" id="148">
|
||||
<dictionary key="options">
|
||||
<integer key="NSNullPlaceholder" value="1"/>
|
||||
<bool key="NSValidatesImmediately" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<imageView id="37">
|
||||
<rect key="frame" x="23" y="84" width="64" height="64"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" animates="YES" imageScaling="axesIndependently" image="NSApplicationIcon" id="181"/>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="icon" id="130"/>
|
||||
</connections>
|
||||
</imageView>
|
||||
<button focusRingType="none" horizontalHuggingPriority="750" verticalHuggingPriority="750" id="71">
|
||||
<rect key="frame" x="80" y="50" width="27" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="disclosureTriangle" bezelStyle="disclosure" imagePosition="overlaps" alignment="center" borderStyle="border" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="182">
|
||||
<behavior key="behavior" pushIn="YES" changeBackground="YES" changeGray="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="toggleMoreInfo:" target="-2" id="131"/>
|
||||
<binding destination="-2" name="hidden" keyPath="shouldAskAboutProfile" id="139">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSNegateBoolean</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
</window>
|
||||
<arrayController editable="NO" preservesSelection="NO" selectsInsertedObjects="NO" avoidsEmptySelection="NO" id="24" userLabel="Array Controller">
|
||||
<declaredKeys>
|
||||
<string>visibleKey</string>
|
||||
<string>visibleValue</string>
|
||||
<string>displayValue</string>
|
||||
<string>displayKey</string>
|
||||
</declaredKeys>
|
||||
<connections>
|
||||
<binding destination="-2" name="contentArray" keyPath="systemProfileInformationArray" id="25"/>
|
||||
</connections>
|
||||
</arrayController>
|
||||
<customView id="39" userLabel="MoreInfoView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="362" height="205"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" id="46">
|
||||
<rect key="frame" x="1" y="128" width="358" height="70"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="183">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<string key="title">Den anonyme systemprofilen hjelper oss med å planlegge fremtidig utviklingsarbeid. Ta gjerne kontakt med oss hvis du har spørsmål om dette.
|
||||
Følgende innhold vil bli sendt:</string>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<scrollView autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="0.0" verticalLineScroll="16" verticalPageScroll="0.0" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="40">
|
||||
<rect key="frame" x="4" y="5" width="355" height="115"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<clipView key="contentView" id="Elp-MM-i9I">
|
||||
<rect key="frame" x="1" y="1" width="353" height="113"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="14" id="41">
|
||||
<rect key="frame" x="0.0" y="0.0" width="353" height="113"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn editable="NO" width="128" minWidth="40" maxWidth="1000" id="42">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" controlSize="small" selectable="YES" alignment="left" title="Text Cell" id="43">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<connections>
|
||||
<binding destination="24" name="value" keyPath="arrangedObjects.displayKey" id="174"/>
|
||||
</connections>
|
||||
</tableColumn>
|
||||
<tableColumn editable="NO" width="219" minWidth="40" maxWidth="1000" id="44">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" controlSize="small" selectable="YES" alignment="left" title="Text Cell" id="45">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<connections>
|
||||
<binding destination="24" name="value" keyPath="arrangedObjects.displayValue" id="173"/>
|
||||
</connections>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="YES" id="185">
|
||||
<rect key="frame" x="-100" y="-100" width="345" height="11"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="NO" id="184">
|
||||
<rect key="frame" x="-22" y="1" width="11" height="125"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
</customView>
|
||||
<userDefaultsController id="49" userLabel="User Defaults Controller">
|
||||
<declaredKeys>
|
||||
<string>SUIncludeProfile</string>
|
||||
<string>SUSendProfileInfo</string>
|
||||
</declaredKeys>
|
||||
</userDefaultsController>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="128" height="128"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,84 @@
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ er lastet ned og er klar til bruk! Dette er en viktig oppdatering; ø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.";
|
||||
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ er nyeste versjon.";
|
||||
|
||||
"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ er nå tilgjengelig—du har %3$@. Ønsker du å laste ned og installere nå?";
|
||||
|
||||
"%@ downloaded" = "%@ lastet ned";
|
||||
|
||||
"%@ of %@" = "%1$@ av %2$@";
|
||||
|
||||
"A new version of %@ is available!" = "En ny versjon av %@ er tilgjengelig!";
|
||||
|
||||
"A new version of %@ is ready to install!" = "En ny versjon av %@ er klar for installering!";
|
||||
|
||||
"An error occurred in retrieving update information. Please try again later." = "En feil oppstod ved henting av oppdateringsinformasjon. Vennligst prøv igjen senere.";
|
||||
|
||||
"An error occurred while downloading the update. Please try again later." = "En feil oppstod under nedlasting av oppdateringen. Vennligst prøv igjen senere.";
|
||||
|
||||
"An error occurred while extracting the archive. Please try again later." = "En feil oppstod under utpakking av oppdateringen. Vennligst prøv igjen senere.";
|
||||
|
||||
"An error occurred while installing the update. Please try again later." = "En feil oppstod under installering av opddateringen. Vennligst prøv igjen senere.";
|
||||
|
||||
"An error occurred while parsing the update feed." = "En feil oppstod under lesing av oppdateringsstrømmen.";
|
||||
|
||||
"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@." = "En feil oppstod under omstart av %1$@, men den nyeste versjonen vil være tilgjengelig neste gang du starter %1$@.";
|
||||
|
||||
"An important update to %@ is ready to install" = "En viktig oppdatering for %@ er klar til å installeres";
|
||||
|
||||
/* the unit for bytes */
|
||||
"B" = "B";
|
||||
|
||||
"Cancel" = "Avbryt";
|
||||
|
||||
"Cancel Update" = "Avbryt oppdateringen";
|
||||
|
||||
"Checking for updates..." = "Søker etter oppdateringer…";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Downloading update..." = "Laster ned oppdateringen…";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Extracting update..." = "Pakker ut oppdateringen…";
|
||||
|
||||
/* the unit for gigabytes */
|
||||
"GB" = "GB";
|
||||
|
||||
"Install and Relaunch" = "Installer og start på ny";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Installing update..." = "Installerer oppdateringen…";
|
||||
|
||||
/* the unit for kilobytes */
|
||||
"KB" = "KB";
|
||||
|
||||
/* the unit for megabytes */
|
||||
"MB" = "MB";
|
||||
|
||||
/* OK button. */
|
||||
"OK" = "OK";
|
||||
|
||||
/* Status message on progress window once download has finished. */
|
||||
"Ready to Install" = "Klar til å installere";
|
||||
|
||||
/* Message that is optionally shown at startup to allow users to turn on/off update checks. */
|
||||
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Skal %1$@ søke automatisk etter oppdateringer? Du kan når som helst søke manuelt fra %1$@-menyen.";
|
||||
|
||||
"Update Error!" = "Feil ved oppdateringen!";
|
||||
|
||||
"Updating %@" = "Oppdaterer %@";
|
||||
|
||||
/* 'Error' message when the user checks for updates but is already current or the feed doesn't contain any updates. (not necessarily shown in UI) */
|
||||
"You already have the newest version of %@." = "Du har allerede nyeste versjon av %@.";
|
||||
|
||||
/* 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!" = "Ingen nye oppdateringer";
|
||||
|
||||
/* Alternative name for "Install" button if we have a paid update or other update
|
||||
without a download but with a URL. */
|
||||
"Learn More..." = "Mer info…";
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
NSHumanReadableCopyright = "© Andy Matuschak, 2006";
|
||||
CFBundleShortVersionString = "1.5";
|
||||
@@ -1,354 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5037.3" systemVersion="13C44" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment defaultVersion="1060" identifier="macosx"/>
|
||||
<development version="5000" identifier="xcode"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5037.3"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication"/>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<window title="Fereastră" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="21" userLabel="Window">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="402" y="295" width="325" height="173"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="778"/>
|
||||
<value key="minSize" type="size" width="213" height="107"/>
|
||||
<view key="contentView" id="2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="325" height="173"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button id="210">
|
||||
<rect key="frame" x="21" y="112" width="225" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Caută actualizări automat" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="248">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="206" name="value" keyPath="automaticallyChecksForUpdates" id="257"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button id="216">
|
||||
<rect key="frame" x="21" y="92" width="228" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Descarcă actualizări automat" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="249">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="206" name="value" keyPath="automaticallyDownloadsUpdates" id="259"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button id="220">
|
||||
<rect key="frame" x="21" y="72" width="224" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Trimite profil anomin de sistem" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="250">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="206" name="value" keyPath="sendsSystemProfile" id="261"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button id="222">
|
||||
<rect key="frame" x="21" y="52" width="152" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="A mai fost lansată" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="251">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="212" name="value" keyPath="values.SUHasLaunchedBefore" id="225"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" id="227">
|
||||
<rect key="frame" x="20" y="136" width="106" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Opțiuni debug:" id="252">
|
||||
<font key="font" metaFont="systemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="238">
|
||||
<rect key="frame" x="17" y="20" width="181" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Caută actualizări in fiecare" id="253">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="242">
|
||||
<rect key="frame" x="252" y="20" width="56" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="seconde" id="255">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="240">
|
||||
<rect key="frame" x="191" y="20" width="56" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="254">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="206" name="value" keyPath="updateCheckInterval" id="263"/>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
</view>
|
||||
</window>
|
||||
<menu title="MainMenu" systemMenu="main" id="29" userLabel="MainMenu">
|
||||
<items>
|
||||
<menuItem title="NewApplication" id="56">
|
||||
<menu key="submenu" title="NewApplication" systemMenu="apple" id="57">
|
||||
<items>
|
||||
<menuItem title="About NewApplication" id="58">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check for Updates..." keyEquivalent="u" id="207">
|
||||
<connections>
|
||||
<action selector="checkForUpdates:" target="206" id="208"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="196">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="129"/>
|
||||
<menuItem isSeparatorItem="YES" id="143">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Services" id="131">
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="130"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="144">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Hide NewApplication" keyEquivalent="h" id="134">
|
||||
<connections>
|
||||
<action selector="hide:" target="-2" id="152"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="145">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="-2" id="146"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="150">
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="-2" id="153"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="149">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Quit NewApplication" keyEquivalent="q" id="136">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-2" id="139"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="83">
|
||||
<menu key="submenu" title="File" id="81">
|
||||
<items>
|
||||
<menuItem title="New" keyEquivalent="n" id="82"/>
|
||||
<menuItem title="Open..." keyEquivalent="o" id="72"/>
|
||||
<menuItem title="Open Recent" id="124">
|
||||
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="125">
|
||||
<items>
|
||||
<menuItem title="Clear Menu" id="126">
|
||||
<connections>
|
||||
<action selector="clearRecentDocuments:" target="-1" id="127"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="79">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Close" keyEquivalent="w" id="73">
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="193"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save" keyEquivalent="s" id="75"/>
|
||||
<menuItem title="Save As…" keyEquivalent="S" id="80"/>
|
||||
<menuItem title="Revert" id="112">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="74">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Page Setup…" keyEquivalent="P" id="77">
|
||||
<connections>
|
||||
<action selector="runPageLayout:" target="-1" id="87"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Print…" keyEquivalent="p" id="78">
|
||||
<connections>
|
||||
<action selector="print:" target="-1" id="86"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="163">
|
||||
<menu key="submenu" title="Edit" id="169">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="158">
|
||||
<connections>
|
||||
<action selector="undo:" target="-1" id="180"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="173">
|
||||
<connections>
|
||||
<action selector="redo:" target="-1" id="178"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="156">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="160">
|
||||
<connections>
|
||||
<action selector="cut:" target="-1" id="175"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="157">
|
||||
<connections>
|
||||
<action selector="copy:" target="-1" id="181"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="171">
|
||||
<connections>
|
||||
<action selector="paste:" target="-1" id="176"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste and Match Style" keyEquivalent="V" id="204">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteAsPlainText:" target="-1" id="205"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="164">
|
||||
<connections>
|
||||
<action selector="delete:" target="-1" id="195"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="172">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="-1" id="179"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="174">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Find" id="168">
|
||||
<menu key="submenu" title="Find" id="159">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="154">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="199"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="167">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="200"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="162">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="201"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="161">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="202"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="155">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="-1" id="203"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling" id="184">
|
||||
<menu key="submenu" title="Spelling" id="185">
|
||||
<items>
|
||||
<menuItem title="Spelling…" keyEquivalent=":" id="187">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="-1" id="188"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Spelling" keyEquivalent=";" id="189">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="-1" id="190"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Spelling as You Type" id="191">
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="-1" id="192"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="19">
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="24">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="23">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="-1" id="37"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="197">
|
||||
<connections>
|
||||
<action selector="performZoom:" target="-1" id="198"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="92">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Bring All to Front" keyEquivalent="p" id="5">
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="-1" id="39"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="103">
|
||||
<menu key="submenu" title="Help" id="106">
|
||||
<items>
|
||||
<menuItem title="NewApplication Help" keyEquivalent="?" id="111">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="-1" id="122"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<customObject id="206" userLabel="SUUpdater" customClass="SUUpdater"/>
|
||||
<userDefaultsController representsSharedInstance="YES" id="212" userLabel="Shared User Defaults Controller"/>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -158,7 +158,7 @@
|
||||
<object class="NSButton" id="265767855">
|
||||
<reference key="NSNextResponder" ref="683629094"/>
|
||||
<int key="NSvFlags">257</int>
|
||||
<string key="NSFrame">{{411, 12}, {194, 32}}</string>
|
||||
<string key="NSFrame">{{414, 12}, {191, 32}}</string>
|
||||
<reference key="NSSuperview" ref="683629094"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
@@ -166,7 +166,7 @@
|
||||
<object class="NSButtonCell" key="NSCell" id="5529083">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Instalează și Redeschide</string>
|
||||
<string key="NSContents">Instalează și redeschide</string>
|
||||
<object class="NSFont" key="NSSupport" id="957448308">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
@@ -185,7 +185,7 @@
|
||||
<object class="NSButton" id="389094888">
|
||||
<reference key="NSNextResponder" ref="683629094"/>
|
||||
<int key="NSvFlags">257</int>
|
||||
<string key="NSFrame">{{254, 12}, {157, 32}}</string>
|
||||
<string key="NSFrame">{{257, 12}, {157, 32}}</string>
|
||||
<reference key="NSSuperview" ref="683629094"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="265767855"/>
|
||||
@@ -193,7 +193,7 @@
|
||||
<object class="NSButtonCell" key="NSCell" id="285814029">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Instalează la Ieșire</string>
|
||||
<string key="NSContents">Instalează la ieșire</string>
|
||||
<reference key="NSSupport" ref="957448308"/>
|
||||
<reference key="NSControlView" ref="389094888"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
@@ -241,7 +241,7 @@
|
||||
<object class="NSButtonCell" key="NSCell" id="112350240">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">131072</int>
|
||||
<string key="NSContents">În viitor descarcă și instalează automat actualizările</string>
|
||||
<string key="NSContents">În viitor descarcă și instalează în automat actualizările</string>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<reference key="NSControlView" ref="649646560"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
@@ -261,7 +261,7 @@
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="684391777"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||
<string key="NSMinSize">{511, 174}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
|
||||
+17
-20
@@ -57,9 +57,9 @@
|
||||
<object class="NSWindowTemplate" id="191739834">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{346, 217}, {611, 370}}</string>
|
||||
<string key="NSWindowRect">{{248, 468}, {575, 370}}</string>
|
||||
<int key="NSWTFlags">-260571136</int>
|
||||
<string key="NSWindowTitle">Actualizare Software</string>
|
||||
<string key="NSWindowTitle">Actualizarea aplicației</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
<object class="NSMutableString" key="NSViewClass">
|
||||
<characters key="NS.bytes">View</characters>
|
||||
@@ -146,7 +146,7 @@
|
||||
<object class="NSTextField" id="139815278">
|
||||
<reference key="NSNextResponder" ref="163075390"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{106, 277}, {452, 17}}</string>
|
||||
<string key="NSFrame">{{106, 280}, {452, 14}}</string>
|
||||
<reference key="NSSuperview" ref="163075390"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="114370023"/>
|
||||
@@ -154,7 +154,7 @@
|
||||
<object class="NSTextFieldCell" key="NSCell" id="939178269">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">272629760</int>
|
||||
<string key="NSContents">Note de editie:</string>
|
||||
<string key="NSContents">Note de ediție:</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande-Bold</string>
|
||||
<double key="NSSize">11</double>
|
||||
@@ -168,7 +168,7 @@
|
||||
<object class="NSButton" id="919863842">
|
||||
<reference key="NSNextResponder" ref="163075390"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{218, 12}, {195, 32}}</string>
|
||||
<string key="NSFrame">{{205, 12}, {185, 32}}</string>
|
||||
<reference key="NSSuperview" ref="163075390"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="111369817"/>
|
||||
@@ -195,7 +195,7 @@
|
||||
<object class="NSButton" id="77541259">
|
||||
<reference key="NSNextResponder" ref="163075390"/>
|
||||
<int key="NSvFlags">288</int>
|
||||
<string key="NSFrame">{{103, 12}, {114, 32}}</string>
|
||||
<string key="NSFrame">{{103, 12}, {109, 32}}</string>
|
||||
<reference key="NSSuperview" ref="163075390"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="919863842"/>
|
||||
@@ -220,9 +220,10 @@
|
||||
<object class="NSButton" id="111369817">
|
||||
<reference key="NSNextResponder" ref="163075390"/>
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{413, 12}, {184, 32}}</string>
|
||||
<string key="NSFrame">{{385, 12}, {176, 32}}</string>
|
||||
<reference key="NSSuperview" ref="163075390"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="635120042">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
@@ -273,7 +274,7 @@
|
||||
<string>public.url-name</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{-2, -1}, {479, 199}}</string>
|
||||
<string key="NSFrame">{{-2, -1}, {445, 199}}</string>
|
||||
<reference key="NSSuperview" ref="610445114"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
@@ -301,13 +302,13 @@
|
||||
<bool key="AllowsUndo">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{1, 1}, {479, 197}}</string>
|
||||
<string key="NSFrame">{{1, 1}, {443, 197}}</string>
|
||||
<reference key="NSSuperview" ref="114370023"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="139390623"/>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{110, 76}, {481, 199}}</string>
|
||||
<string key="NSFrame">{{110, 76}, {445, 199}}</string>
|
||||
<reference key="NSSuperview" ref="163075390"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="610445114"/>
|
||||
@@ -374,7 +375,7 @@
|
||||
<object class="NSButtonCell" key="NSCell" id="10388865">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">131072</int>
|
||||
<string key="NSContents">În viitor descarcă și instalează automat actualizările</string>
|
||||
<string key="NSContents">În viitor descarcă și instalează în automat actualizările</string>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<reference key="NSControlView" ref="61494929"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
@@ -389,12 +390,12 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{611, 370}</string>
|
||||
<string key="NSFrameSize">{575, 370}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="998369947"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||
<string key="NSMinSize">{575, 392}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName"/>
|
||||
@@ -669,7 +670,7 @@
|
||||
<reference ref="163075390"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Update Alert (release notes)</string>
|
||||
<string key="objectName">Alertă actualizare (note de ediție)</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
@@ -679,12 +680,12 @@
|
||||
<reference ref="998369947"/>
|
||||
<reference ref="445247806"/>
|
||||
<reference ref="139815278"/>
|
||||
<reference ref="77541259"/>
|
||||
<reference ref="114370023"/>
|
||||
<reference ref="61494929"/>
|
||||
<reference ref="757142666"/>
|
||||
<reference ref="919863842"/>
|
||||
<reference ref="77541259"/>
|
||||
<reference ref="111369817"/>
|
||||
<reference ref="919863842"/>
|
||||
</object>
|
||||
<reference key="parent" ref="191739834"/>
|
||||
</object>
|
||||
@@ -1014,10 +1015,6 @@
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<integer value="1050" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<real value="1070" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
|
||||
@@ -70,16 +70,15 @@
|
||||
<object class="NSButton" id="420538904">
|
||||
<reference key="NSNextResponder" ref="19909334"/>
|
||||
<int key="NSvFlags">257</int>
|
||||
<string key="NSFrame">{{265, 12}, {157, 32}}</string>
|
||||
<string key="NSFrame">{{232, 12}, {192, 32}}</string>
|
||||
<reference key="NSSuperview" ref="19909334"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<int key="NSTag">1</int>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="180510974">
|
||||
<int key="NSCellFlags">-2080374784</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Verifică automat</string>
|
||||
<string key="NSContents">Verifică în mod automat</string>
|
||||
<object class="NSFont" key="NSSupport" id="300829717">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
@@ -99,7 +98,7 @@
|
||||
<object class="NSButton" id="255538383">
|
||||
<reference key="NSNextResponder" ref="19909334"/>
|
||||
<int key="NSvFlags">257</int>
|
||||
<string key="NSFrame">{{153, 12}, {107, 32}}</string>
|
||||
<string key="NSFrame">{{123, 12}, {107, 32}}</string>
|
||||
<reference key="NSSuperview" ref="19909334"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="420538904"/>
|
||||
@@ -122,7 +121,7 @@
|
||||
<object class="NSTextField" id="158215833">
|
||||
<reference key="NSNextResponder" ref="19909334"/>
|
||||
<int key="NSvFlags">264</int>
|
||||
<string key="NSFrame">{{104, 114}, {289, 34}}</string>
|
||||
<string key="NSFrame">{{104, 114}, {315, 34}}</string>
|
||||
<reference key="NSSuperview" ref="19909334"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="747062516"/>
|
||||
@@ -130,7 +129,7 @@
|
||||
<object class="NSTextFieldCell" key="NSCell" id="1061731650">
|
||||
<int key="NSCellFlags">67108864</int>
|
||||
<int key="NSCellFlags2">272629760</int>
|
||||
<string key="NSContents">Verifică actualizări în mod automat?</string>
|
||||
<string key="NSContents">Verifică pentru actualizări în mod automat?</string>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande-Bold</string>
|
||||
<double key="NSSize">13</double>
|
||||
@@ -270,7 +269,7 @@
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="834319590"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||
<string key="NSMinSize">{213, 129}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
@@ -740,7 +739,7 @@ IHNlbnQ6A</string>
|
||||
<reference ref="19909334"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Profile Info</string>
|
||||
<string key="objectName">Informații Profil</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
@@ -1151,10 +1150,6 @@ IHNlbnQ6A</string>
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<integer value="1050" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<real value="1070" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3100" key="NS.object.0"/>
|
||||
|
||||
+30
-25
@@ -1,53 +1,59 @@
|
||||
"%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! Doriți să îl instalați și să-l 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 fii actualizată atunci când este pornită de pe un volum read-only ca o imagine disc sau o unitate optică. Mută %1$@ în directorul Applications, repornește-o de acolo și încearca din nou.";
|
||||
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ este în prezent cea mai nouă versiune disponibilă.";
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ a fost descărcată și este gata de utilizare! Aceasta este o actualizare importantă; dorești să o instalezi și să relansați %1$@ acum?";
|
||||
|
||||
"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ este disponibilă—-tu ai %3$@. Doriți să o descărcați 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.";
|
||||
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ este cea ultima versiune disponibilă.";
|
||||
|
||||
"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ este disponibilă—tu ai %3$@. Dorești să o descărcarci acum?";
|
||||
|
||||
"%@ downloaded" = "%@ descărcat";
|
||||
|
||||
"%@ of %@" = "%1$@ din %2$@";
|
||||
|
||||
"A new version of %@ is available!" = "O nouă versiune %@ este disponibilă!";
|
||||
"A new version of %@ is available!" = "O nouă versiune pentru %@ este disponibilă!";
|
||||
|
||||
"A new version of %@ is ready to install!" = "O nouă versiune %@ este gata de instalare!";
|
||||
"A new version of %@ is ready to install!" = "O nouă versiune pentru %@ este gata de instalare!";
|
||||
|
||||
"An error occurred in retrieving update information. Please try again later." = "O eroare a avut loc în preluarea informaţiilor de actualizare. Vă rugăm să reîncercaţi mai târziu.";
|
||||
"An error occurred in retrieving update information. Please try again later." = "A apărut o eroare în timpul preluari informaţiilor pentru actualizare. Te rog încercă din nou mai târziu.";
|
||||
|
||||
"An error occurred while downloading the update. Please try again later." = "A apărut o eroare la descărcarea actualizării. Vă rugăm să reîncercaţi mai târziu.";
|
||||
"An error occurred while downloading the update. Please try again later." = "A apărut o eroare în timp ce se descărca actualizărea. Te rog încercă din nou mai târziu.";
|
||||
|
||||
"An error occurred while extracting the archive. Please try again later." = "O eroare a avut loc în timpul dezarhivării arhivei. Vă rugăm să reîncercaţi mai târziu.";
|
||||
"An error occurred while extracting the archive. Please try again later." = "A apărut o eroare în timpul dezarhivării. Te rog încercă din nou mai târziu.";
|
||||
|
||||
"An error occurred while installing the update. Please try again later." = "A apărut o eroare la instalarea actualizării. Vă rugăm să reîncercaţi mai târziu.";
|
||||
"An error occurred while installing the update. Please try again later." = "A apărut o eroare în timpul instalări actualizări. Te rog încercă din nou mai târziu.";
|
||||
|
||||
"An error occurred while parsing the update feed." = "A apărut o eroare la citirea feed-ului de actualizare.";
|
||||
"An error occurred while parsing the update feed." = "A apărut o eroare în timpul citiri feed-ului de actualizare.";
|
||||
|
||||
"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@." = "O eroare a avut loc în timpul relansării aplicației %1$@, dar noua versiune va fii disponibilă data viitoare când vei executa %1$@.";
|
||||
"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@." = "A apărut o eroare în timpul relansării aplicației %1$@, dar noua versiune va fii disponibilă data viitoare când vei reporni %1$@.";
|
||||
|
||||
"An important update to %@ is ready to install" = "O actualizare importantă pentru %@ este gata pentru a fi instalată";
|
||||
|
||||
/* the unit for bytes */
|
||||
"B" = "B";
|
||||
|
||||
"Cancel" = "Anula";
|
||||
"Cancel" = "Anulează";
|
||||
|
||||
"Cancel Update" = "Anulează actualizare";
|
||||
"Cancel Update" = "Anulează actualizarea";
|
||||
|
||||
"Checking for updates..." = "Verifică pentru actualizări…";
|
||||
"Checking for updates..." = "Verifică de actualizări…";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Downloading update..." = "Descarcă actualizare…";
|
||||
"Downloading update..." = "Descarcă actualizarea…";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Extracting update..." = "Dezarhivează actualizare…";
|
||||
"Extracting update..." = "Dezarhivează actualizarea…";
|
||||
|
||||
/* the unit for gigabytes */
|
||||
"GB" = "GB";
|
||||
|
||||
"Install and Relaunch" = "Instalează și Relansează";
|
||||
"Install and Relaunch" = "Instalează și Redeschide";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Installing update..." = "Instalează actualizare…";
|
||||
"Installing update..." = "Instalează actualizarea…";
|
||||
|
||||
/* the unit for kilobytes */
|
||||
"KB" = "KB";
|
||||
@@ -59,22 +65,21 @@
|
||||
"OK" = "OK";
|
||||
|
||||
/* Status message on progress window once download has finished. */
|
||||
"Ready to Install" = "Pregatit pentru instalare";
|
||||
"Ready to Install" = "Pregatit pentru a instala";
|
||||
|
||||
/* Message that is optionally shown at startup to allow users to turn on/off update checks. */
|
||||
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Ar trebui ca %1$@ să caute automat pentru actualizări? Puteți verifica mereu de actualizări din meniul %1$@.";
|
||||
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "%1$@ ar trebui ca să caute în mod automat pentru actualizări? Puteți verifica mereu pentru actualizări din meniul %1$@.";
|
||||
|
||||
"Update Error!" = "Eroare actualizare!";
|
||||
"Update Error!" = "Eroare Actualizare!";
|
||||
|
||||
"Updating %@" = "Actualizează %@";
|
||||
|
||||
/* 'Error' message when the user checks for updates but is already current or the feed doesn't contain any updates. (not necessarily shown in UI) */
|
||||
"You already have the newest version of %@." = "Aveți cea mai nouă versiune de %@.";
|
||||
"You already have the newest version of %@." = "Ai cea mai nouă versiune de %@.";
|
||||
|
||||
/* 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!" = "Ai ultima versiune!";
|
||||
|
||||
/* Alternative name for "Install" button if we have a paid update or other update
|
||||
without a download but with a URL. */
|
||||
without a download but with a URL. */
|
||||
"Learn More..." = "Află mai multe…";
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/ruby
|
||||
if ARGV.length < 2
|
||||
puts "Usage: ruby sign_update.rb update_archive private_key"
|
||||
exit
|
||||
end
|
||||
openssl = "/usr/bin/openssl"
|
||||
puts `#{openssl} dgst -sha1 -binary < "#{ARGV[0]}" | #{openssl} dgst -dss1 -sign "#{ARGV[1]}" | #{openssl} enc -base64`
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "Usage: $0 update_archive private_key"
|
||||
exit 1
|
||||
fi
|
||||
openssl=/usr/bin/openssl
|
||||
$openssl dgst -sha1 -binary < "$1" | $openssl dgst -dss1 -sign "$2" | $openssl enc -base64
|
||||
Reference in new issue
Block a user