diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..a4c9527f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,18 @@
+# Xcode
+build/*
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+*.xcworkspace
+!default.xcworkspace
+xcuserdata/
+profile
+*.moved-aside
+
+## Ignore incredibly annoying .DS_Store files
+.DS_Store
diff --git a/Configurations/ConfigBinaryDelta.xcconfig b/Configurations/ConfigBinaryDelta.xcconfig
index a53f74cb..2f84a51e 100644
--- a/Configurations/ConfigBinaryDelta.xcconfig
+++ b/Configurations/ConfigBinaryDelta.xcconfig
@@ -2,7 +2,6 @@
PRODUCT_NAME = BinaryDelta
GCC_PREFIX_HEADER =
-SDKROOT = macosx10.5
MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.5
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.5
diff --git a/Configurations/ConfigBinaryDeltaDebug.xcconfig b/Configurations/ConfigBinaryDeltaDebug.xcconfig
index 170c9756..cd893a71 100644
--- a/Configurations/ConfigBinaryDeltaDebug.xcconfig
+++ b/Configurations/ConfigBinaryDeltaDebug.xcconfig
@@ -2,4 +2,4 @@
#include "ConfigCommonDebug.xcconfig"
#include "ConfigBinaryDelta.xcconfig"
-OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
+OTHER_CFLAGS = -DDEBUG
diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig
index 3be0cb86..a1c0b540 100644
--- a/Configurations/ConfigCommon.xcconfig
+++ b/Configurations/ConfigCommon.xcconfig
@@ -3,7 +3,7 @@
PREBINDING = NO
ZERO_LINK = NO
CURRENT_PROJECT_VERSION = 1.5
-SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
+SDKROOT = macosx10.7
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.4
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.4
@@ -17,6 +17,7 @@ GCC_FAST_OBJC_DISPATCH = YES
GCC_ENABLE_PASCAL_STRINGS = NO
ARCHS = ppc i386 x86_64
GCC_VERSION = com.apple.compilers.llvm.clang.1_0
+CLANG_LINK_OBJC_RUNTIME = NO
// Enable warnings
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
@@ -47,4 +48,4 @@ GCC_WARN_UNUSED_VALUE = YES
GCC_WARN_UNUSED_PARAMETER = YES
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
GCC_WARN_UNDECLARED_SELECTOR = YES
-WARNING_CFLAGS = -Wall -Wno-unused-parameter -Werror -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-format-attribute -Wpacked -Wredundant-decls -Winline -Wdisabled-optimization -Wformat=2 -Winvalid-pch
+WARNING_CFLAGS = -Wall -Wno-unused-parameter -Werror -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-format-attribute -Wpacked -Wredundant-decls -Winline -Wdisabled-optimization -Winvalid-pch
diff --git a/Configurations/ConfigFramework.xcconfig b/Configurations/ConfigFramework.xcconfig
index 1eeeaa92..c1bb2081 100644
--- a/Configurations/ConfigFramework.xcconfig
+++ b/Configurations/ConfigFramework.xcconfig
@@ -5,7 +5,6 @@ DYLIB_COMPATIBILITY_VERSION = 1.5
DYLIB_CURRENT_VERSION = 1.5
PRODUCT_NAME = Sparkle
WRAPPER_EXTENSION = framework
-OTHER_LDFLAGS = -lcrypto
FRAMEWORK_VERSION = A
INFOPLIST_FILE = Info.plist
GCC_PREFIX_HEADER = Sparkle.pch
diff --git a/Configurations/ConfigFrameworkDebug.xcconfig b/Configurations/ConfigFrameworkDebug.xcconfig
index 4f5379ef..e256c490 100644
--- a/Configurations/ConfigFrameworkDebug.xcconfig
+++ b/Configurations/ConfigFrameworkDebug.xcconfig
@@ -2,4 +2,4 @@
#include "ConfigCommonDebug.xcconfig"
#include "ConfigFramework.xcconfig"
-OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
+OTHER_CFLAGS = -DDEBUG
diff --git a/Configurations/ConfigRelaunch.xcconfig b/Configurations/ConfigRelaunch.xcconfig
index 6cefd3c9..dc86e168 100644
--- a/Configurations/ConfigRelaunch.xcconfig
+++ b/Configurations/ConfigRelaunch.xcconfig
@@ -1,3 +1,4 @@
// Relaunch Tool only
-PRODUCT_NAME = relaunch
+PRODUCT_NAME = finish_installation
+SKIP_INSTALL = YES
diff --git a/Configurations/ConfigRelaunchDebug.xcconfig b/Configurations/ConfigRelaunchDebug.xcconfig
index 6e50fb75..94094110 100644
--- a/Configurations/ConfigRelaunchDebug.xcconfig
+++ b/Configurations/ConfigRelaunchDebug.xcconfig
@@ -2,4 +2,4 @@
#include "ConfigCommonDebug.xcconfig"
#include "ConfigRelaunch.xcconfig"
-OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
+OTHER_CFLAGS = -DDEBUG
diff --git a/Configurations/ConfigTestAppDebug.xcconfig b/Configurations/ConfigTestAppDebug.xcconfig
index f1137b86..9833128e 100644
--- a/Configurations/ConfigTestAppDebug.xcconfig
+++ b/Configurations/ConfigTestAppDebug.xcconfig
@@ -2,4 +2,4 @@
#include "ConfigCommonDebug.xcconfig"
#include "ConfigTestApp.xcconfig"
-OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
+OTHER_CFLAGS = -DDEBUG
diff --git a/Configurations/ConfigUnitTest.xcconfig b/Configurations/ConfigUnitTest.xcconfig
index ab0124b0..ee0fe205 100644
--- a/Configurations/ConfigUnitTest.xcconfig
+++ b/Configurations/ConfigUnitTest.xcconfig
@@ -7,3 +7,4 @@ WRAPPER_EXTENSION = octest
FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_LIBRARY_DIR)/Frameworks
GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h
GCC_PRECOMPILE_PREFIX_HEADER = YES
+MACOSX_DEPLOYMENT_TARGET = 10.6
diff --git a/License.txt b/License.txt
index 978193f9..08364c63 100644
--- a/License.txt
+++ b/License.txt
@@ -10,121 +10,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
EXTERNAL LICENSES
=================
-This project uses software developed by the OpenSSL Project for use in the OpenSSL
-Toolkit (http://www.openssl.org). This toolkit is licensed as follows:
-/* ====================================================================
-* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modiÞcation, are permitted provided that the following conditions
-* are met:
-*
-* 1. Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-*
-* 2. Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in
-* the documentation and/or other materials provided with the
-* distribution.
-*
-* 3. All advertising materials mentioning features or use of this
-* software must display the following acknowledgment:
-* ÒThis product includes software developed by the OpenSSL Project
-* for use in the OpenSSL Toolkit. (http://www.openssl.org/)Ó
-*
-* 4. The names ÒOpenSSL ToolkitÓ and ÒOpenSSL ProjectÓ must not be used to
-* endorse or promote products derived from this software without
-* prior written permission. For written permission, please contact
-* openssl-core@openssl.org.
-*
-* 5. Products derived from this software may not be called ÒOpenSSLÓ
-* nor may ÒOpenSSLÓ appear in their names without prior written
-* permission of the OpenSSL Project.
-*
-* 6. Redistributions of any form whatsoever must retain the following
-
-* acknowledgment:
-* ÒThis product includes software developed by the OpenSSL Project
-* for use in the OpenSSL Toolkit (http://www.openssl.org/)Ó
-*
-* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS ISÕÕ AND ANY
-* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
-* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-* OF THE POSSIBILITY OF SUCH DAMAGE.
-* ====================================================================
-*
-* This product includes cryptographic software written by Eric Young
-* (eay@cryptsoft.com). This product includes software written by Tim
-* Hudson (tjh@cryptsoft.com).
-*
-*/
-
-Original SSLeay License
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-* All rights reserved.
-*
-* This package is an SSL implementation written
-* by Eric Young (eay@cryptsoft.com).
-* The implementation was written so as to conform with Netscapes SSL.
-*
-* This library is free for commercial and non-commercial use as long as
-* the following conditions are aheared to. The following conditions
-* apply to all code found in this distribution, be it the RC4, RSA,
-* lhash, DES, etc., code; not just the SSL code. The SSL documentation
-* included with this distribution is covered by the same copyright terms
-* except that the holder is Tim Hudson (tjh@cryptsoft.com).
-*
-* Copyright remains Eric YoungÕs, and as such any Copyright notices in
-* the code are not to be removed.
-* If this package is used in a product, Eric Young should be given attribution
-* as the author of the parts of the library used.
-* This can be in the form of a textual message at program startup or
-* in documentation (online or textual) provided with the package.
-*
-* Redistribution and use in source and binary forms, with or without
-* modiÞcation, are permitted provided that the following conditions
-* are met:
-* 1. Redistributions of source code must retain the copyright
-* notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-* 3. All advertising materials mentioning features or use of this software
-* must display the following acknowledgement:
-* ÒThis product includes cryptographic software written by
-* Eric Young (eay@cryptsoft.com)Ó
-* The word ÔcryptographicÕ can be left out if the rouines from the library
-* being used are not cryptographic related :-).
-* 4. If you include any Windows speciÞc code (or a derivative thereof) from
-* the apps directory (application code) you must include an acknowledgement:
-* ÒThis product includes software written by Tim Hudson (tjh@cryptsoft.com)Ó
-*
-* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS ISÕÕ AND
-* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-* SUCH DAMAGE.
-*
-* The licence and distribution terms for any publically available version or
-* derivative of this code cannot be changed. i.e. this code cannot simply be
-* copied and put under another distribution licence
-* [including the GNU Public Licence.]
-*/
-
License for bspatch.c and bsdiff.c, from bsdiff 4.3 (:
/*-
* Copyright 2003-2005 Colin Percival
diff --git a/NTSynchronousTask.h b/NTSynchronousTask.h
index e1e32bee..be74ce38 100644
--- a/NTSynchronousTask.h
+++ b/NTSynchronousTask.h
@@ -23,7 +23,13 @@
// pass nil for directory if not needed
// returns the result
-+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
++(int) task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input output: (NSData**)outData;
+
++(NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
+
+- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
+- (int)result;
+- (NSData *)output;
@end
diff --git a/NTSynchronousTask.m b/NTSynchronousTask.m
index c2e3cecb..1d2e3ef0 100644
--- a/NTSynchronousTask.m
+++ b/NTSynchronousTask.m
@@ -6,7 +6,11 @@
// Copyright 2005 Steve Gehrman. All rights reserved.
//
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
#import "NTSynchronousTask.h"
@implementation NTSynchronousTask
@@ -124,6 +128,7 @@
[[self task] setStandardInput:[self inputPipe]];
[[self task] setStandardOutput:[self outputPipe]];
+ [[self task] setStandardError:[self outputPipe]];
}
return self;
@@ -144,7 +149,7 @@
[super dealloc];
}
-- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
+- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input
{
BOOL success = NO;
@@ -199,7 +204,7 @@
}
}
-+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
++ (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];
@@ -226,4 +231,38 @@
return result;
}
+
++(int) task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input output: (NSData**)outData
+{
+ // 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;
+
+ NS_DURING
+ {
+ 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];
+ }
+ NS_HANDLER;
+ taskResult = errCppGeneral;
+ NS_ENDHANDLER;
+
+ [pool drain];
+
+ // retained above
+ if( outData )
+ [*outData autorelease];
+
+ return taskResult;
+}
+
@end
diff --git a/SUAppcast.m b/SUAppcast.m
index afb47491..04af5a19 100644
--- a/SUAppcast.m
+++ b/SUAppcast.m
@@ -6,8 +6,14 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
+#import "SUAppcast.h"
+#import "SUConstants.h"
+#import "SULog.h"
@interface NSXMLElement (SUAppcastExtensions)
- (NSDictionary *)attributesAsDictionary;
@@ -26,7 +32,7 @@
}
@end
-@interface SUAppcast (Private)
+@interface SUAppcast ()
- (void)reportError:(NSError *)error;
- (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes;
@end
@@ -36,8 +42,14 @@
- (void)dealloc
{
[items release];
+ items = nil;
[userAgentString release];
+ userAgentString = nil;
+ [downloadFilename release];
+ downloadFilename = nil;
[download release];
+ download = nil;
+
[super dealloc];
}
@@ -82,7 +94,15 @@
if (downloadFilename)
{
- document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:0 error:&error] autorelease];
+ 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;
+ }
+ document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:options error:&error] autorelease];
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
[[NSFileManager defaultManager] removeFileAtPath:downloadFilename handler:nil];
@@ -186,7 +206,7 @@
}
else
{
- NSLog(@"Sparkle Updater: Failed to parse appcast item: %@.\nAppcast dictionary was: %@", errString, dict);
+ SULog(@"Sparkle Updater: Failed to parse appcast item: %@.\nAppcast dictionary was: %@", errString, dict);
}
[nodesDict removeAllObjects];
[dict removeAllObjects];
diff --git a/SUAppcastItem.h b/SUAppcastItem.h
index 536c776d..d6f9c64f 100644
--- a/SUAppcastItem.h
+++ b/SUAppcastItem.h
@@ -20,6 +20,7 @@
NSString *DSASignature;
NSString *minimumSystemVersion;
+ NSString *maximumSystemVersion;
NSURL *fileURL;
NSString *versionString;
@@ -28,6 +29,8 @@
NSDictionary *deltaUpdates;
NSDictionary *propertiesDictionary;
+
+ NSURL *infoURL; // UK 2007-08-31
}
// Initializes with data from a dictionary provided by the RSS class.
@@ -43,12 +46,15 @@
- (NSURL *)fileURL;
- (NSString *)DSASignature;
- (NSString *)minimumSystemVersion;
+- (NSString *)maximumSystemVersion;
- (NSDictionary *)deltaUpdates;
- (BOOL)isDeltaUpdate;
// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions.
- (NSDictionary *)propertiesDictionary;
+- (NSURL *)infoURL; // UK 2007-08-31
+
@end
#endif
diff --git a/SUAppcastItem.m b/SUAppcastItem.m
index f920cdc5..525d3fef 100644
--- a/SUAppcastItem.m
+++ b/SUAppcastItem.m
@@ -6,8 +6,13 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
+#import "SUAppcastItem.h"
+#import "SULog.h"
@implementation SUAppcastItem
@@ -101,7 +106,26 @@
minimumSystemVersion = [systemVersionString copy];
}
+- (NSString *)maximumSystemVersion { return [[maximumSystemVersion retain] autorelease]; }
+- (void)setMaximumSystemVersion:(NSString *)systemVersionString
+{
+ if (maximumSystemVersion == systemVersionString) return;
+ [maximumSystemVersion release];
+ maximumSystemVersion = [systemVersionString copy];
+}
+
+
+- (NSURL *)infoURL { return [[infoURL retain] autorelease]; } // UK 2007-08-31 (whole method)
+
+- (void)setInfoURL:(NSURL *)aFileURL // UK 2007-08-31 (whole method)
+{
+ if( aFileURL == infoURL ) return;
+ [infoURL release];
+ infoURL = [aFileURL copy];
+}
+
- (NSDictionary *)deltaUpdates { return [[deltaUpdates retain] autorelease]; }
+
- (void)setDeltaUpdates:(NSDictionary *)updates
{
if (deltaUpdates == updates) return;
@@ -126,14 +150,6 @@
{
id enclosure = [dict objectForKey:@"enclosure"];
- if (!enclosure)
- {
- if (error)
- *error = @"No enclosure in feed item";
- [self release];
- return nil;
- }
-
// Try to find a version string.
// Finding the new version number from the RSS feed is a little bit hacky. There are two ways:
// 1. A "sparkle:version" attribute on the enclosure tag, an extension from the RSS spec.
@@ -143,7 +159,9 @@
// 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"];
- if (newVersion == nil) // no sparkle:version attribute
+ 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).
+ 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.
@@ -152,14 +170,6 @@
newVersion = [[fileComponents lastObject] stringByDeletingPathExtension];
}
- if (![enclosure objectForKey:@"url"] )
- {
- if (error)
- *error = @"Feed item's enclosure lacks URL";
- [self release];
- return nil;
- }
-
if(!newVersion )
{
if (error)
@@ -168,57 +178,83 @@
return nil;
}
- if (enclosure == nil || [enclosure objectForKey:@"url"] == nil || newVersion == nil)
- {
- [self release];
- self = nil;
- }
- else
- {
- propertiesDictionary = [[NSMutableDictionary alloc] initWithDictionary:dict];
- [self setTitle:[dict objectForKey:@"title"]];
- [self setDate:[dict objectForKey:@"pubDate"]];
- [self setItemDescription:[dict objectForKey:@"description"]];
-
- [self setFileURL:[NSURL URLWithString:[[enclosure objectForKey:@"url"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
- [self setDSASignature:[enclosure objectForKey:@"sparkle:dsaSignature"]];
-
- [self setVersionString:newVersion];
- [self setMinimumSystemVersion:[dict objectForKey:@"sparkle:minimumSystemVersion"]];
-
- NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"];
- if (shortVersionString)
- [self setDisplayVersionString:shortVersionString];
- else
- [self setDisplayVersionString:[self versionString]];
-
- // Find the appropriate release notes URL.
- if ([dict objectForKey:@"sparkle:releaseNotesLink"])
- [self setReleaseNotesURL:[NSURL URLWithString:[dict objectForKey:@"sparkle:releaseNotesLink"]]];
- else if ([[self itemDescription] hasPrefix:@"http://"]) // if the description starts with http://, use that.
- [self setReleaseNotesURL:[NSURL URLWithString:[self itemDescription]]];
- else
- [self setReleaseNotesURL:nil];
+ propertiesDictionary = [[NSMutableDictionary alloc] initWithDictionary:dict];
+ [self setTitle:[dict objectForKey:@"title"]];
+ [self setDate:[dict objectForKey:@"pubDate"]];
+ [self setItemDescription:[dict objectForKey:@"description"]];
+
+ NSString* theInfoURL = [dict objectForKey:@"link"];
+ if( theInfoURL )
+ {
+ if( ![theInfoURL isKindOfClass: [NSString class]] )
+ SULog(@"SUAppcastItem -initWithDictionary: Info URL is not of valid type.");
+ else
+ [self setInfoURL:[NSURL URLWithString:theInfoURL]];
+ }
+
+ // Need an info URL or an enclosure URL. Former to show "More Info"
+ // page, latter to download & install:
+ if( !enclosure && !theInfoURL )
+ {
+ if (error)
+ *error = @"No enclosure in feed item";
+ [self release];
+ return nil;
+ }
- if ([dict objectForKey:@"deltas"])
+ NSString* enclosureURLString = [enclosure objectForKey:@"url"];
+ if( !enclosureURLString && !theInfoURL )
+ {
+ if (error)
+ *error = @"Feed item's enclosure lacks URL";
+ [self release];
+ return nil;
+ }
+
+ if( enclosureURLString )
+ [self setFileURL: [NSURL URLWithString: [enclosureURLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
+ if( enclosure )
+ [self setDSASignature:[enclosure objectForKey:@"sparkle:dsaSignature"]];
+
+ [self setVersionString: newVersion];
+ [self setMinimumSystemVersion: [dict objectForKey:@"sparkle:minimumSystemVersion"]];
+ [self setMaximumSystemVersion: [dict objectForKey:@"sparkle:maximumSystemVersion"]];
+
+ NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"];
+ if (nil == shortVersionString)
+ shortVersionString = [dict objectForKey:@"sparkle:shortVersionString"]; // fall back on the -
+
+ if (shortVersionString)
+ [self setDisplayVersionString: shortVersionString];
+ else
+ [self setDisplayVersionString: [self versionString]];
+
+ // Find the appropriate release notes URL.
+ if ([dict objectForKey:@"sparkle:releaseNotesLink"])
+ [self setReleaseNotesURL:[NSURL URLWithString:[dict objectForKey:@"sparkle:releaseNotesLink"]]];
+ else if ([[self itemDescription] hasPrefix:@"http://"] || [[self itemDescription] hasPrefix:@"https://"]) // if the description starts with http:// or https:// use that.
+ [self setReleaseNotesURL:[NSURL URLWithString:[self itemDescription]]];
+ else
+ [self setReleaseNotesURL:nil];
+
+ if ([dict objectForKey:@"deltas"])
+ {
+ NSMutableDictionary *deltas = [NSMutableDictionary dictionary];
+ NSArray *deltaDictionaries = [dict objectForKey:@"deltas"];
+ NSEnumerator *deltaDictionariesEnum = [deltaDictionaries objectEnumerator];
+ NSDictionary *deltaDictionary;
+ while ((deltaDictionary = [deltaDictionariesEnum nextObject]))
{
- NSMutableDictionary *deltas = [NSMutableDictionary dictionary];
- NSArray *deltaDictionaries = [dict objectForKey:@"deltas"];
- NSEnumerator *deltaDictionariesEnum = [deltaDictionaries objectEnumerator];
- NSDictionary *deltaDictionary;
- while ((deltaDictionary = [deltaDictionariesEnum nextObject]))
- {
- NSMutableDictionary *fakeAppCastDict = [dict mutableCopy];
- [fakeAppCastDict removeObjectForKey:@"deltas"];
- [fakeAppCastDict setObject:deltaDictionary forKey:@"enclosure"];
- SUAppcastItem *deltaItem = [[[self class] alloc] initWithDictionary:fakeAppCastDict];
- [fakeAppCastDict release];
+ NSMutableDictionary *fakeAppCastDict = [dict mutableCopy];
+ [fakeAppCastDict removeObjectForKey:@"deltas"];
+ [fakeAppCastDict setObject:deltaDictionary forKey:@"enclosure"];
+ SUAppcastItem *deltaItem = [[[self class] alloc] initWithDictionary:fakeAppCastDict];
+ [fakeAppCastDict release];
- [deltas setObject:deltaItem forKey:[deltaDictionary objectForKey:@"sparkle:deltaFrom"]];
- [deltaItem release];
- }
- [self setDeltaUpdates:deltas];
+ [deltas setObject:deltaItem forKey:[deltaDictionary objectForKey:@"sparkle:deltaFrom"]];
+ [deltaItem release];
}
+ [self setDeltaUpdates:deltas];
}
}
return self;
@@ -226,15 +262,16 @@
- (void)dealloc
{
- [title release];
- [date release];
- [itemDescription release];
- [releaseNotesURL release];
- [DSASignature release];
- [minimumSystemVersion release];
- [fileURL release];
- [versionString release];
- [displayVersionString release];
+ [self setTitle:nil];
+ [self setDate:nil];
+ [self setItemDescription:nil];
+ [self setReleaseNotesURL:nil];
+ [self setDSASignature:nil];
+ [self setMinimumSystemVersion: nil];
+ [self setFileURL:nil];
+ [self setVersionString:nil];
+ [self setDisplayVersionString:nil];
+ [self setInfoURL:nil];
[propertiesDictionary release];
[super dealloc];
}
diff --git a/SUAutomaticUpdateAlert.m b/SUAutomaticUpdateAlert.m
index d30025f1..f055f48d 100644
--- a/SUAutomaticUpdateAlert.m
+++ b/SUAutomaticUpdateAlert.m
@@ -33,7 +33,7 @@
[super dealloc];
}
-- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; }
+- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [host bundlePath], [host installationPath]]; }
- (IBAction)installNow:sender
{
diff --git a/SUAutomaticUpdateDriver.m b/SUAutomaticUpdateDriver.m
index d5a6eeb1..19a3c418 100644
--- a/SUAutomaticUpdateDriver.m
+++ b/SUAutomaticUpdateDriver.m
@@ -10,6 +10,7 @@
#import "SUAutomaticUpdateAlert.h"
#import "SUHost.h"
+#import "SUConstants.h"
@implementation SUAutomaticUpdateDriver
@@ -43,7 +44,7 @@
switch (choice)
{
case SUInstallNowChoice:
- [self installUpdate];
+ [self installWithToolAndRelaunch:YES];
break;
case SUInstallLaterChoice:
@@ -60,22 +61,15 @@
- (BOOL)shouldInstallSynchronously { return postponingInstallation; }
-- (void)installUpdate
+- (void)installWithToolAndRelaunch:(BOOL)relaunch
{
showErrors = YES;
- [super installUpdate];
+ [super installWithToolAndRelaunch:relaunch];
}
- (void)applicationWillTerminate:(NSNotification *)note
{
- [self installUpdate];
-}
-
-- (void)installerFinishedForHost:(SUHost *)aHost
-{
- if (aHost != host) { return; }
- if (!postponingInstallation)
- [self relaunchHostApp];
+ [self installWithToolAndRelaunch:NO];
}
- (void)abortUpdateWithError:(NSError *)error
diff --git a/SUBasicUpdateDriver.h b/SUBasicUpdateDriver.h
index 3f5c8fe9..21fe7171 100644
--- a/SUBasicUpdateDriver.h
+++ b/SUBasicUpdateDriver.h
@@ -19,6 +19,7 @@
NSURLDownload *download;
NSString *downloadPath;
+ NSString *tempDir;
NSString *relaunchPath;
}
@@ -45,12 +46,11 @@
- (void)unarchiverDidFail:(SUUnarchiver *)ua;
- (void)failedToApplyDeltaUpdate;
-- (void)installUpdate;
-- (void)installerFinishedForHost:(SUHost *)host;
+- (void)installWithToolAndRelaunch:(BOOL)relaunch;
- (void)installerForHost:(SUHost *)host failedWithError:(NSError *)error;
-- (void)relaunchHostApp;
-- (void)cleanUp;
+- (void)installWithToolAndRelaunch:(BOOL)relaunch;
+- (void)cleanUpDownload;
- (void)abortUpdate;
- (void)abortUpdateWithError:(NSError *)error;
diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m
index dfb04533..cb23e877 100644
--- a/SUBasicUpdateDriver.m
+++ b/SUBasicUpdateDriver.m
@@ -13,7 +13,16 @@
#import "SUInstaller.h"
#import "SUStandardVersionComparator.h"
#import "SUUnarchiver.h"
+#import "SUConstants.h"
+#import "SULog.h"
+#import "SUPlainInstaller.h"
+#import "SUPlainInstallerInternals.h"
#import "SUBinaryDeltaCommon.h"
+#import "SUCodeSigningVerifier.h"
+#import "SUUpdater_Private.h"
+
+@interface SUBasicUpdateDriver () ; @end
+
@implementation SUBasicUpdateDriver
@@ -57,8 +66,21 @@
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui
{
- if ([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) { return YES; }
- return [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion] toVersion:[SUHost systemVersionString]] != NSOrderedDescending;
+ if (([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) &&
+ ([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) { return YES; }
+
+ BOOL minimumVersionOK = TRUE;
+ BOOL maximumVersionOK = TRUE;
+
+ // Check minimum and maximum System Version
+ if ([ui minimumSystemVersion] != nil && ![[ui minimumSystemVersion] isEqualToString:@""]) {
+ minimumVersionOK = [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion] toVersion:[SUHost systemVersionString]] != NSOrderedDescending;
+ }
+ if ([ui maximumSystemVersion] != nil && ![[ui maximumSystemVersion] isEqualToString:@""]) {
+ maximumVersionOK = [[SUStandardVersionComparator defaultComparator] compareVersion:[ui maximumSystemVersion] toVersion:[SUHost systemVersionString]] != NSOrderedAscending;
+ }
+
+ return minimumVersionOK && maximumVersionOK;
}
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui
@@ -145,58 +167,66 @@
if ([[name pathExtension] isEqualToString:@"txt"])
name = [name stringByDeletingPathExtension];
- // We create a temporary directory in /tmp and stick the file there.
- // Not using a GUID here because hdiutil (for DMGs) for some reason chokes on GUIDs. Too long? I really have no idea.
- NSString *prefix = [NSString stringWithFormat:@"%@ %@ Update", [host name], [host version]];
- NSString *tempDir = NSTemporaryDirectory();
- if (tempDir)
+ NSString *downloadFileName = [NSString stringWithFormat:@"%@ %@", [host name], [updateItem versionString]];
+
+
+ [tempDir release];
+ tempDir = [[[host appSupportPath] stringByAppendingPathComponent:downloadFileName] retain];
+ int cnt=1;
+ while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt <= 999)
{
- tempDir = [tempDir stringByAppendingPathComponent:prefix];
- unsigned int cnt = 1;
- while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt <= 999)
- {
- tempDir = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@ %u", prefix, cnt++]];
- }
-
-#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
- BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:tempDir attributes:nil];
-#else
- BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:tempDir withIntermediateDirectories:YES attributes:nil error:nil];
-#endif
- if (!success)
- {
- // Okay, something's really broken with /tmp
- [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]]];
- }
-
- downloadPath = [[tempDir stringByAppendingPathComponent:name] retain];
- [download setDestination:downloadPath allowOverwrite:YES];
+ [tempDir release];
+ tempDir = [[[host appSupportPath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@ %d", downloadFileName, cnt++]] retain];
}
+
+ // Create the temporary directory if necessary.
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+ BOOL success = YES;
+ NSEnumerator *pathComponentEnumerator = [[tempDir pathComponents] objectEnumerator];
+ NSString *pathComponentAccumulator = @"";
+ NSString *currentPathComponent;
+ while ((currentPathComponent = [pathComponentEnumerator nextObject])) {
+ pathComponentAccumulator = [pathComponentAccumulator stringByAppendingPathComponent:currentPathComponent];
+ if ([[NSFileManager defaultManager] fileExistsAtPath:pathComponentAccumulator]) continue;
+ success &= [[NSFileManager defaultManager] createDirectoryAtPath:pathComponentAccumulator attributes:nil];
+ }
+#else
+ BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:tempDir withIntermediateDirectories:YES attributes:nil error:NULL];
+#endif
+ if (!success)
+ {
+ // 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]]];
+ }
+
+ downloadPath = [[tempDir stringByAppendingPathComponent:name] retain];
+ [download setDestination:downloadPath allowOverwrite:YES];
+}
+
+- (BOOL)validateUpdateDownloadedToPath:(NSString *)downloadedPath extractedToPath:(NSString *)extractedPath DSASignature:(NSString *)DSASignature publicDSAKey:(NSString *)publicDSAKey
+{
+ NSString *newBundlePath = [SUInstaller appPathInUpdateFolder:extractedPath forHost:host];
+ if (newBundlePath)
+ {
+ NSError *error = nil;
+ if ([SUCodeSigningVerifier codeSignatureIsValidAtPath:newBundlePath error:&error]) {
+ return YES;
+ } else {
+ SULog(@"Code signature check on update failed: %@", error);
+ }
+ }
+
+ return [SUDSAVerifier validatePath:downloadedPath withEncodedDSASignature:DSASignature withPublicDSAKey:publicDSAKey];
}
- (void)downloadDidFinish:(NSURLDownload *)d
-{
- // New in Sparkle 1.5: we're now checking signatures on all non-secure downloads, where "secure" is defined as both the appcast and the download being transmitted over SSL.
- NSURL *downloadURL = [[d request] URL];
- if (!(([[downloadURL scheme] isEqualToString:@"https"] && [[appcastURL scheme] isEqualToString:@"https"]) ||
- ([downloadURL isFileURL] && [appcastURL isFileURL])))
- {
- if (![host publicDSAKey] || ![SUDSAVerifier validatePath:downloadPath withEncodedDSASignature:[updateItem DSASignature] withPublicDSAKey:[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]]];
- return;
- }
- }
-
+{
[self extractUpdate];
}
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error
{
- // Get rid of what we've downloaded so far, if anything.
- if (downloadPath != nil)
- [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[downloadPath stringByDeletingLastPathComponent] destination:@"" files:[NSArray arrayWithObject:[downloadPath lastPathComponent]] tag:NULL];
[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]]];
}
@@ -212,7 +242,7 @@
SUUnarchiver *unarchiver = [SUUnarchiver unarchiverForPath:downloadPath updatingHost:host];
if (!unarchiver)
{
- NSLog(@"Sparkle Error: No valid unarchiver for %@!", downloadPath);
+ SULog(@"Sparkle Error: No valid unarchiver for %@!", downloadPath);
[self unarchiverDidFail:nil];
return;
}
@@ -234,7 +264,7 @@
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
{
if (ua) { CFRelease(ua); }
- [self installUpdate];
+ [self installWithToolAndRelaunch:YES];
}
- (void)unarchiverDidFail:(SUUnarchiver *)ua
@@ -251,90 +281,109 @@
- (BOOL)shouldInstallSynchronously { return NO; }
-- (void)installUpdate
+- (void)installWithToolAndRelaunch:(BOOL)relaunch
{
+#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]]];
+ return;
+ }
+#endif
+
+ if (![updater mayUpdateAndRestart])
+ {
+ [self abortUpdate];
+ return;
+ }
+
+ // Give the host app an opportunity to postpone the install and relaunch.
+ static BOOL postponedOnce = NO;
+ if (!postponedOnce && [[updater delegate] respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)])
+ {
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:)]];
+ [invocation setSelector:@selector(installWithToolAndRelaunch:)];
+ [invocation setArgument:&relaunch atIndex:2];
+ [invocation setTarget:self];
+ postponedOnce = YES;
+ if ([[updater delegate] updater:updater shouldPostponeRelaunchForUpdate:updateItem untilInvoking:invocation])
+ return;
+ }
+
+
if ([[updater delegate] respondsToSelector:@selector(updater:willInstallUpdate:)])
[[updater delegate] updater:updater willInstallUpdate:updateItem];
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
- NSString *relaunchPathToCopy = [SPARKLE_BUNDLE pathForResource:@"relaunch" ofType:@""];
- NSString *targetPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]];
+ NSString *relaunchPathToCopy = [SPARKLE_BUNDLE pathForResource:@"finish_installation" ofType:@"app"];
+ 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;
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
- [[NSFileManager defaultManager] removeFileAtPath:targetPath handler:nil];
- if ([[NSFileManager defaultManager] copyPath:relaunchPathToCopy toPath:targetPath handler:nil])
+ [[NSFileManager defaultManager] createDirectoryAtPath: [targetPath stringByDeletingLastPathComponent] attributes: [NSDictionary dictionary]];
#else
- [[NSFileManager defaultManager] removeItemAtPath:targetPath error:nil];
- if ([[NSFileManager defaultManager] copyItemAtPath:relaunchPathToCopy toPath:targetPath error:&error])
+ [[NSFileManager defaultManager] createDirectoryAtPath: [targetPath stringByDeletingLastPathComponent] withIntermediateDirectories: YES attributes: [NSDictionary dictionary] error: &error];
#endif
+
+ // Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
+ 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]]];
- [SUInstaller installFromUpdateFolder:[downloadPath stringByDeletingLastPathComponent] overHost:host delegate:self synchronously:[self shouldInstallSynchronously] versionComparator:[self versionComparator]];
+ [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterWillRestartNotification object:self];
+ if ([[updater delegate] respondsToSelector:@selector(updaterWillRelaunchApplication:)])
+ [[updater delegate] updaterWillRelaunchApplication:updater];
+
+ 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]]];
+ // 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:)])
+ pathToRelaunch = [[updater delegate] pathToRelaunchForUpdater:updater];
+ NSString *relaunchToolPath = [relaunchPath stringByAppendingPathComponent: @"/Contents/MacOS/finish_installation"];
+ [NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:[NSArray arrayWithObjects:[host bundlePath], pathToRelaunch, [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], tempDir, relaunch ? @"1" : @"0", nil]];
+
+ [NSApp terminate:self];
}
-- (void)installerFinishedForHost:(SUHost *)aHost
+- (void)cleanUpDownload
{
- if (aHost != host) { return; }
- [self relaunchHostApp];
-}
-
-- (void)relaunchHostApp
-{
- // Give the host app an opportunity to postpone the relaunch.
- static BOOL postponedOnce = NO;
- if (!postponedOnce && [[updater delegate] respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)])
+ if (tempDir != nil) // tempDir contains downloadPath, so we implicitly delete both here.
{
- NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(relaunchHostApp)]];
- [invocation setSelector:@selector(relaunchHostApp)];
- [invocation setTarget:self];
- postponedOnce = YES;
- if ([[updater delegate] updater:updater shouldPostponeRelaunchForUpdate:updateItem untilInvoking:invocation])
- return;
- }
-
- [self cleanUp]; // Clean up the download and extracted files.
-
- [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterWillRestartNotification object:self];
- if ([[updater delegate] respondsToSelector:@selector(updaterWillRelaunchApplication:)])
- [[updater delegate] updaterWillRelaunchApplication:updater];
-
- 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]]];
- // 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:)])
- pathToRelaunch = [[updater delegate] pathToRelaunchForUpdater:updater];
- [NSTask launchedTaskWithLaunchPath:relaunchPath arguments:[NSArray arrayWithObjects:pathToRelaunch, [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]];
-
- [self setValue:[NSNumber numberWithBool:YES] forKey:@"finished"];
- [NSApp terminate:nil];
-}
-
-- (void)cleanUp
-{
+ BOOL success = NO;
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
- [[NSFileManager defaultManager] removeFileAtPath:[downloadPath stringByDeletingLastPathComponent] handler:nil];
+ success = [[NSFileManager defaultManager] removeFileAtPath: tempDir handler: nil]; // Clean up the copied relauncher
#else
- [[NSFileManager defaultManager] removeItemAtPath:[downloadPath stringByDeletingLastPathComponent] error:nil];
+ NSError * error = nil;
+ success = [[NSFileManager defaultManager] removeItemAtPath: tempDir error: &error]; // Clean up the copied relauncher
#endif
+ if( !success )
+ [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[tempDir stringByDeletingLastPathComponent] destination:@"" files:[NSArray arrayWithObject:[tempDir lastPathComponent]] tag:NULL];
+ }
}
- (void)installerForHost:(SUHost *)aHost failedWithError:(NSError *)error
{
if (aHost != host) { return; }
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+ [[NSFileManager defaultManager] removeFileAtPath: relaunchPath handler: nil]; // Clean up the copied relauncher
+#else
+ NSError * dontThrow = nil;
+ [[NSFileManager defaultManager] removeItemAtPath: relaunchPath error: &dontThrow]; // Clean up the copied relauncher
+#endif
[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]]];
}
- (void)abortUpdate
{
+ [[self retain] autorelease]; // In case the notification center was the last one holding on to us.
+ [self cleanUpDownload];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super abortUpdate];
}
@@ -342,9 +391,9 @@
- (void)abortUpdateWithError:(NSError *)error
{
if ([error code] != SUNoUpdateError) // Let's not bother logging this.
- NSLog(@"Sparkle Error: %@", [error localizedDescription]);
+ SULog(@"Sparkle Error: %@", [error localizedDescription]);
if ([error localizedFailureReason])
- NSLog(@"Sparkle Error (continued): %@", [error localizedFailureReason]);
+ SULog(@"Sparkle Error (continued): %@", [error localizedFailureReason]);
if (download)
[download cancel];
[self abortUpdate];
@@ -356,6 +405,7 @@
[nonDeltaUpdateItem release];
[download release];
[downloadPath release];
+ [tempDir release];
[relaunchPath release];
[super dealloc];
}
diff --git a/SUCodeSigningVerifier.h b/SUCodeSigningVerifier.h
new file mode 100644
index 00000000..1f01d1b5
--- /dev/null
+++ b/SUCodeSigningVerifier.h
@@ -0,0 +1,19 @@
+//
+// SUCodeSigningVerifier.h
+// Sparkle
+//
+// Created by Andy Matuschak on 7/5/12.
+//
+//
+
+#ifndef SUCODESIGNINGVERIFIER_H
+#define SUCODESIGNINGVERIFIER_H
+
+#import
+
+@interface SUCodeSigningVerifier : NSObject
++ (BOOL)codeSignatureIsValidAtPath:(NSString *)destinationPath error:(NSError **)error;
++ (BOOL)hostApplicationIsCodeSigned;
+@end
+
+#endif
diff --git a/SUCodeSigningVerifier.m b/SUCodeSigningVerifier.m
new file mode 100644
index 00000000..0dc029f0
--- /dev/null
+++ b/SUCodeSigningVerifier.m
@@ -0,0 +1,86 @@
+//
+// SUCodeSigningVerifier.m
+// Sparkle
+//
+// Created by Andy Matuschak on 7/5/12.
+//
+//
+
+#import
+#import "SUCodeSigningVerifier.h"
+#import "SULog.h"
+
+@implementation SUCodeSigningVerifier
+
+extern OSStatus SecCodeCopySelf(SecCSFlags flags, SecCodeRef *self) __attribute__((weak_import));
+
+extern OSStatus SecCodeCopyDesignatedRequirement(SecStaticCodeRef code, SecCSFlags flags, SecRequirementRef *requirement) __attribute__((weak_import));
+
+extern OSStatus SecStaticCodeCreateWithPath(CFURLRef path, SecCSFlags flags, SecStaticCodeRef *staticCode) __attribute__((weak_import));
+
+extern OSStatus SecStaticCodeCheckValidityWithErrors(SecStaticCodeRef staticCode, SecCSFlags flags, SecRequirementRef requirement, CFErrorRef *errors) __attribute__((weak_import));
+
+
++ (BOOL)codeSignatureIsValidAtPath:(NSString *)destinationPath error:(NSError **)error
+{
+ // This API didn't exist prior to 10.6.
+ if (SecCodeCopySelf == NULL) return NO;
+
+ OSStatus result;
+ SecRequirementRef requirement = NULL;
+ SecStaticCodeRef staticCode = NULL;
+ SecCodeRef hostCode = NULL;
+
+ result = SecCodeCopySelf(kSecCSDefaultFlags, &hostCode);
+ if (result != 0) {
+ SULog(@"Failed to copy host code %d", result);
+ goto finally;
+ }
+
+ result = SecCodeCopyDesignatedRequirement(hostCode, kSecCSDefaultFlags, &requirement);
+ if (result != 0) {
+ SULog(@"Failed to copy designated requirement %d", result);
+ goto finally;
+ }
+
+ NSBundle *newBundle = [NSBundle bundleWithPath:destinationPath];
+ if (!newBundle) {
+ SULog(@"Failed to load NSBundle for update");
+ result = -1;
+ goto finally;
+ }
+
+ result = SecStaticCodeCreateWithPath((CFURLRef)[newBundle executableURL], kSecCSDefaultFlags, &staticCode);
+ if (result != 0) {
+ SULog(@"Failed to get static code %d", result);
+ goto finally;
+ }
+
+ result = SecStaticCodeCheckValidityWithErrors(staticCode, kSecCSDefaultFlags | kSecCSCheckAllArchitectures, requirement, (CFErrorRef *)error);
+ if (result != 0 && error) [*error autorelease];
+
+finally:
+ if (hostCode) CFRelease(hostCode);
+ if (staticCode) CFRelease(staticCode);
+ if (requirement) CFRelease(requirement);
+ return (result == 0);
+}
+
++ (BOOL)hostApplicationIsCodeSigned
+{
+ // This API didn't exist prior to 10.6.
+ if (SecCodeCopySelf == NULL) return NO;
+
+ OSStatus result;
+ SecCodeRef hostCode = NULL;
+ result = SecCodeCopySelf(kSecCSDefaultFlags, &hostCode);
+ if (result != 0) return NO;
+
+ SecRequirementRef requirement = NULL;
+ result = SecCodeCopyDesignatedRequirement(hostCode, kSecCSDefaultFlags, &requirement);
+ if (hostCode) CFRelease(hostCode);
+ if (requirement) CFRelease(requirement);
+ return (result == 0);
+}
+
+@end
diff --git a/SUConstants.h b/SUConstants.h
index 4a807d38..0dcc6cfb 100644
--- a/SUConstants.h
+++ b/SUConstants.h
@@ -10,10 +10,37 @@
#ifndef SUCONSTANTS_H
#define SUCONSTANTS_H
+// -----------------------------------------------------------------------------
+// Preprocessor flags:
+// -----------------------------------------------------------------------------
+
+// Turn off DSA signature check (practically invites man-in-the-middle attacks):
+#define ENDANGER_USERS_WITH_INSECURE_UPDATES 0
+
+// Sparkle usually doesn't allow downgrades as they're usually accidental, but
+// if your app has a downgrade function or URL handler, turn this on:
+#define PERMIT_AUTOMATED_DOWNGRADES 0
+
+// If your app file on disk is named "MyApp 1.1b4", Sparkle usually updates it
+// in place, giving you an app named 1.1b4 that is actually 1.2. Turn the
+// following on to always reset the name back to "MyApp":
+#define NORMALIZE_INSTALLED_APP_NAME 0
+
+
+#define TRY_TO_APPEND_VERSION_NUMBER 1
+
+// -----------------------------------------------------------------------------
+// Notifications:
+// -----------------------------------------------------------------------------
extern NSString *const SUUpdaterWillRestartNotification;
+
extern NSString *const SUTechnicalErrorInformationKey;
+// -----------------------------------------------------------------------------
+// PList keys::
+// -----------------------------------------------------------------------------
+
extern NSString *const SUFeedURLKey;
extern NSString *const SUHasLaunchedBeforeKey;
extern NSString *const SUShowReleaseNotesKey;
@@ -29,6 +56,14 @@ extern NSString *const SUEnableAutomaticChecksKeyOld;
extern NSString *const SUEnableSystemProfilingKey;
extern NSString *const SUSendProfileInfoKey;
extern NSString *const SULastProfileSubmitDateKey;
+extern NSString *const SUPromptUserOnFirstLaunchKey;
+extern NSString *const SUFixedHTMLDisplaySizeKey;
+extern NSString *const SUKeepDownloadOnFailedInstallKey;
+extern NSString *const SUDefaultsDomainKey;
+
+// -----------------------------------------------------------------------------
+// Errors:
+// -----------------------------------------------------------------------------
extern NSString *const SUSparkleErrorDomain;
// Appcast phase errors.
@@ -53,6 +88,11 @@ extern OSStatus SURelaunchError;
extern OSStatus SUInstallationError;
extern OSStatus SUDowngradeError;
+
+// -----------------------------------------------------------------------------
+// NSInteger fixer-upper:
+// -----------------------------------------------------------------------------
+
// NSInteger is a type that was added to Leopard.
// Here is some glue to ensure that NSInteger will work with pre-10.5 SDKs:
#ifndef NSINTEGER_DEFINED
diff --git a/SUConstants.m b/SUConstants.m
index 5f06311f..d08b3c2a 100644
--- a/SUConstants.m
+++ b/SUConstants.m
@@ -6,7 +6,11 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
#import "SUConstants.h"
NSString *const SUUpdaterWillRestartNotification = @"SUUpdaterWillRestartNotificationName";
@@ -28,6 +32,10 @@ NSString *const SUEnableAutomaticChecksKey = @"SUEnableAutomaticChecks";
NSString *const SUEnableAutomaticChecksKeyOld = @"SUCheckAtStartup";
NSString *const SUSendProfileInfoKey = @"SUSendProfileInfo";
NSString *const SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate";
+NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch";
+NSString *const SUFixedHTMLDisplaySizeKey = @"SUFixedHTMLDisplaySize";
+NSString *const SUKeepDownloadOnFailedInstallKey = @"SUKeepDownloadOnFailedInstall";
+NSString *const SUDefaultsDomainKey = @"SUDefaultsDomain";
NSString *const SUSparkleErrorDomain = @"SUSparkleErrorDomain";
OSStatus SUAppcastParseError = 1000;
diff --git a/SUDSAVerifier.h b/SUDSAVerifier.h
index 785e49c2..814e4c59 100644
--- a/SUDSAVerifier.h
+++ b/SUDSAVerifier.h
@@ -9,7 +9,8 @@
#ifndef SUDSAVERIFIER_H
#define SUDSAVERIFIER_H
-// For the paranoid folks!
+#import
+
@interface SUDSAVerifier : NSObject {}
+ (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString;
@end
diff --git a/SUDSAVerifier.m b/SUDSAVerifier.m
index 8e6f96ad..eb4dd2ff 100644
--- a/SUDSAVerifier.m
+++ b/SUDSAVerifier.m
@@ -6,162 +6,352 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-// DSA stuff adapted from code provided by Allan Odgaard. Thanks, Allan!
-
#import "SUDSAVerifier.h"
+#import
-#import
-#import
-#import
-#import
-#import
-#import
+#import
-static long b64decode(unsigned char* str)
-{
- unsigned char *cur, *start;
- int d, dlast, phase;
- unsigned char c;
- static int table[256] = {
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 00-0F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 10-1F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, /* 20-2F */
- 52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1, /* 30-3F */
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, /* 40-4F */
- 15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1, /* 50-5F */
- -1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, /* 60-6F */
- 41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1, /* 70-7F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 80-8F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 90-9F */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* A0-AF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* B0-BF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* C0-CF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* D0-DF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* E0-EF */
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 /* F0-FF */
- };
-
- dlast = phase = 0;
- start = str;
- for (cur = str; *cur != '\0'; ++cur )
- {
- if(*cur == '\n' || *cur == '\r'){phase = dlast = 0; continue;}
- d = table[(unsigned int)*cur];
- if(d != -1)
- {
- switch(phase)
- {
- case 0:
- ++phase;
- break;
- case 1:
- c = ((dlast << 2) | ((d & 0x30) >> 4));
- *str++ = c;
- ++phase;
- break;
- case 2:
- c = (((dlast & 0xf) << 4) | ((d & 0x3c) >> 2));
- *str++ = c;
- ++phase;
- break;
- case 3:
- c = (((dlast & 0x03 ) << 6) | d);
- *str++ = c;
- phase = 0;
- break;
- }
- dlast = d;
- }
- }
- *str = '\0';
- return str - start;
-}
+/* CDSA Specific */
+static CSSM_CSP_HANDLE cdsaInit( void );
+static void cdsaRelease( CSSM_CSP_HANDLE cspHandle );
+static CSSM_KEY_PTR cdsaCreateKey( CFDataRef rawKey );
+static void cdsaReleaseKey( CSSM_KEY_PTR key );
+static BOOL cdsaVerifyKey( CSSM_CSP_HANDLE cspHandle, const CSSM_KEY_PTR key );
+static BOOL cdsaVerifySignature( CSSM_CSP_HANDLE cspHandle, const CSSM_KEY_PTR key, const CFDataRef msg, const CFDataRef signature );
+static CFDataRef cdsaCreateSHA1Digest( CSSM_CSP_HANDLE cspHandle, const CFDataRef bytes );
-static EVP_PKEY* load_dsa_key(char *key)
-{
- EVP_PKEY* pkey = NULL;
- size_t keylen = strlen(key);
- if (keylen <= INT_MAX)
- {
- BIO *bio;
- if((bio = BIO_new_mem_buf(key, (int)keylen)))
- {
- DSA* dsa_key = 0;
- if(PEM_read_bio_DSA_PUBKEY(bio, &dsa_key, NULL, NULL))
- {
- if((pkey = EVP_PKEY_new()))
- {
- if(EVP_PKEY_assign_DSA(pkey, dsa_key) != 1)
- {
- DSA_free(dsa_key);
- EVP_PKEY_free(pkey);
- pkey = NULL;
- }
- }
- }
- BIO_free(bio);
- }
- }
- return pkey;
-}
+/* Helper Functions */
+static NSData *b64decode( NSString *str );
+static NSData *rawKeyData( NSString *str );
@implementation SUDSAVerifier
+#pragma mark -
+ (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString
{
+ if ( !encodedSignature || !pkeyString || !path ) return NO;
BOOL result = NO;
- if (!encodedSignature) { return NO; }
- if (!pkeyString) { return NO; }
+ NSData *pathData = nil, *sigData = nil;
+ CFDataRef hashData = NULL;
+ CSSM_KEY_PTR pubKey = cdsaCreateKey((CFDataRef)rawKeyData(pkeyString)); // Create the DSA key
+ CSSM_CSP_HANDLE cspHandle = CSSM_INVALID_HANDLE;
- // Remove whitespace around each line of the key.
- NSMutableArray *pkeyTrimmedLines = [NSMutableArray array];
- NSEnumerator *pkeyLinesEnumerator = [[pkeyString componentsSeparatedByString:@"\n"] objectEnumerator];
- NSString *pkeyLine;
- while ((pkeyLine = [pkeyLinesEnumerator nextObject]) != nil)
- {
- [pkeyTrimmedLines addObject:[pkeyLine stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]];
+ if ( !pubKey ) return NO;
+ if ( (cspHandle = cdsaInit()) == CSSM_INVALID_HANDLE ) goto validate_end; // Init CDSA
+ if ( !cdsaVerifyKey(cspHandle, pubKey) ) goto validate_end; // Verify the key is valid
+ if ( (pathData = [NSData dataWithContentsOfFile:path]) == nil ) goto validate_end; // File data
+ if ( (hashData = cdsaCreateSHA1Digest(cspHandle, (CFDataRef)pathData)) == NULL ) goto validate_end; // Hash
+
+ // Remove any line feeds from end of signature
+ // (Not likely needed, but the verify _can_ fail if there is, so...)
+ if ( [encodedSignature characterAtIndex:[encodedSignature length] - 1] == '\n' ) {
+ NSMutableString *sig = [[encodedSignature mutableCopy] autorelease];
+ while ( [sig characterAtIndex:[sig length] - 1] == '\n' )
+ [sig deleteCharactersInRange:NSMakeRange([sig length] - 1, 1)];
+ encodedSignature = sig;
}
- pkeyString = [pkeyTrimmedLines componentsJoinedByString:@"\n"]; // Put them back together.
+ if ( (sigData = b64decode(encodedSignature)) == nil ) goto validate_end; // Decode signature
+
+ // Verify the signature on the file
+ result = cdsaVerifySignature( cspHandle, pubKey, hashData, (CFDataRef)sigData );
- NSMutableData* pkeyData = [[[pkeyString dataUsingEncoding:NSUTF8StringEncoding] mutableCopy] autorelease];
- void *pkeyBytes = [pkeyData mutableBytes];
- EVP_PKEY* pkey = NULL;
- pkey = load_dsa_key(pkeyBytes);
- if (!pkey) { return NO; }
-
- // Now, the signature is in base64; we have to decode it into a binary stream.
- NSMutableData* signatureData = [[[encodedSignature dataUsingEncoding:NSUTF8StringEncoding] mutableCopy] autorelease];
- void *signature = [signatureData mutableBytes];
- long length = b64decode(signature); // Decode the signature in-place and get the new length of the signature string.
- if ((length < 0) || (length > 0x7FFFFFFF)) { return NO; } // test before cast below
+validate_end:
+ cdsaReleaseKey( pubKey );
+ cdsaRelease( cspHandle );
+ if ( hashData ) CFRelease( hashData );
- // We've got the signature, now get the file data.
- NSData *pathData = [NSData dataWithContentsOfFile:path];
- if (!pathData) { return NO; }
-
- // Hash the file with SHA-1.
- unsigned char md[SHA_DIGEST_LENGTH];
- SHA1([pathData bytes], [pathData length], md);
-
- // Actually verify the signature on the file.
- EVP_MD_CTX ctx;
- EVP_MD_CTX_init(&ctx);
- if(EVP_VerifyInit(&ctx, EVP_dss1()) == 1) // We're using DSA keys.
- {
- EVP_VerifyUpdate(&ctx, md, SHA_DIGEST_LENGTH);
-
- result = EVP_VerifyFinal(&ctx, signature, (unsigned int)length, pkey);
- }
- EVP_MD_CTX_cleanup(&ctx);
-
- EVP_PKEY_free(pkey);
-
- // Prevent these from being collected earlier than we want (our only reference is an inner pointer).
- [pkeyData self];
- [signatureData self];
- [pathData self];
-
- return result == 1;
+ return result;
}
@end
+
+#pragma mark -
+#pragma mark Misc Helper Functions
+#pragma mark -
+
+static NSData *b64decode( NSString *str )
+{
+ if ( !str ) return nil;
+ NSMutableData *retval = nil;
+ NSData *input = [str dataUsingEncoding:NSUTF8StringEncoding];
+ UInt8 *ibuf = (UInt8 *)[input bytes], *buf = NULL, *a = NULL;
+ size_t len = [input length], i = 0, j = 0, size = ((len + 3) / 4) * 3;
+ static UInt8 table[256] = {
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, /* 00-0F */
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, /* 10-1F */
+ 99,99,99,99,99,99,99,99,99,99,99,62,99,99,99,63, /* 20-2F */
+ 52,53,54,55,56,57,58,59,60,61,99,99,99,99,99,99, /* 30-3F */
+ 99, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, /* 40-4F */
+ 15,16,17,18,19,20,21,22,23,24,25,99,99,99,99,99, /* 50-5F */
+ 99,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, /* 60-6F */
+ 41,42,43,44,45,46,47,48,49,50,51,99,99,99,99,99, /* 70-7F */
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, /* 80-8F */
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, /* 90-9F */
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, /* A0-AF */
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, /* B0-BF */
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, /* C0-CF */
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, /* D0-DF */
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, /* E0-EF */
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99 /* F0-FF */
+ };
+
+ retval = [NSMutableData dataWithLength:size];
+ buf = [retval mutableBytes];
+
+ if ( (a = calloc(4, sizeof(UInt8))) == NULL ) return nil;
+
+ do {
+ size_t ai = 0;
+ a[0] = a[1] = a[2] = a[3] = 0;
+ do {
+ UInt8 d = table[ibuf[i++]];
+ if ( d != 99 ) {
+ a[ai] = d;
+ ai++;
+ if ( ai == 4 ) break;
+ }
+ } while ( i < len );
+ if ( ai >= 2 ) buf[j] = (a[0] << 2) | (a[1] >> 4);
+ if ( ai >= 3 ) buf[j+1] = (a[1] << 4) | (a[2] >> 2);
+ if ( ai >= 4 ) buf[j+2] = (a[2] << 6) | a[3];
+ j += ai-1;
+ } while ( i < len );
+
+ free( a );
+ if ( j < size ) [retval setLength:j];
+
+ return retval;
+}
+
+static NSData *rawKeyData( NSString *key )
+{
+ if ( (key == nil) || ([key length] == 0) ) return nil;
+ NSMutableString *t = [[key mutableCopy] autorelease];
+
+ // Remove the PEM guards (if present)
+ [t replaceOccurrencesOfString:@"-" withString:@"" options:NSLiteralSearch range:NSMakeRange(0, [t length])];
+ [t replaceOccurrencesOfString:@"BEGIN PUBLIC KEY" withString:@"" options:NSLiteralSearch range:NSMakeRange(0, [t length])];
+ [t replaceOccurrencesOfString:@"END PUBLIC KEY" withString:@"" options:NSLiteralSearch range:NSMakeRange(0, [t length])];
+
+ // Remove any line feeds from the beginning of the key
+ while ( [t characterAtIndex:0] == '\n' ) {
+ [t deleteCharactersInRange:NSMakeRange(0, 1)];
+ }
+
+ // Remove any line feeds at the end of the key
+ while ( [t characterAtIndex:[t length] - 1] == '\n' ) {
+ [t deleteCharactersInRange:NSMakeRange([t length] - 1, 1)];
+ }
+
+ // Remove whitespace around each line of the key.
+ NSMutableArray *pkeyTrimmedLines = [NSMutableArray array];
+ NSEnumerator *pkeyLinesEnumerator = [[t componentsSeparatedByString:@"\n"] objectEnumerator];
+ NSCharacterSet *whiteSet = [NSCharacterSet whitespaceCharacterSet];
+ NSString *pkeyLine;
+ while ((pkeyLine = [pkeyLinesEnumerator nextObject]) != nil)
+ {
+ [pkeyTrimmedLines addObject:[pkeyLine stringByTrimmingCharactersInSet:whiteSet]];
+ }
+ key = [pkeyTrimmedLines componentsJoinedByString:@"\n"]; // Put them back together.
+
+ // Base64 decode to return the raw key bits (DER format rather than PEM)
+ return b64decode( key );
+}
+
+#pragma mark -
+#pragma mark CDSA
+#pragma mark -
+
+/* Helper Functions */
+static CSSM_DATA_PTR su_createData( CFDataRef bytes );
+static void su_freeData( CSSM_DATA_PTR data, Boolean freeData );
+static Boolean su_copyBytesToData( CSSM_DATA_PTR data, CSSM_SIZE size, const uint8 *bytes );
+
+/* Memory functions */
+static void *su_malloc( CSSM_SIZE size, void *ref );
+static void su_free( void *ptr, void *ref );
+static void *su_realloc( void *ptr, CSSM_SIZE size, void *ref );
+static void *su_calloc( uint32 num, CSSM_SIZE size, void *ref );
+
+/* Constants & Typedefs */
+static CSSM_VERSION vers = { 2, 0 };
+static const CSSM_GUID su_guid = { 'S', 'p', 'a', { 'r', 'k', 'l', 'e', 0, 0, 0, 0 } };
+static CSSM_BOOL cssmInited = CSSM_FALSE;
+
+static CSSM_API_MEMORY_FUNCS SU_MemFuncs = {
+ su_malloc,
+ su_free,
+ su_realloc,
+ su_calloc,
+ NULL
+};
+
+static CSSM_CSP_HANDLE cdsaInit( void )
+{
+ CSSM_CSP_HANDLE cspHandle = CSSM_INVALID_HANDLE;
+ CSSM_RETURN crtn;
+
+ if ( !cssmInited ) {
+ CSSM_PVC_MODE pvcPolicy = CSSM_PVC_NONE;
+ crtn = CSSM_Init( &vers, CSSM_PRIVILEGE_SCOPE_NONE, &su_guid, CSSM_KEY_HIERARCHY_NONE, &pvcPolicy, NULL );
+ if ( crtn ) return CSSM_INVALID_HANDLE;
+ cssmInited = CSSM_TRUE;
+ }
+
+ crtn = CSSM_ModuleLoad( &gGuidAppleCSP, CSSM_KEY_HIERARCHY_NONE, NULL, NULL );
+ if ( crtn ) return CSSM_INVALID_HANDLE;
+
+ crtn = CSSM_ModuleAttach( &gGuidAppleCSP, &vers, &SU_MemFuncs, 0, CSSM_SERVICE_CSP, 0, CSSM_KEY_HIERARCHY_NONE, NULL, 0, NULL, &cspHandle );
+ if ( crtn ) return CSSM_INVALID_HANDLE;
+
+ return cspHandle;
+}
+
+static void cdsaRelease( CSSM_CSP_HANDLE cspHandle )
+{
+ if ( CSSM_ModuleDetach(cspHandle) != CSSM_OK ) return;
+ CSSM_ModuleUnload( &gGuidAppleCSP, NULL, NULL );
+}
+
+static CSSM_KEY_PTR cdsaCreateKey( CFDataRef rawKey )
+{
+ CSSM_KEY_PTR retval = NULL;
+
+ if ( !rawKey || (CFDataGetLength(rawKey) == 0) ) return NULL;
+
+ if ( (retval = su_malloc(sizeof(CSSM_KEY), NULL)) == NULL ) return NULL;
+
+ if ( !su_copyBytesToData(&(retval->KeyData), CFDataGetLength(rawKey), CFDataGetBytePtr(rawKey)) ) {
+ su_free( retval, NULL );
+ return NULL;
+ }
+
+ CSSM_KEYHEADER_PTR hdr = &(retval->KeyHeader);
+
+ memset( hdr, 0, sizeof(CSSM_KEYHEADER) );
+
+ hdr->HeaderVersion = CSSM_KEYHEADER_VERSION;
+ hdr->CspId = su_guid;
+ hdr->BlobType = CSSM_KEYBLOB_RAW;
+ hdr->Format = CSSM_KEYBLOB_RAW_FORMAT_X509;
+ hdr->AlgorithmId = CSSM_ALGID_DSA;
+ hdr->KeyClass = CSSM_KEYCLASS_PUBLIC_KEY;
+ hdr->KeyAttr = CSSM_KEYATTR_EXTRACTABLE;
+ hdr->KeyUsage = CSSM_KEYUSE_ANY;
+
+ return retval;
+}
+
+static void cdsaReleaseKey( CSSM_KEY_PTR key )
+{
+ if ( key ) {
+ if ( key->KeyData.Data ) su_free( key->KeyData.Data, NULL );
+ su_free( key, NULL );
+ }
+}
+
+BOOL cdsaVerifyKey( CSSM_CSP_HANDLE cspHandle, CSSM_KEY_PTR key )
+{
+ if ( key->KeyHeader.LogicalKeySizeInBits == 0 ) {
+ CSSM_RETURN crtn;
+ CSSM_KEY_SIZE keySize;
+
+ /* This will fail if the key isn't valid */
+ crtn = CSSM_QueryKeySizeInBits( cspHandle, CSSM_INVALID_HANDLE, key, &keySize );
+ if ( crtn ) return NO;
+ key->KeyHeader.LogicalKeySizeInBits = keySize.LogicalKeySizeInBits;
+ }
+ return YES;
+}
+
+static BOOL cdsaVerifySignature( CSSM_CSP_HANDLE cspHandle, const CSSM_KEY_PTR key, const CFDataRef msg, const CFDataRef signature )
+{
+ CSSM_CC_HANDLE ccHandle = CSSM_INVALID_HANDLE;
+ CSSM_DATA_PTR plain = su_createData( msg ), cipher = su_createData( signature );
+ BOOL retval = NO;
+
+ if ( !plain || !cipher || (CSSM_CSP_CreateSignatureContext(cspHandle, CSSM_ALGID_SHA1WithDSA, NULL, key, &ccHandle) != CSSM_OK) )
+ goto verify_end;
+
+ retval = ( CSSM_VerifyData(ccHandle, plain, 1, CSSM_ALGID_NONE, cipher) == CSSM_OK );
+
+verify_end:
+ su_freeData( plain, true );
+ su_freeData( cipher, true );
+ if ( ccHandle ) CSSM_DeleteContext( ccHandle );
+
+ return retval;
+}
+
+static CFDataRef cdsaCreateSHA1Digest( CSSM_CSP_HANDLE cspHandle, const CFDataRef bytes )
+{
+ CSSM_CC_HANDLE ccHandle = CSSM_INVALID_HANDLE;
+ CSSM_DATA_PTR data = su_createData( bytes ), dgst = su_createData( NULL );
+ CFDataRef retval = NULL;
+
+ if ( !data || !dgst || (CSSM_CSP_CreateDigestContext(cspHandle, CSSM_ALGID_SHA1, &ccHandle) != CSSM_OK) )
+ goto digest_end;
+
+ if ( CSSM_DigestData(ccHandle, data, 1, dgst) == CSSM_OK )
+ retval = CFDataCreate( kCFAllocatorDefault, (const UInt8 *)dgst->Data, (CFIndex)dgst->Length );
+
+digest_end:
+ su_freeData( data, true );
+ su_freeData( dgst, true );
+ if ( ccHandle ) CSSM_DeleteContext( ccHandle );
+
+ return retval;
+}
+
+/* Memory Functions */
+static void *su_malloc( CSSM_SIZE size, void *ref )
+{
+ return malloc( size );
+}
+
+static void su_free( void *ptr, void *ref )
+{
+ free( ptr );
+}
+
+static void *su_realloc( void *ptr, CSSM_SIZE size, void *ref )
+{
+ return realloc( ptr, size );
+}
+
+static void *su_calloc( uint32 num, CSSM_SIZE size, void *ref )
+{
+ return calloc( num, size );
+}
+
+/* Helper Functions */
+static CSSM_DATA_PTR su_createData( CFDataRef bytes )
+{
+ CSSM_DATA_PTR data = su_malloc( sizeof(CSSM_DATA), NULL );
+ if ( !data ) return NULL;
+ data->Data = NULL;
+ data->Length = 0;
+ if ( bytes ) su_copyBytesToData( data, CFDataGetLength(bytes), CFDataGetBytePtr(bytes) );
+ return data;
+}
+
+static void su_freeData( CSSM_DATA_PTR data, Boolean freeData )
+{
+ if ( data ) {
+ if ( freeData && data->Data ) su_free( data->Data, NULL );
+ su_free( data, NULL );
+ }
+}
+
+static Boolean su_copyBytesToData( CSSM_DATA_PTR data, CSSM_SIZE size, const uint8 *bytes )
+{
+ Boolean retval = false;
+ if ( size && bytes ) {
+ if ( (data->Data = su_malloc(size, NULL)) ) {
+ memcpy( data->Data, bytes, size );
+ data->Length = size;
+ retval = true;
+ }
+ }
+ return retval;
+}
diff --git a/SUDiskImageUnarchiver.m b/SUDiskImageUnarchiver.m
index 2f4706fb..95531974 100644
--- a/SUDiskImageUnarchiver.m
+++ b/SUDiskImageUnarchiver.m
@@ -9,6 +9,7 @@
#import "SUDiskImageUnarchiver.h"
#import "SUUnarchiver_Private.h"
#import "NTSynchronousTask.h"
+#import "SULog.h"
#import
@implementation SUDiskImageUnarchiver
@@ -18,11 +19,32 @@
return [[path pathExtension] isEqualToString:@"dmg"];
}
+// Called on a non-main thread.
- (void)extractDMG
-{
+{
+
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSData *result = [NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:[NSArray arrayWithObjects: @"isencrypted", archivePath, nil] input:NULL];
+ if([self isEncrypted:result] && [delegate respondsToSelector:@selector(unarchiver:requiresPasswordReturnedViaInvocation:)]) {
+ [self performSelectorOnMainThread:@selector(requestPasswordFromDelegate) withObject:nil waitUntilDone:NO];
+ } else {
+ [self extractDMGWithPassword:nil];
+ }
+
+ [pool release];
+}
+
+// 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;
@@ -42,26 +64,92 @@
}
}
while (noErr == FSPathMakeRefWithOptions((UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL));
+
+ NSData *promptData = nil;
+ if (password) {
+ NSString *data = [NSString stringWithFormat:@"%@\nyes\n", password];
+ const char *bytes = [data cStringUsingEncoding:NSUTF8StringEncoding];
+ NSUInteger length = [data lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
+ promptData = [NSData dataWithBytes:bytes length:length];
+ }
+ else
+ promptData = [NSData dataWithBytes:"yes\n" length:4];
- NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, @"-noverify", @"-nobrowse", @"-noautoopen", nil];
- // set up a pipe and push "yes" (y works too), this will accept any license agreement crap
- // not every .dmg needs this, but this will make sure it works with everyone
- NSData* yesData = [[[NSData alloc] initWithBytes:"yes\n" length:4] autorelease];
+ NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, /*@"-noverify",*/ @"-nobrowse", @"-noautoopen", nil];
+
+ 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;
+ }
- NSData *result = [NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:arguments input:yesData];
- if (!result) goto reportError;
+ if (taskResult != 0)
+ {
+ NSString* resultStr = output ? [[[NSString alloc] initWithData: output encoding: NSUTF8StringEncoding] autorelease] : nil;
+ if (password != nil && [resultStr rangeOfString:@"Authentication error"].location != NSNotFound && [delegate respondsToSelector:@selector(unarchiver:requiresPasswordReturnedViaInvocation:)]) {
+ [self performSelectorOnMainThread:@selector(requestPasswordFromDelegate) withObject:nil waitUntilDone:NO];
+ goto finally;
+ } else {
+ 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.
- 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;
-
- err = FSCopyObjectSync(&srcRef, &dstRef, (CFStringRef)mountPointName, NULL, kFSFileOperationSkipSourcePermissionErrors);
- if (err != noErr) goto reportError;
+ 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).
+ 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;
+ }
+
+ NSEnumerator *contentsEnumerator = [contents objectEnumerator];
+ NSString *item;
+ while ((item = [contentsEnumerator nextObject]))
+ {
+ 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;
+
+ err = FSCopyObjectSync(&srcRef, &dstRef, (CFStringRef)mountPointName, NULL, kFSFileOperationSkipSourcePermissionErrors);
+ if (err != noErr) goto reportError;
+ }
[self performSelectorOnMainThread:@selector(notifyDelegateOfSuccess) withObject:nil waitUntilDone:NO];
goto finally;
@@ -72,6 +160,8 @@ reportError:
finally:
if (mountedSuccessfully)
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray arrayWithObjects:@"detach", mountPoint, @"-force", nil]];
+ else
+ SULog(@"Can't mount DMG %@",archivePath);
[pool drain];
}
@@ -85,4 +175,32 @@ finally:
[self registerImplementation:self];
}
+- (BOOL)isEncrypted:(NSData*)resultData
+{
+ BOOL result = NO;
+ if(resultData)
+ {
+ NSString *data = [NSString stringWithCString:(char*)[resultData bytes] encoding:NSUTF8StringEncoding];
+ if (!NSEqualRanges([data rangeOfString:@"passphrase-count"], NSMakeRange(NSNotFound, 0)))
+ {
+ result = YES;
+ }
+ }
+ return result;
+}
+
+- (void)requestPasswordFromDelegate
+{
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:@selector(continueWithPassword:)]];
+ [invocation setSelector:@selector(continueWithPassword:)];
+ [invocation setTarget:self];
+ [invocation retainArguments];
+ [delegate unarchiver:self requiresPasswordReturnedViaInvocation:invocation];
+}
+
+- (void)continueWithPassword:(NSString *)password
+{
+ [NSThread detachNewThreadSelector:@selector(extractDMGWithPassword:) toTarget:self withObject:password];
+}
+
@end
diff --git a/SUHost.h b/SUHost.h
index c43b4041..58244ecf 100644
--- a/SUHost.h
+++ b/SUHost.h
@@ -5,12 +5,17 @@
// Copyright 2008 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
+#import "SUUpdater.h"
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
@interface SUHost : NSObject
{
@private
NSBundle *bundle;
+ NSString *defaultsDomain;
+ BOOL usesStandardUserDefaults;
}
+ (NSString *)systemVersionString;
@@ -18,6 +23,8 @@
- (id)initWithBundle:(NSBundle *)aBundle;
- (NSBundle *)bundle;
- (NSString *)bundlePath;
+- (NSString *)appSupportPath;
+- (NSString *)installationPath;
- (NSString *)name;
- (NSString *)version;
- (NSString *)displayVersion;
diff --git a/SUHost.m b/SUHost.m
index fb4ce412..e12af606 100644
--- a/SUHost.m
+++ b/SUHost.m
@@ -7,8 +7,11 @@
#import "SUHost.h"
+#import "SUConstants.h"
#import "SUSystemProfiler.h"
#import // For statfs for isRunningOnReadOnlyVolume
+#import "SULog.h"
+
@implementation SUHost
@@ -19,18 +22,26 @@
if (aBundle == nil) aBundle = [NSBundle mainBundle];
bundle = [aBundle retain];
if (![bundle bundleIdentifier])
- NSLog(@"Sparkle Error: the bundle being updated at %@ has no CFBundleIdentifier! This will cause preference read/write to not work properly.", bundle);
+ 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)
+ 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]];
}
return self;
}
- (void)dealloc
{
+ [defaultsDomain release];
[bundle release];
[super dealloc];
}
-- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self bundlePath]]; }
+- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [self bundlePath], [self installationPath]]; }
- (NSBundle *)bundle
{
@@ -42,6 +53,32 @@
return [bundle bundlePath];
}
+- (NSString *)appSupportPath
+{
+ NSArray *appSupportPaths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
+ NSString *appSupportPath = nil;
+ if (!appSupportPaths || [appSupportPaths count] == 0)
+ {
+ SULog(@"Failed to find app support directory! Using ~/Library/Application Support...");
+ appSupportPath = [@"~/Library/Application Support" stringByExpandingTildeInPath];
+ }
+ else
+ appSupportPath = [appSupportPaths objectAtIndex:0];
+ appSupportPath = [appSupportPath stringByAppendingPathComponent:[self name]];
+ return appSupportPath;
+}
+
+- (NSString *)installationPath
+{
+#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]]]])
+ return normalizedAppPath;
+#endif
+ return [bundle bundlePath];
+}
+
- (NSString *)name
{
NSString *name = [bundle objectForInfoDictionaryKey:@"CFBundleDisplayName"];
@@ -148,34 +185,33 @@
// 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 (bundle == [NSBundle mainBundle])
+ if (usesStandardUserDefaults)
return [[NSUserDefaults standardUserDefaults] objectForKey:defaultName];
- CFPropertyListRef obj = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)[bundle bundleIdentifier]);
+ CFPropertyListRef obj = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)defaultsDomain);
return [(id)CFMakeCollectable(obj) autorelease];
}
- (void)setObject:(id)value forUserDefaultsKey:(NSString *)defaultName;
{
- // If we're using a .app, we'll use the standard user defaults mechanism; otherwise, we have to get CF-y.
- if (bundle == [NSBundle mainBundle])
+ if (usesStandardUserDefaults)
{
[[NSUserDefaults standardUserDefaults] setObject:value forKey:defaultName];
}
else
{
- CFPreferencesSetValue((CFStringRef)defaultName, value, (CFStringRef)[bundle bundleIdentifier], kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
- CFPreferencesSynchronize((CFStringRef)[bundle bundleIdentifier], kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+ CFPreferencesSetValue((CFStringRef)defaultName, value, (CFStringRef)defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+ CFPreferencesSynchronize((CFStringRef)defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
}
}
- (BOOL)boolForUserDefaultsKey:(NSString *)defaultName
{
- if (bundle == [NSBundle mainBundle])
+ if (usesStandardUserDefaults)
return [[NSUserDefaults standardUserDefaults] boolForKey:defaultName];
BOOL value;
- CFPropertyListRef plr = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)[bundle bundleIdentifier]);
+ CFPropertyListRef plr = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)defaultsDomain);
if (plr == NULL)
value = NO;
else
@@ -188,15 +224,14 @@
- (void)setBool:(BOOL)value forUserDefaultsKey:(NSString *)defaultName
{
- // If we're using a .app, we'll use the standard user defaults mechanism; otherwise, we have to get CF-y.
- if (bundle == [NSBundle mainBundle])
+ if (usesStandardUserDefaults)
{
[[NSUserDefaults standardUserDefaults] setBool:value forKey:defaultName];
}
else
{
- CFPreferencesSetValue((CFStringRef)defaultName, (CFBooleanRef)[NSNumber numberWithBool:value], (CFStringRef)[bundle bundleIdentifier], kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
- CFPreferencesSynchronize((CFStringRef)[bundle bundleIdentifier], kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+ CFPreferencesSetValue((CFStringRef)defaultName, (CFBooleanRef)[NSNumber numberWithBool:value], (CFStringRef)defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+ CFPreferencesSynchronize((CFStringRef)defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
}
}
@@ -221,7 +256,7 @@
OSErr err3 = Gestalt(gestaltSystemVersionBugFix, &bugfix);
if (!err1 && !err2 && !err3)
{
- verStr = [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix];
+ verStr = [NSString stringWithFormat:@"%ld.%ld.%ld", (long)major, (long)minor, (long)bugfix];
}
else
#endif
diff --git a/SUInstaller.h b/SUInstaller.h
index 9ef2f1e1..c62a6aa2 100644
--- a/SUInstaller.h
+++ b/SUInstaller.h
@@ -14,8 +14,11 @@
@class SUHost;
@interface SUInstaller : NSObject { }
-+ (void)installFromUpdateFolder:(NSString *)updateFolder overHost:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )comparator;
-+ (void)finishInstallationWithResult:(BOOL)result host:(SUHost *)host error:(NSError *)error delegate:delegate;
++ (NSString *) appPathInUpdateFolder:(NSString *)updateFolder forHost:(SUHost *)host;
++ (void) installFromUpdateFolder:(NSString *)updateFolder overHost:(SUHost *)host installationPath:(NSString *)installationPath delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )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)
diff --git a/SUInstaller.m b/SUInstaller.m
index 4601d8ac..7294ce50 100644
--- a/SUInstaller.m
+++ b/SUInstaller.m
@@ -9,10 +9,20 @@
#import "SUInstaller.h"
#import "SUPlainInstaller.h"
#import "SUPackageInstaller.h"
-#import "SUHost.h"
+#import "SUHost.h"
+#import "SUConstants.h"
+#import "SULog.h"
+
@implementation SUInstaller
+static NSString* sUpdateFolder = nil;
+
++(NSString*) updateFolder
+{
+ return sUpdateFolder;
+}
+
+ (BOOL)isAliasFolderAtPath:(NSString *)path
{
FSRef fileRef;
@@ -32,17 +42,23 @@
return NO;
}
-
-+ (void)installFromUpdateFolder:(NSString *)updateFolder overHost:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )comparator
++ (NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr
{
- // Search subdirectories for the application
- NSString *currentFile, *newAppDownloadPath = nil, *bundleFileName = [[host bundlePath] lastPathComponent], *alternateBundleFileName = [[host name] stringByAppendingPathExtension:[[host bundlePath] pathExtension]];
+ // Search subdirectories for the application
+ NSString *currentFile,
+ *newAppDownloadPath = nil,
+ *bundleFileName = [[host bundlePath] lastPathComponent],
+ *alternateBundleFileName = [[host name] stringByAppendingPathExtension:[[host bundlePath] pathExtension]];
BOOL isPackage = NO;
NSString *fallbackPackagePath = nil;
- NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:updateFolder];
+ NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath: inUpdateFolder];
+
+ [sUpdateFolder release];
+ sUpdateFolder = [inUpdateFolder retain];
+
while ((currentFile = [dirEnum nextObject]))
{
- NSString *currentPath = [updateFolder stringByAppendingPathComponent:currentFile];
+ NSString *currentPath = [inUpdateFolder stringByAppendingPathComponent:currentFile];
if ([[currentFile lastPathComponent] isEqualToString:bundleFileName] ||
[[currentFile lastPathComponent] isEqualToString:alternateBundleFileName]) // We found one!
{
@@ -81,54 +97,86 @@
if ([self isAliasFolderAtPath:currentPath])
[dirEnum skipDescendents];
}
-
+
// We don't have a valid path. Try to use the fallback package.
-
+
if (newAppDownloadPath == nil && fallbackPackagePath != nil)
{
isPackage = YES;
newAppDownloadPath = fallbackPackagePath;
}
-
+
+ if (isPackagePtr) *isPackagePtr = isPackage;
+ return newAppDownloadPath;
+}
+
++ (NSString *)appPathInUpdateFolder:(NSString *)updateFolder forHost:(SUHost *)host
+{
+ BOOL isPackage = NO;
+ NSString *path = [self installSourcePathInUpdateFolder:updateFolder forHost:host isPackage:&isPackage];
+ return isPackage ? nil : path;
+}
+
++ (void)installFromUpdateFolder:(NSString *)inUpdateFolder overHost:(SUHost *)host installationPath:(NSString *)installationPath delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )comparator
+{
+ BOOL isPackage = NO;
+ NSString *newAppDownloadPath = [self installSourcePathInUpdateFolder:inUpdateFolder forHost:host isPackage:&isPackage];
+
if (newAppDownloadPath == nil)
{
- [self finishInstallationWithResult: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:[NSDictionary dictionaryWithObject:@"Couldn't find an appropriate update in the downloaded package." forKey:NSLocalizedDescriptionKey]] delegate:delegate];
}
else
{
- [(isPackage ? [SUPackageInstaller class] : [SUPlainInstaller class]) performInstallationWithPath:newAppDownloadPath host:host delegate:delegate synchronously:synchronously versionComparator:comparator];
+ [(isPackage ? [SUPackageInstaller class] : [SUPlainInstaller class]) performInstallationToPath:installationPath fromPath:newAppDownloadPath host:host delegate:delegate synchronously:synchronously versionComparator:comparator];
}
}
-+ (void)mdimportHost:(SUHost *)host
++ (void)mdimportInstallationPath:(NSString *)installationPath
{
+ // *** GETS CALLED ON NON-MAIN THREAD!
+
+ SULog( @"mdimporting" );
+
NSTask *mdimport = [[[NSTask alloc] init] autorelease];
[mdimport setLaunchPath:@"/usr/bin/mdimport"];
- [mdimport setArguments:[NSArray arrayWithObject:[host bundlePath]]];
+ [mdimport setArguments:[NSArray arrayWithObject:installationPath]];
@try
{
[mdimport launch];
+ [mdimport waitUntilExit];
}
@catch (NSException * launchException)
{
// No big deal.
- NSLog(@"Sparkle Error: %@", [launchException description]);
+ SULog(@"Sparkle Error: %@", [launchException description]);
}
}
-+ (void)finishInstallationWithResult:(BOOL)result host:(SUHost *)host error:(NSError *)error delegate:delegate
+
+#define SUNotifyDictHostKey @"SUNotifyDictHost"
+#define SUNotifyDictErrorKey @"SUNotifyDictError"
+#define SUNotifyDictDelegateKey @"SUNotifyDictDelegate"
+
++ (void)finishInstallationToPath:(NSString *)installationPath withResult:(BOOL)result host:(SUHost *)host error:(NSError *)error delegate:delegate
{
if (result)
{
- [self mdimportHost:host];
+ [self mdimportInstallationPath:installationPath];
if ([delegate respondsToSelector:@selector(installerFinishedForHost:)])
- [delegate installerFinishedForHost:host];
+ [delegate performSelectorOnMainThread: @selector(installerFinishedForHost:) withObject: host waitUntilDone: NO];
}
else
{
if ([delegate respondsToSelector:@selector(installerForHost:failedWithError:)])
- [delegate installerForHost:host failedWithError:error];
+ [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]];
+}
+
@end
diff --git a/SULog.h b/SULog.h
new file mode 100644
index 00000000..7631f95e
--- /dev/null
+++ b/SULog.h
@@ -0,0 +1,31 @@
+/*
+ * SULog.h
+ * EyeTV
+ *
+ * Created by Uli Kusterer on 12/03/2009.
+ * Copyright 2008 Elgato Systems GmbH. All rights reserved.
+ *
+ */
+
+/*
+ Log output for troubleshooting Sparkle failures on end-user machines.
+ Your tech support will hug you if you tell them about this.
+*/
+
+#pragma once
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#include
+
+
+// -----------------------------------------------------------------------------
+// Prototypes:
+// -----------------------------------------------------------------------------
+
+void SUClearLog( void );
+void SULog( NSString* format, ... );
+
+
diff --git a/SULog.m b/SULog.m
new file mode 100644
index 00000000..b58235aa
--- /dev/null
+++ b/SULog.m
@@ -0,0 +1,80 @@
+/*
+ * SULog.m
+ * EyeTV
+ *
+ * Created by Uli Kusterer on 12/03/2009.
+ * Copyright 2009 Elgato Systems GmbH. All rights reserved.
+ *
+ */
+
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
+#include "SULog.h"
+
+
+// -----------------------------------------------------------------------------
+// Constants:
+// -----------------------------------------------------------------------------
+
+#define LOG_FILE_PATH @"~/Library/Logs/SparkleUpdateLog.log"
+
+
+// -----------------------------------------------------------------------------
+// SUClearLog:
+// Erase the log at the start of an update. We don't want to litter the
+// user's hard disk with logging data that's mostly unused, so each app
+// should clear the log before it starts updating, so only the most recent
+// update is kept around.
+//
+// TAKES:
+// sender - Object that sent this message, typically of type X.
+//
+// GIVES:
+// param - who owns the returned value?
+// result - same here.
+// -----------------------------------------------------------------------------
+
+void SUClearLog( void )
+{
+ FILE* logfile = fopen([[LOG_FILE_PATH stringByExpandingTildeInPath] fileSystemRepresentation],"w");
+ if( logfile )
+ fclose(logfile);
+ else
+ NSLog(@"----- Sparkle Log -----");
+}
+
+
+// -----------------------------------------------------------------------------
+// SULog:
+// Like NSLog, but logs to one specific log file. Each line is prefixed
+// with the current date and time, to help in regressing issues.
+//
+// TAKES:
+// format - NSLog/printf-style format string.
+// ... - More parameters depending on format string's contents.
+// -----------------------------------------------------------------------------
+
+void SULog( NSString* format, ... )
+{
+ va_list ap;
+ va_start(ap, format);
+ NSString* theStr = [[[NSString alloc] initWithFormat: format arguments: ap] autorelease];
+ FILE* logfile = fopen([[LOG_FILE_PATH stringByExpandingTildeInPath] fileSystemRepresentation],"a");
+ if( !logfile )
+ NSLog( @"%@",theStr );
+ else
+ {
+ theStr = [NSString stringWithFormat: @"%@: %@", [NSDate date], theStr];
+ NSData* theData = [theStr dataUsingEncoding: NSUTF8StringEncoding];
+ char newlineChar = '\n';
+ fwrite( [theData bytes], 1, [theData length], logfile );
+ fwrite( &newlineChar, 1, 1, logfile ); // Append a newline.
+ fclose( logfile );
+ logfile = NULL;
+ }
+ va_end(ap);
+}
+
+
diff --git a/SUModelTranslation.plist b/SUModelTranslation.plist
index 92ef9471..63644f08 100644
--- a/SUModelTranslation.plist
+++ b/SUModelTranslation.plist
@@ -4,6 +4,20 @@
ADP2,1
Developer Transition Kit
+ iMac1,1
+ iMac G3 (Rev A-D)
+ iMac4,1
+ iMac (Core Duo)
+ iMac4,2
+ iMac for Education (17-inch, Core Duo)
+ iMac5,1
+ iMac (Core 2 Duo, 17 or 20 inch, SuperDrive)
+ iMac5,2
+ iMac (Core 2 Duo, 17 inch, Combo Drive)
+ iMac6,1
+ iMac (Core 2 Duo, 24 inch, SuperDrive)
+ iMac8,1
+ iMac (April 2008)
MacBook1,1
MacBook (Core Duo)
MacBook2,1
@@ -12,6 +26,10 @@
MacBook (Core 2 Duo Feb 2008)
MacBookAir1,1
MacBook Air (January 2008)
+ MacBookAir2,1
+ MacBook Air (June 2009)
+ MacBookAir3,1
+ MacBook Air (October 2010)
MacBookPro1,1
MacBook Pro Core Duo (15-inch)
MacBookPro1,2
@@ -26,14 +44,18 @@
MacBook Pro Core 2 Duo (17-inch HD, Core 2 Duo)
MacBookPro4,1
MacBook Pro (Core 2 Duo Feb 2008)
+ Macmini1,1
+ Mac Mini (Core Solo/Duo)
MacPro1,1
Mac Pro (four-core)
MacPro2,1
Mac Pro (eight-core)
MacPro3,1
- Mac Pro (January 2008 4- or 8- core "Harpertown")
- Macmini1,1
- Mac Mini (Core Solo/Duo)
+ Mac Pro (January 2008 4- or 8- core "Harpertown")
+ MacPro4,1
+ Mac Pro (March 2009)
+ MacPro5,1
+ Mac Pro (August 2010)
PowerBook1,1
PowerBook G3
PowerBook2,1
@@ -156,19 +178,5 @@
Xserve (Intel Xeon)
Xserve2,1
Xserve (January 2008 quad-core)
- iMac1,1
- iMac G3 (Rev A-D)
- iMac4,1
- iMac (Core Duo)
- iMac4,2
- iMac for Education (17-inch, Core Duo)
- iMac5,1
- iMac (Core 2 Duo, 17 or 20 inch, SuperDrive)
- iMac5,2
- iMac (Core 2 Duo, 17 inch, Combo Drive)
- iMac6,1
- iMac (Core 2 Duo, 24 inch, SuperDrive)
- iMac8,1
- iMac (April 2008)
diff --git a/SUPackageInstaller.h b/SUPackageInstaller.h
index b31bc59d..5b69095f 100644
--- a/SUPackageInstaller.h
+++ b/SUPackageInstaller.h
@@ -9,7 +9,11 @@
#ifndef SUPACKAGEINSTALLER_H
#define SUPACKAGEINSTALLER_H
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
#import "SUPlainInstaller.h"
@interface SUPackageInstaller : SUPlainInstaller { }
diff --git a/SUPackageInstaller.m b/SUPackageInstaller.m
index 804ce41d..f754231f 100644
--- a/SUPackageInstaller.m
+++ b/SUPackageInstaller.m
@@ -7,17 +7,20 @@
//
#import "SUPackageInstaller.h"
+#import
+#import "SUConstants.h"
NSString *SUPackageInstallerCommandKey = @"SUPackageInstallerCommand";
NSString *SUPackageInstallerArgumentsKey = @"SUPackageInstallerArguments";
NSString *SUPackageInstallerHostKey = @"SUPackageInstallerHost";
NSString *SUPackageInstallerDelegateKey = @"SUPackageInstallerDelegate";
+NSString *SUPackageInstallerInstallationPathKey = @"SUPackageInstallerInstallationPathKey";
@implementation SUPackageInstaller
+ (void)finishInstallationWithInfo:(NSDictionary *)info
{
- [self finishInstallationWithResult:YES host:[info objectForKey:SUPackageInstallerHostKey] error:nil delegate:[info objectForKey:SUPackageInstallerDelegateKey]];
+ [self finishInstallationToPath:[info objectForKey:SUPackageInstallerInstallationPathKey] withResult:YES host:[info objectForKey:SUPackageInstallerHostKey] error:nil delegate:[info objectForKey:SUPackageInstallerDelegateKey]];
}
+ (void)performInstallationWithInfo:(NSDictionary *)info
@@ -33,7 +36,7 @@ NSString *SUPackageInstallerDelegateKey = @"SUPackageInstallerDelegate";
[pool drain];
}
-+ (void)performInstallationWithPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )comparator
++ (void)performInstallationToPath:(NSString *)installationPath fromPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )comparator
{
NSString *command;
NSArray *args;
@@ -54,11 +57,11 @@ NSString *SUPackageInstallerDelegateKey = @"SUPackageInstallerDelegate";
if (![[NSFileManager defaultManager] fileExistsAtPath:command])
{
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingInstallerToolError userInfo:[NSDictionary dictionaryWithObject:@"Couldn't find Apple's installer tool!" forKey:NSLocalizedDescriptionKey]];
- [self finishInstallationWithResult:NO host:host error:error delegate:delegate];
+ [self finishInstallationToPath:installationPath withResult:NO host:host error:error delegate:delegate];
}
else
{
- NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:command, SUPackageInstallerCommandKey, args, SUPackageInstallerArgumentsKey, host, SUPackageInstallerHostKey, delegate, SUPackageInstallerDelegateKey, nil];
+ NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:command, SUPackageInstallerCommandKey, args, SUPackageInstallerArgumentsKey, host, SUPackageInstallerHostKey, delegate, SUPackageInstallerDelegateKey, installationPath, SUPackageInstallerInstallationPathKey, nil];
if (synchronously)
[self performInstallationWithInfo:info];
else
diff --git a/SUPasswordPrompt.h b/SUPasswordPrompt.h
new file mode 100644
index 00000000..c70372a5
--- /dev/null
+++ b/SUPasswordPrompt.h
@@ -0,0 +1,26 @@
+//
+// SUPasswordPrompt.h
+// Sparkle
+//
+// Created by rudy on 8/18/09.
+// Copyright 2009 Ambrosia Software, Inc.. All rights reserved.
+//
+
+#import
+#import "Sparkle/SUWindowController.h"
+
+@interface SUPasswordPrompt : SUWindowController
+{
+ IBOutlet NSImageView *mIconView;
+ IBOutlet NSTextField *mTextDescription;
+ IBOutlet NSSecureTextField *mPasswordField;
+ NSString *mPassword;
+ NSString *mName;
+ NSImage *mIcon;
+}
+
+- (id)initWithHost:(SUHost *)aHost;
+- (NSInteger)run;
+- (NSString *)password;
+
+@end
diff --git a/SUPasswordPrompt.m b/SUPasswordPrompt.m
new file mode 100644
index 00000000..4cff46dc
--- /dev/null
+++ b/SUPasswordPrompt.m
@@ -0,0 +1,86 @@
+//
+// SUPasswordPrompt.m
+// Sparkle
+//
+// Created by rudy on 8/18/09.
+// Copyright 2009 Ambrosia Software, Inc.. All rights reserved.
+//
+
+#import "SUPasswordPrompt.h"
+
+
+@implementation SUPasswordPrompt
+
+- (id)initWithHost:(SUHost *)aHost
+{
+ self = [super initWithHost:aHost windowNibName:@"SUPasswordPrompt"];
+ if (self)
+ {
+ [self setName:[aHost name]];
+ [self setIcon:[aHost icon]];
+ mPassword = nil;
+ [self setShouldCascadeWindows:NO];
+ }
+ return self;
+}
+
+- (void)awakeFromNib
+{
+ [mIconView setImage:[self icon]];
+}
+
+- (void)setName:(NSString*)name
+{
+ [mName release];
+ mName = [name retain];
+}
+
+- (NSString*)name
+{
+ return mName;
+}
+
+- (void)setIcon:(NSImage*)icon
+{
+ [mIcon release];
+ mIcon = [icon retain];
+}
+
+- (NSImage*)icon
+{
+ return mIcon;
+}
+
+- (NSString *)password
+{
+ return mPassword;
+}
+
+- (void)setPassword:(NSString*)password
+{
+ [mPassword release];
+ mPassword = [password retain];
+}
+
+- (NSInteger)run
+{
+ //modally run a password prompt
+ NSInteger result = [NSApp runModalForWindow:[self window]];
+ if(result)
+ [self setPassword:[mPasswordField stringValue]];
+ return result;
+}
+
+- (IBAction)accept:(id)sender
+{
+ [[self window] orderOut:self];
+ [NSApp stopModalWithCode:1];
+}
+
+- (IBAction)cancel:(id)sender
+{
+ [[self window] orderOut:self];
+ [NSApp stopModalWithCode:0];
+}
+
+@end
diff --git a/SUPipedUnarchiver.m b/SUPipedUnarchiver.m
index 27853d89..e70f0797 100644
--- a/SUPipedUnarchiver.m
+++ b/SUPipedUnarchiver.m
@@ -8,6 +8,8 @@
#import "SUPipedUnarchiver.h"
#import "SUUnarchiver_Private.h"
+#import "SULog.h"
+
@implementation SUPipedUnarchiver
@@ -44,9 +46,15 @@
// This method abstracts the types that use a command line tool piping data from stdin.
- (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.
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
NSNumber *fs = [[[NSFileManager defaultManager] fileAttributesAtPath:archivePath traverseLink:NO] objectForKey:NSFileSize];
@@ -60,6 +68,7 @@
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;
@@ -92,26 +101,38 @@ reportError:
finally:
if (fp)
fclose(fp);
- [pool drain];
+ if (oldDestinationString)
+ setenv("DESTINATION", oldDestinationString, 1);
+ else
+ unsetenv("DESTINATION");
+ [pool release];
}
- (void)extractTAR
{
+ // *** GETS CALLED ON NON-MAIN THREAD!!!
+
return [self extractArchivePipingDataToCommand:@"tar -xC \"$DESTINATION\""];
}
- (void)extractTGZ
{
+ // *** GETS CALLED ON NON-MAIN THREAD!!!
+
return [self extractArchivePipingDataToCommand:@"tar -zxC \"$DESTINATION\""];
}
- (void)extractTBZ
{
+ // *** GETS CALLED ON NON-MAIN THREAD!!!
+
return [self extractArchivePipingDataToCommand:@"tar -jxC \"$DESTINATION\""];
}
- (void)extractZIP
{
+ // *** GETS CALLED ON NON-MAIN THREAD!!!
+
return [self extractArchivePipingDataToCommand:@"ditto -x -k - \"$DESTINATION\""];
}
diff --git a/SUPlainInstaller.h b/SUPlainInstaller.h
index 54747283..e75f0401 100644
--- a/SUPlainInstaller.h
+++ b/SUPlainInstaller.h
@@ -9,13 +9,18 @@
#ifndef SUPLAININSTALLER_H
#define SUPLAININSTALLER_H
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
#import "SUInstaller.h"
#import "SUVersionComparisonProtocol.h"
@class SUHost;
+
@interface SUPlainInstaller : SUInstaller { }
-+ (void)performInstallationWithPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )comparator;
++ (void)performInstallationToPath:(NSString *)installationPath fromPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )comparator;
@end
#endif
diff --git a/SUPlainInstaller.m b/SUPlainInstaller.m
index ffb0cb6d..62675c8c 100644
--- a/SUPlainInstaller.m
+++ b/SUPlainInstaller.m
@@ -8,6 +8,7 @@
#import "SUPlainInstaller.h"
#import "SUPlainInstallerInternals.h"
+#import "SUConstants.h"
#import "SUHost.h"
static NSString * const SUInstallerPathKey = @"SUInstallerPath";
@@ -17,24 +18,39 @@ static NSString * const SUInstallerHostKey = @"SUInstallerHost";
static NSString * const SUInstallerDelegateKey = @"SUInstallerDelegate";
static NSString * const SUInstallerResultKey = @"SUInstallerResult";
static NSString * const SUInstallerErrorKey = @"SUInstallerError";
+static NSString * const SUInstallerInstallationPathKey = @"SUInstallerInstallationPath";
@implementation SUPlainInstaller
+ (void)finishInstallationWithInfo:(NSDictionary *)info
{
- [self finishInstallationWithResult:[[info objectForKey:SUInstallerResultKey] boolValue] host:[info objectForKey:SUInstallerHostKey] error:[info objectForKey:SUInstallerErrorKey] delegate:[info objectForKey:SUInstallerDelegateKey]];
+ // *** 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]];
}
+ (void)performInstallationWithInfo:(NSDictionary *)info
{
+ // *** GETS CALLED ON NON-MAIN THREAD!
+
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSError *error = nil;
- BOOL result = [self copyPathWithAuthentication:[info objectForKey:SUInstallerPathKey] overPath:[info objectForKey:SUInstallerTargetPathKey] temporaryName:[info objectForKey:SUInstallerTempNameKey] error:&error];
+ 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.
+ }
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];
@@ -42,20 +58,22 @@ static NSString * const SUInstallerErrorKey = @"SUInstallerError";
[pool drain];
}
-+ (void)performInstallationWithPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )comparator
++ (void)performInstallationToPath:(NSString *)installationPath fromPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id )comparator
{
// Prevent malicious downgrades:
+ #if !PERMIT_AUTOMATED_DOWNGRADES
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]];
- [self finishInstallationWithResult:NO host:host error:error delegate:delegate];
+ [self finishInstallationToPath:installationPath withResult:NO host:host error:error delegate:delegate];
return;
}
+ #endif
- NSString *targetPath = [host bundlePath];
+ NSString *targetPath = [host installationPath];
NSString *tempName = [self temporaryNameForPath:targetPath];
- NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:path, SUInstallerPathKey, targetPath, SUInstallerTargetPathKey, tempName, SUInstallerTempNameKey, host, SUInstallerHostKey, delegate, SUInstallerDelegateKey, nil];
+ NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:path, SUInstallerPathKey, targetPath, SUInstallerTargetPathKey, tempName, SUInstallerTempNameKey, host, SUInstallerHostKey, delegate, SUInstallerDelegateKey, installationPath, SUInstallerInstallationPathKey, nil];
if (synchronously)
[self performInstallationWithInfo:info];
else
diff --git a/SUPlainInstallerInternals.h b/SUPlainInstallerInternals.h
index 1c250b7e..24cd49a2 100644
--- a/SUPlainInstallerInternals.h
+++ b/SUPlainInstallerInternals.h
@@ -14,6 +14,9 @@
@interface SUPlainInstaller (Internals)
+ (NSString *)temporaryNameForPath:(NSString *)path;
+ (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst temporaryName:(NSString *)tmp error:(NSError **)error;
++ (void)_movePathToTrash:(NSString *)path;
++ (BOOL)_removeFileAtPath:(NSString *)path error: (NSError**)error;
++ (BOOL)_removeFileAtPathWithForcedAuthentication:(NSString *)src error:(NSError **)error;
@end
#endif
diff --git a/SUPlainInstallerInternals.m b/SUPlainInstallerInternals.m
index 77191262..1eb6b8a8 100644
--- a/SUPlainInstallerInternals.m
+++ b/SUPlainInstallerInternals.m
@@ -6,8 +6,14 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
#import "SUPlainInstallerInternals.h"
+#import "SUConstants.h"
+#import "SULog.h"
#import
#import
@@ -15,6 +21,8 @@
#import
#import
#import
+#import
+
@interface SUPlainInstaller (MMExtendedAttributes)
// Removes the directory tree rooted at |root| from the file quarantine.
@@ -42,6 +50,8 @@
static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authorization, const char* executablePath, AuthorizationFlags options, const char* const* arguments)
{
+ // *** MUST BE SAFE TO CALL ON NON-MAIN THREAD!
+
sig_t oldSigChildHandler = signal(SIGCHLD, SIG_DFL);
BOOL returnValue = YES;
@@ -85,14 +95,86 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
return [tempDir lastPathComponent];
}
-+ (BOOL)copyPathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst temporaryPath:(NSString *)tmp error:(NSError **)error
++ (NSString *)_temporaryCopyNameForPath:(NSString *)path didFindTrash: (BOOL*)outDidFindTrash
{
+ // *** MUST BE SAFE TO CALL ON NON-MAIN THREAD!
+ NSString *tempDir = nil;
+
+ UInt8 trashPath[MAXPATHLEN +1] = { 0 };
+ FSRef trashRef, pathRef;
+ FSVolumeRefNum vSrcRefNum = kFSInvalidVolumeRefNum;
+ FSCatalogInfo catInfo;
+ memset( &catInfo, 0, sizeof(catInfo) );
+ OSStatus err = FSPathMakeRef( (UInt8*) [path fileSystemRepresentation], &pathRef, NULL );
+ if( err == noErr )
+ {
+ err = FSGetCatalogInfo( &pathRef, kFSCatInfoVolume, &catInfo, NULL, NULL, NULL );
+ vSrcRefNum = catInfo.volume;
+ }
+ if( err == noErr )
+ err = FSFindFolder( vSrcRefNum, kTrashFolderType, kCreateFolder, &trashRef );
+ if( err == noErr )
+ err = FSGetCatalogInfo( &trashRef, kFSCatInfoVolume, &catInfo, NULL, NULL, NULL );
+ if( err == noErr && vSrcRefNum != catInfo.volume )
+ err = nsvErr; // Couldn't find a trash folder on same volume as given path. Docs say this may happen in the future.
+ if( err == noErr )
+ err = FSRefMakePath( &trashRef, trashPath, MAXPATHLEN );
+ if( err == noErr )
+ tempDir = [[NSFileManager defaultManager] stringWithFileSystemRepresentation: (char*) trashPath length: strlen((char*) trashPath)];
+ if( outDidFindTrash )
+ *outDidFindTrash = (tempDir != nil);
+ if( !tempDir )
+ tempDir = [path stringByDeletingLastPathComponent];
+
+ // Let's try to read the version number so the filename will be more meaningful.
+ #if TRY_TO_APPEND_VERSION_NUMBER
+ NSString *postFix = nil;
+ NSString *version = nil;
+ if ((version = [[NSBundle bundleWithPath: path] objectForInfoDictionaryKey:@"CFBundleVersion"]) && ![version isEqualToString:@""])
+ {
+ // We'll clean it up a little for safety.
+ // The cast is necessary because of a bug in the headers in pre-10.5 SDKs
+ NSMutableCharacterSet *validCharacters = (id)[NSMutableCharacterSet alphanumericCharacterSet];
+ [validCharacters formUnionWithCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@".-()"]];
+ postFix = [version stringByTrimmingCharactersInSet:[validCharacters invertedSet]];
+ }
+ else
+ postFix = @"old";
+ NSString *prefix = [NSString stringWithFormat: @"%@ (%@)", [[path lastPathComponent] stringByDeletingPathExtension], postFix];
+ #else
+ NSString *prefix = [[path lastPathComponent] stringByDeletingPathExtension];
+ #endif
+ NSString *tempName = [prefix stringByAppendingPathExtension: [path pathExtension]];
+ tempDir = [tempDir stringByAppendingPathComponent: tempName];
+
+ // Now let's make sure we get a unique path.
+ int cnt=2;
+ while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt <= 9999)
+ tempDir = [[tempDir stringByDeletingLastPathComponent] stringByAppendingPathComponent: [NSString stringWithFormat:@"%@ %d.%@", prefix, cnt++, [path pathExtension]]];
+
+ return tempDir;
+}
+
++ (BOOL)_copyPathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst temporaryPath:(NSString *)tmp error:(NSError **)error
+{
+ // *** MUST BE SAFE TO CALL ON NON-MAIN THREAD!
+
const char* srcPath = [src fileSystemRepresentation];
const char* tmpPath = [tmp fileSystemRepresentation];
const char* dstPath = [dst fileSystemRepresentation];
struct stat dstSB;
- stat(dstPath, &dstSB);
+ if( stat(dstPath, &dstSB) != 0 ) // Doesn't exist yet, try containing folder.
+ {
+ const char* dstDirPath = [[dst stringByDeletingLastPathComponent] fileSystemRepresentation];
+ if( stat(dstDirPath, &dstSB) != 0 )
+ {
+ 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]];
+ return NO;
+ }
+ }
AuthorizationRef auth = NULL;
OSStatus authStat = errAuthorizationDenied;
@@ -108,40 +190,63 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
res = YES;
char uidgid[42];
- snprintf(uidgid, sizeof(uidgid), "%d:%d",
+ snprintf(uidgid, sizeof(uidgid), "%u:%u",
dstSB.st_uid, dstSB.st_gid);
- const char* executables[] = {
- "/bin/rm",
- "/bin/mv",
- "/bin/mv",
- "/bin/rm",
- NULL, // pause here and do some housekeeping before
- // continuing
- "/usr/sbin/chown",
- NULL // stop here for real
- };
-
- // 4 is the maximum number of arguments to any command,
- // including the NULL that signals the end of an argument
- // list.
- const char* const argumentLists[][4] = {
- { "-rf", tmpPath, NULL }, // make room for the temporary file... this is kinda unsafe; should probably do something better.
- { "-f", dstPath, tmpPath, NULL }, // mv
- { "-f", srcPath, dstPath, NULL }, // mv
- { "-rf", tmpPath, NULL }, // rm
- { NULL }, // pause
- { "-R", uidgid, dstPath, NULL }, // chown
- { NULL } // stop
- };
-
- // Process the commands up until the first NULL
- unsigned int commandIndex = 0;
- for (; executables[commandIndex] != NULL; ++commandIndex) {
- if (res)
- res = AuthorizationExecuteWithPrivilegesAndWait(auth, executables[commandIndex], kAuthorizationFlagDefaults, argumentLists[commandIndex]);
+ // If the currently-running application is trusted, the new
+ // version should be trusted as well. Remove it from the
+ // quarantine to avoid a delay at launch, and to avoid
+ // presenting the user with a confusing trust dialog.
+ //
+ // This needs to be done before "chown" changes ownership,
+ // because the ownership change will fail if the file is quarantined.
+ if (res)
+ {
+ SULog(@"releaseFromQuarantine");
+ [self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:src waitUntilDone:YES];
}
+ if( res ) // Set permissions while it's still in source, so we have it with working and correct perms when it arrives at destination.
+ {
+ const char* coParams[] = { "-R", uidgid, srcPath, NULL };
+ res = AuthorizationExecuteWithPrivilegesAndWait( auth, "/usr/sbin/chown", kAuthorizationFlagDefaults, coParams );
+ if( !res )
+ SULog( @"chown -R %s %s failed.", uidgid, srcPath );
+ }
+
+ BOOL haveDst = [[NSFileManager defaultManager] fileExistsAtPath: dst];
+ if( res && haveDst ) // If there's something at our tmp path (previous failed update or whatever) delete that first.
+ {
+ const char* rmParams[] = { "-rf", tmpPath, NULL };
+ res = AuthorizationExecuteWithPrivilegesAndWait( auth, "/bin/rm", kAuthorizationFlagDefaults, rmParams );
+ if( !res )
+ SULog( @"rm failed" );
+ }
+
+ if( res && haveDst ) // Move old exe to tmp path.
+ {
+ const char* mvParams[] = { "-f", dstPath, tmpPath, NULL };
+ res = AuthorizationExecuteWithPrivilegesAndWait( auth, "/bin/mv", kAuthorizationFlagDefaults, mvParams );
+ if( !res )
+ SULog( @"mv 1 failed" );
+ }
+
+ if( res ) // Move new exe to old exe's path.
+ {
+ const char* mvParams2[] = { "-f", srcPath, dstPath, NULL };
+ res = AuthorizationExecuteWithPrivilegesAndWait( auth, "/bin/mv", kAuthorizationFlagDefaults, mvParams2 );
+ if( !res )
+ SULog( @"mv 2 failed" );
+ }
+
+// if( res && haveDst /*&& !foundTrash*/ ) // If we managed to put the old exe in the trash, leave it there for the user to delete or recover.
+// { // ... Otherwise we better delete it, wouldn't want dozens of old versions lying around next to the new one.
+// const char* rmParams2[] = { "-rf", tmpPath, NULL };
+// res = AuthorizationExecuteWithPrivilegesAndWait( auth, "/bin/rm", kAuthorizationFlagDefaults, rmParams2 );
+// }
+
+ AuthorizationFree(auth, 0);
+
// If the currently-running application is trusted, the new
// version should be trusted as well. Remove it from the
// quarantine to avoid a delay at launch, and to avoid
@@ -150,25 +255,13 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
// This needs to be done after the application is moved to its
// new home with "mv" in case it's moved across filesystems: if
// that happens, "mv" actually performs a copy and may result
- // in the application being quarantined. It also needs to be
- // done before "chown" changes ownership, because the ownership
- // change will almost certainly make it impossible to change
- // attributes to release the files from the quarantine.
- if (res) {
+ // in the application being quarantined.
+ if (res)
+ {
+ SULog(@"releaseFromQuarantine after installing");
[self performSelectorOnMainThread:@selector(releaseFromQuarantine:) withObject:dst waitUntilDone:YES];
}
-
- // Now move past the NULL we found and continue executing
- // commands from the list.
- ++commandIndex;
-
- for (; executables[commandIndex] != NULL; ++commandIndex) {
- if (res)
- res = AuthorizationExecuteWithPrivilegesAndWait(auth, executables[commandIndex], kAuthorizationFlagDefaults, argumentLists[commandIndex]);
- }
-
- AuthorizationFree(auth, 0);
-
+
if (!res)
{
// Something went wrong somewhere along the way, but we're not sure exactly where.
@@ -185,63 +278,253 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
return res;
}
-+ (void)movePathToTrash:(NSString *)path
++ (BOOL)_movePathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst error:(NSError **)error
{
+ // *** MUST BE SAFE TO CALL ON NON-MAIN THREAD!
+
+ const char* srcPath = [src fileSystemRepresentation];
+ const char* dstPath = [dst fileSystemRepresentation];
+ const char* dstContainerPath = [[dst stringByDeletingLastPathComponent] fileSystemRepresentation];
+
+ struct stat dstSB;
+ stat(dstContainerPath, &dstSB);
+
+ AuthorizationRef auth = NULL;
+ OSStatus authStat = errAuthorizationDenied;
+ while( authStat == errAuthorizationDenied )
+ {
+ authStat = AuthorizationCreate(NULL,
+ kAuthorizationEmptyEnvironment,
+ kAuthorizationFlagDefaults,
+ &auth);
+ }
+
+ BOOL res = NO;
+ if (authStat == errAuthorizationSuccess)
+ {
+ res = YES;
+
+ char uidgid[42];
+ snprintf(uidgid, sizeof(uidgid), "%d:%d",
+ dstSB.st_uid, dstSB.st_gid);
+
+ if( res ) // Set permissions while it's still in source, so we have it with working and correct perms when it arrives at destination.
+ {
+ const char* coParams[] = { "-R", uidgid, srcPath, NULL };
+ res = AuthorizationExecuteWithPrivilegesAndWait( auth, "/usr/sbin/chown", kAuthorizationFlagDefaults, coParams );
+ if( !res )
+ SULog(@"Can't set permissions");
+ }
+
+ BOOL haveDst = [[NSFileManager defaultManager] fileExistsAtPath: dst];
+ if( res && haveDst ) // If there's something at our tmp path (previous failed update or whatever) delete that first.
+ {
+ const char* rmParams[] = { "-rf", dstPath, NULL };
+ res = AuthorizationExecuteWithPrivilegesAndWait( auth, "/bin/rm", kAuthorizationFlagDefaults, rmParams );
+ if( !res )
+ SULog(@"Can't remove destination file");
+ }
+
+ if( res ) // Move!.
+ {
+ const char* mvParams[] = { "-f", srcPath, dstPath, NULL };
+ res = AuthorizationExecuteWithPrivilegesAndWait( auth, "/bin/mv", kAuthorizationFlagDefaults, mvParams );
+ if( !res )
+ SULog(@"Can't move source file");
+ }
+
+ AuthorizationFree(auth, 0);
+
+ if (!res)
+ {
+ // 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]];
+ }
+ }
+ else
+ {
+ if (error != NULL)
+ *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:@"Couldn't get permission to authenticate." forKey:NSLocalizedDescriptionKey]];
+ }
+ return res;
+}
+
+
++ (BOOL)_removeFileAtPathWithForcedAuthentication:(NSString *)src error:(NSError **)error
+{
+ // *** MUST BE SAFE TO CALL ON NON-MAIN THREAD!
+
+ const char* srcPath = [src fileSystemRepresentation];
+
+ AuthorizationRef auth = NULL;
+ OSStatus authStat = errAuthorizationDenied;
+ while( authStat == errAuthorizationDenied )
+ {
+ authStat = AuthorizationCreate(NULL,
+ kAuthorizationEmptyEnvironment,
+ kAuthorizationFlagDefaults,
+ &auth);
+ }
+
+ BOOL res = NO;
+ if (authStat == errAuthorizationSuccess)
+ {
+ res = YES;
+
+ if( res ) // If there's something at our tmp path (previous failed update or whatever) delete that first.
+ {
+ const char* rmParams[] = { "-rf", srcPath, NULL };
+ res = AuthorizationExecuteWithPrivilegesAndWait( auth, "/bin/rm", kAuthorizationFlagDefaults, rmParams );
+ if( !res )
+ SULog(@"Can't remove destination file");
+ }
+
+ AuthorizationFree(auth, 0);
+
+ if (!res)
+ {
+ // 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]];
+ }
+ }
+ else
+ {
+ if (error != NULL)
+ *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:@"Couldn't get permission to authenticate." forKey:NSLocalizedDescriptionKey]];
+ }
+ return res;
+}
+
++ (BOOL)_removeFileAtPath:(NSString *)path error: (NSError**)error
+{
+ BOOL success = YES;
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
+ if( ![[NSFileManager defaultManager] removeFileAtPath: path handler: nil] )
+#else
+ if( ![[NSFileManager defaultManager] removeItemAtPath: path error: NULL] )
+#endif
+ {
+ success = [self _removeFileAtPathWithForcedAuthentication: path error: error];
+ }
+
+ return success;
+}
+
++ (void)_movePathToTrash:(NSString *)path
+{
+ //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])
- NSLog(@"Sparkle error: couldn't move %@ to the trash. This is often a sign of a permissions error.", path);
+ {
+ BOOL didFindTrash = NO;
+ NSString* trashPath = [self _temporaryCopyNameForPath: path didFindTrash: &didFindTrash];
+ if( didFindTrash )
+ {
+ NSError *err = nil;
+ if( ![self _movePathWithForcedAuthentication: path toPath: trashPath error: &err] )
+ SULog(@"Sparkle error: couldn't move %@ to the trash (%@). %@", path, trashPath, err);
+ }
+ else
+ SULog(@"Sparkle error: couldn't move %@ to the trash. This is often a sign of a permissions error.", path);
+ }
+ else
+ ;//SULog(@"Moved %@ to the trash.", path);
}
+ (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst temporaryName:(NSString *)tmp error:(NSError **)error
{
- FSRef srcRef, dstRef, targetRef, movedRef;
- OSStatus err;
+ FSRef srcRef, dstRef, dstDirRef, movedRef, tmpDirRef;
+ OSStatus err;
+ BOOL hadFileAtDest = NO, didFindTrash = NO;
+ NSString *tmpPath = [self _temporaryCopyNameForPath: dst didFindTrash: &didFindTrash];
+ // Make FSRef for destination:
err = FSPathMakeRefWithOptions((UInt8 *)[dst fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &dstRef, NULL);
- if (err != noErr)
+ hadFileAtDest = (err == noErr); // There is a file at the destination, move it aside. If we normalized the name, we might not get here, so don't error.
+ if( hadFileAtDest )
{
- NSString *errorMessage = [NSString stringWithFormat:@"Couldn't copy %@ over %@ because there is no file at %@.", src, dst, dst];
- if (error != nil)
- *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]];
- return NO;
+ if (0 != access([dst fileSystemRepresentation], W_OK) || 0 != access([[dst stringByDeletingLastPathComponent] fileSystemRepresentation], W_OK))
+ {
+ return [self _copyPathWithForcedAuthentication:src toPath:dst temporaryPath:tmpPath error:error];
+ }
+ }
+ else
+ {
+ if (0 != access([[dst stringByDeletingLastPathComponent] fileSystemRepresentation], W_OK)
+ || 0 != access([[[dst stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] fileSystemRepresentation], W_OK))
+ {
+ return [self _copyPathWithForcedAuthentication:src toPath:dst temporaryPath:tmpPath error:error];
+ }
}
- NSString *tmpPath = [[dst stringByDeletingLastPathComponent] stringByAppendingPathComponent:tmp];
-
- if (0 != access([dst fileSystemRepresentation], W_OK) || 0 != access([[dst stringByDeletingLastPathComponent] fileSystemRepresentation], W_OK))
- return [self copyPathWithForcedAuthentication:src toPath:dst temporaryPath:tmpPath error:error];
-
- err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &targetRef, NULL);
- if (err == noErr)
- err = FSMoveObjectSync(&dstRef, &targetRef, (CFStringRef)tmp, &movedRef, 0);
- if (err != noErr)
+ if( hadFileAtDest )
{
- if (error != nil)
- *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]];
- return NO;
+ err = FSPathMakeRef((UInt8 *)[[tmpPath stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL);
+ if (err != noErr)
+ err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &tmpDirRef, NULL);
}
+
+ err = FSPathMakeRef((UInt8 *)[[dst stringByDeletingLastPathComponent] fileSystemRepresentation], &dstDirRef, NULL);
+
+ if (err == noErr && hadFileAtDest)
+ {
+ if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5)
+ {
+ NSFileManager *manager = [[[NSFileManager alloc] init] autorelease];
+ BOOL success = [manager moveItemAtPath:dst toPath:tmpPath error:error];
+ 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]];
+ return NO;
+ }
+
+ } else {
+ err = FSMoveObjectSync(&dstRef, &tmpDirRef, (CFStringRef)[tmpPath lastPathComponent], &movedRef, 0);
+ if (err != noErr && hadFileAtDest)
+ {
+ if (error != NULL)
+ *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]];
+ return NO;
+ }
+ }
+ }
+
err = FSPathMakeRef((UInt8 *)[src fileSystemRepresentation], &srcRef, NULL);
if (err == noErr)
- err = FSCopyObjectSync(&srcRef, &targetRef, (CFStringRef)[dst lastPathComponent], NULL, 0);
- if (err != noErr)
{
- // We better move the old version back to its old location
- FSMoveObjectSync(&movedRef, &targetRef, (CFStringRef)[dst lastPathComponent], &movedRef, 0);
- if (error != nil)
- *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't copy %@ to %@.", src, dst] forKey:NSLocalizedDescriptionKey]];
- return NO;
+ if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5)
+ {
+ NSFileManager *manager = [[[NSFileManager alloc] init] autorelease];
+ BOOL success = [manager copyItemAtPath:src toPath:dst error:error];
+ if (!success)
+ {
+ // We better move the old version back to its old location
+ if( hadFileAtDest )
+ success = [manager moveItemAtPath:tmpPath toPath:dst error:error];
+ if (error != NULL)
+ *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]];
+ return NO;
+
+ }
+ } else {
+ err = FSCopyObjectSync(&srcRef, &dstDirRef, (CFStringRef)[dst lastPathComponent], NULL, 0);
+ if (err != noErr)
+ {
+ // We better move the old version back to its old location
+ if( hadFileAtDest )
+ FSMoveObjectSync(&movedRef, &dstDirRef, (CFStringRef)[dst lastPathComponent], &movedRef, 0);
+ if (error != NULL)
+ *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't copy %@ to %@.", src, dst] forKey:NSLocalizedDescriptionKey]];
+ return NO;
+ }
+ }
}
-
- // Trash the old copy of the app.
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4
- if (FSMoveObjectToTrashSync == NULL)
- [self performSelectorOnMainThread:@selector(movePathToTrash:) withObject:tmpPath waitUntilDone:YES];
- else if (noErr != FSMoveObjectToTrashSync(&movedRef, NULL, 0))
- NSLog(@"Sparkle error: couldn't move %@ to the trash. This is often a sign of a permissions error.", tmpPath);
-#else
- [self performSelectorOnMainThread:@selector(movePathToTrash:) withObject:tmpPath waitUntilDone:YES];
-#endif
-
+
// If the currently-running application is trusted, the new
// version should be trusted as well. Remove it from the
// quarantine to avoid a delay at launch, and to avoid
@@ -268,6 +551,8 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
fromFile:(NSString*)file
options:(int)options
{
+ // *** MUST BE SAFE TO CALL ON NON-MAIN THREAD!
+
typedef int (*removexattr_type)(const char*, const char*, int);
// Reference removexattr directly, it's in the SDK.
static removexattr_type removexattr_func = removexattr;
@@ -299,6 +584,8 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
+ (void)releaseFromQuarantine:(NSString*)root
{
+ // *** MUST BE SAFE TO CALL ON NON-MAIN THREAD!
+
const char* quarantineAttribute = "com.apple.quarantine";
const int removeXAttrOptions = XATTR_NOFOLLOW;
diff --git a/SUScheduledUpdateDriver.m b/SUScheduledUpdateDriver.m
index 2c92dc85..2d4b0750 100644
--- a/SUScheduledUpdateDriver.m
+++ b/SUScheduledUpdateDriver.m
@@ -7,7 +7,11 @@
//
#import "SUScheduledUpdateDriver.h"
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
@implementation SUScheduledUpdateDriver
diff --git a/SUStandardVersionComparator.m b/SUStandardVersionComparator.m
index 19c56cab..f6f894c3 100644
--- a/SUStandardVersionComparator.m
+++ b/SUStandardVersionComparator.m
@@ -6,7 +6,11 @@
// Copyright 2007 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
#import "SUStandardVersionComparator.h"
@implementation SUStandardVersionComparator
@@ -22,15 +26,19 @@
typedef enum {
kNumberType,
kStringType,
- kPeriodType
+ kSeparatorType,
} SUCharacterType;
- (SUCharacterType)typeOfCharacter:(NSString *)character
{
if ([character isEqualToString:@"."]) {
- return kPeriodType;
+ return kSeparatorType;
} else if ([[NSCharacterSet decimalDigitCharacterSet] characterIsMember:[character characterAtIndex:0]]) {
return kNumberType;
+ } else if ([[NSCharacterSet whitespaceAndNewlineCharacterSet] characterIsMember:[character characterAtIndex:0]]) {
+ return kSeparatorType;
+ } else if ([[NSCharacterSet punctuationCharacterSet] characterIsMember:[character characterAtIndex:0]]) {
+ return kSeparatorType;
} else {
return kStringType;
}
@@ -53,7 +61,7 @@ typedef enum {
for (i = 1; i <= n; ++i) {
character = [version substringWithRange:NSMakeRange(i, 1)];
newType = [self typeOfCharacter:character];
- if (oldType != newType || oldType == kPeriodType) {
+ if (oldType != newType || oldType == kSeparatorType) {
// We've reached a new segment
NSString *aPart = [[[NSString alloc] initWithString:s] autorelease];
[parts addObject:aPart];
@@ -77,7 +85,7 @@ typedef enum {
NSString *partA, *partB;
NSUInteger i, n;
- int intA, intB;
+ long long valueA, valueB;
SUCharacterType typeA, typeB;
n = MIN([partsA count], [partsB count]);
@@ -92,11 +100,11 @@ typedef enum {
if (typeA == typeB) {
// Same type; we can compare
if (typeA == kNumberType) {
- intA = [partA intValue];
- intB = [partB intValue];
- if (intA > intB) {
+ valueA = [partA longLongValue];
+ valueB = [partB longLongValue];
+ if (valueA > valueB) {
return NSOrderedDescending;
- } else if (intA < intB) {
+ } else if (valueA < valueB) {
return NSOrderedAscending;
}
} else if (typeA == kStringType) {
diff --git a/SUStatus.nib/designable.nib b/SUStatus.nib/designable.nib
deleted file mode 100644
index 4de5187b..00000000
--- a/SUStatus.nib/designable.nib
+++ /dev/null
@@ -1,1121 +0,0 @@
-
-
-
- 1050
- 10A432
- 732
- 1038
- 437.00
-
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
-
-
-
-
-
-
-
- value: applicationIcon
-
-
-
-
-
- value: applicationIcon
- value
- applicationIcon
- 2
-
-
- 9
-
-
-
- maxValue: maxProgressValue
-
-
-
-
-
- maxValue: maxProgressValue
- maxValue
- maxProgressValue
- 2
-
-
- 13
-
-
-
- value: statusText
-
-
-
-
-
- value: statusText
- value
- statusText
- 2
-
-
- 17
-
-
-
- title: buttonTitle
-
-
-
-
-
- title: buttonTitle
- title
- buttonTitle
- 2
-
-
- 21
-
-
-
- title: windowTitle
-
-
-
-
-
- title: windowTitle
- title
- windowTitle
- 2
-
-
- 24
-
-
-
- window
-
-
-
- 25
-
-
-
- value: title
-
-
-
-
-
- value: title
- value
- title
- 2
-
-
- 26
-
-
-
- value: progressValue
-
-
-
-
-
- value: progressValue
- value
- progressValue
-
- 2
-
-
- 27
-
-
-
- hidden: statusText
-
-
-
-
-
- hidden: statusText
- hidden
- statusText
-
- NSValueTransformerName
- NSIsNil
-
- 2
-
-
- 33
-
-
-
- actionButton
-
-
-
- 34
-
-
-
- progressBar
-
-
-
- 49
-
-
-
-
-
- 0
-
-
-
-
-
- -2
-
-
- File's Owner
-
-
- -1
-
-
- First Responder
-
-
- -3
-
-
- Application
-
-
- 5
-
-
-
-
-
- Window
-
-
- 6
-
-
-
-
-
-
-
-
-
-
-
- 7
-
-
-
-
-
-
-
- 8
-
-
-
-
-
-
-
- 11
-
-
-
-
- 12
-
-
-
-
-
-
-
- 16
-
-
-
-
-
-
-
- 45
-
-
-
-
- 46
-
-
-
-
- 47
-
-
-
-
- 48
-
-
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
- {{0, 738}, {384, 107}}
- com.apple.InterfaceBuilder.CocoaPlugin
- {{0, 738}, {384, 107}}
-
-
- {213, 107}
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
-
- 50
-
-
-
-
- FirstResponder
-
- IBUserSource
-
-
-
-
- NSApplication
- NSResponder
-
- IBUserSource
-
-
-
-
- NSObject
-
- IBProjectSource
- SUAppcast.h
-
-
-
- NSObject
-
- IBProjectSource
- SUAutomaticUpdateAlert.h
-
-
-
- NSObject
-
- IBProjectSource
- SUInstaller.h
-
-
-
- NSObject
-
- IBProjectSource
- SUUnarchiver.h
-
-
-
- NSObject
-
- IBProjectSource
- SUUpdateAlert.h
-
-
-
- NSObject
-
- IBProjectSource
- SUUpdatePermissionPrompt.h
-
-
-
- NSObject
-
- IBProjectSource
- SUUpdater.h
-
-
-
- NSObject
-
- IBUserSource
-
-
-
-
- SUStatusController
- SUWindowController
-
- NSButton
- NSProgressIndicator
-
-
- IBProjectSource
- SUStatusController.h
-
-
-
- SUStatusController
- SUWindowController
-
- IBUserSource
-
-
-
-
- SUWindowController
- NSWindowController
-
- IBProjectSource
- SUWindowController.h
-
-
-
- SUWindowController
- NSWindowController
-
- IBUserSource
-
-
-
-
-
-
- NSActionCell
- NSCell
-
- IBFrameworkSource
- AppKit.framework/Headers/NSActionCell.h
-
-
-
- NSApplication
- NSResponder
-
- IBFrameworkSource
- AppKit.framework/Headers/NSApplication.h
-
-
-
- NSApplication
-
- IBFrameworkSource
- AppKit.framework/Headers/NSApplicationScripting.h
-
-
-
- NSApplication
-
- IBFrameworkSource
- AppKit.framework/Headers/NSColorPanel.h
-
-
-
- NSApplication
-
- IBFrameworkSource
- AppKit.framework/Headers/NSHelpManager.h
-
-
-
- NSApplication
-
- IBFrameworkSource
- AppKit.framework/Headers/NSPageLayout.h
-
-
-
- NSApplication
-
- IBFrameworkSource
- AppKit.framework/Headers/NSUserInterfaceItemSearching.h
-
-
-
- NSButton
- NSControl
-
- IBFrameworkSource
- AppKit.framework/Headers/NSButton.h
-
-
-
- NSButtonCell
- NSActionCell
-
- IBFrameworkSource
- AppKit.framework/Headers/NSButtonCell.h
-
-
-
- NSCell
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSCell.h
-
-
-
- NSControl
- NSView
-
- IBFrameworkSource
- AppKit.framework/Headers/NSControl.h
-
-
-
- NSFormatter
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSFormatter.h
-
-
-
- NSImageCell
- NSCell
-
- IBFrameworkSource
- AppKit.framework/Headers/NSImageCell.h
-
-
-
- NSImageView
- NSControl
-
- IBFrameworkSource
- AppKit.framework/Headers/NSImageView.h
-
-
-
- NSMenu
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSMenu.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSAccessibility.h
-
-
-
- NSObject
-
-
-
- NSObject
-
-
-
- NSObject
-
-
-
- NSObject
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSDictionaryController.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSDragging.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSFontManager.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSFontPanel.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSKeyValueBinding.h
-
-
-
- NSObject
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSNibLoading.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSOutlineView.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSPasteboard.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSSavePanel.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSTableView.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSToolbarItem.h
-
-
-
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSView.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSArchiver.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSClassDescription.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSError.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSFileManager.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSKeyValueCoding.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSKeyValueObserving.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSKeyedArchiver.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSObject.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSObjectScripting.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSPortCoder.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSRunLoop.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSScriptClassDescription.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSScriptKeyValueCoding.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSScriptObjectSpecifiers.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSScriptWhoseTests.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSThread.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSURL.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSURLConnection.h
-
-
-
- NSObject
-
- IBFrameworkSource
- Foundation.framework/Headers/NSURLDownload.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebDownload.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebEditingDelegate.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebFrameLoadDelegate.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebJavaPlugIn.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebPlugin.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebPluginContainer.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebPolicyDelegate.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebResourceLoadDelegate.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebScriptObject.h
-
-
-
- NSObject
-
- IBFrameworkSource
- WebKit.framework/Headers/WebUIDelegate.h
-
-
-
- NSProgressIndicator
- NSView
-
- IBFrameworkSource
- AppKit.framework/Headers/NSProgressIndicator.h
-
-
-
- NSResponder
-
- IBFrameworkSource
- AppKit.framework/Headers/NSInterfaceStyle.h
-
-
-
- NSResponder
- NSObject
-
- IBFrameworkSource
- AppKit.framework/Headers/NSResponder.h
-
-
-
- NSTextField
- NSControl
-
- IBFrameworkSource
- AppKit.framework/Headers/NSTextField.h
-
-
-
- NSTextFieldCell
- NSActionCell
-
- IBFrameworkSource
- AppKit.framework/Headers/NSTextFieldCell.h
-
-
-
- NSView
-
- IBFrameworkSource
- AppKit.framework/Headers/NSClipView.h
-
-
-
- NSView
-
- IBFrameworkSource
- AppKit.framework/Headers/NSMenuItem.h
-
-
-
- NSView
-
- IBFrameworkSource
- AppKit.framework/Headers/NSRulerView.h
-
-
-
- NSView
- NSResponder
-
-
-
- NSWindow
-
- IBFrameworkSource
- AppKit.framework/Headers/NSDrawer.h
-
-
-
- NSWindow
- NSResponder
-
- IBFrameworkSource
- AppKit.framework/Headers/NSWindow.h
-
-
-
- NSWindow
-
- IBFrameworkSource
- AppKit.framework/Headers/NSWindowScripting.h
-
-
-
- NSWindowController
- NSResponder
-
- showWindow:
- id
-
-
- IBFrameworkSource
- AppKit.framework/Headers/NSWindowController.h
-
-
-
-
- 0
-
- com.apple.InterfaceBuilder.CocoaPlugin.macosx
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin.macosx
-
-
- YES
- Sparkle.xcodeproj
- 3
-
-
diff --git a/SUStatus.nib/keyedobjects.nib b/SUStatus.nib/keyedobjects.nib
deleted file mode 100644
index 916fabc5..00000000
Binary files a/SUStatus.nib/keyedobjects.nib and /dev/null differ
diff --git a/SUStatus.xib b/SUStatus.xib
new file mode 100644
index 00000000..d43394ca
--- /dev/null
+++ b/SUStatus.xib
@@ -0,0 +1,589 @@
+
+
+
+ 1050
+ 10D573
+ 762
+ 1038.29
+ 460.00
+
+ YES
+
+ YES
+
+
+ YES
+
+
+
+ YES
+
+
+
+
+ YES
+
+
+ YES
+
+
+
+ YES
+
+ SUStatusController
+
+
+ FirstResponder
+
+
+ NSApplication
+
+
+ 1
+ 2
+ {{200, 222}, {400, 107}}
+ 1886912512
+ Set in Code
+
+ NSWindow
+
+
+ View
+
+ {3.40282e+38, 3.40282e+38}
+ {213, 107}
+
+
+ 256
+
+ YES
+
+
+ 268
+
+ YES
+
+ YES
+ Apple PDF pasteboard type
+ Apple PICT pasteboard type
+ Apple PNG pasteboard type
+ NSFilenamesPboardType
+ NeXT Encapsulated PostScript v1.2 pasteboard type
+ NeXT TIFF v4.0 pasteboard type
+
+
+ {{24, 28}, {64, 64}}
+
+ YES
+
+ 130560
+ 33554432
+
+ NSImage
+ NSApplicationIcon
+
+ 0
+ 1
+ 0
+ NO
+
+ YES
+
+
+
+ 268
+ {{106, 75}, {277, 17}}
+
+ YES
+
+ 67239424
+ 272629760
+ Status Text (set by loc. string in code)
+
+ LucidaGrande-Bold
+ 13
+ 2072
+
+
+
+ 6
+ System
+ controlColor
+
+ 3
+ MC42NjY2NjY2ODY1AA
+
+
+
+ 6
+ System
+ controlTextColor
+
+ 3
+ MAA
+
+
+
+
+
+
+ 1280
+
+ {{107, 47}, {275, 20}}
+
+ 16394
+ 100
+
+
+
+ 259
+ {{272, 12}, {114, 32}}
+
+ YES
+
+ 67239424
+ 134217728
+ Button
+
+ LucidaGrande
+ 13
+ 1044
+
+
+ -2038284033
+ 1
+
+
+
+
+
+ 200
+ 25
+
+
+
+
+ 256
+ {{106, 22}, {167, 17}}
+
+ YES
+
+ 67239424
+ 272629760
+ Small System Font Text
+
+
+
+
+
+
+
+ {400, 107}
+
+
+ {{0, 0}, {1920, 1178}}
+ {213, 129}
+ {3.40282e+38, 3.40282e+38}
+
+
+
+
+ YES
+
+
+ value: applicationIcon
+
+
+
+
+
+ value: applicationIcon
+ value
+ applicationIcon
+ 2
+
+
+ 9
+
+
+
+ maxValue: maxProgressValue
+
+
+
+
+
+ maxValue: maxProgressValue
+ maxValue
+ maxProgressValue
+ 2
+
+
+ 13
+
+
+
+ value: statusText
+
+
+
+
+
+ value: statusText
+ value
+ statusText
+ 2
+
+
+ 17
+
+
+
+ title: buttonTitle
+
+
+
+
+
+ title: buttonTitle
+ title
+ buttonTitle
+ 2
+
+
+ 21
+
+
+
+ title: windowTitle
+
+
+
+
+
+ title: windowTitle
+ title
+ windowTitle
+ 2
+
+
+ 24
+
+
+
+ window
+
+
+
+ 25
+
+
+
+ value: title
+
+
+
+
+
+ value: title
+ value
+ title
+ 2
+
+
+ 26
+
+
+
+ value: progressValue
+
+
+
+
+
+ value: progressValue
+ value
+ progressValue
+
+ 2
+
+
+ 27
+
+
+
+ hidden: statusText
+
+
+
+
+
+ hidden: statusText
+ hidden
+ statusText
+
+ NSValueTransformerName
+ NSIsNil
+
+ 2
+
+
+ 33
+
+
+
+ actionButton
+
+
+
+ 34
+
+
+
+ progressBar
+
+
+
+ 49
+
+
+
+
+ YES
+
+ 0
+
+
+
+
+
+ -2
+
+
+ File's Owner
+
+
+ -1
+
+
+ First Responder
+
+
+ -3
+
+
+ Application
+
+
+ 5
+
+
+ YES
+
+
+
+ Window
+
+
+ 6
+
+
+ YES
+
+
+
+
+
+
+
+
+
+ 7
+
+
+ YES
+
+
+
+
+
+ 8
+
+
+ YES
+
+
+
+
+
+ 11
+
+
+
+
+ 12
+
+
+ YES
+
+
+
+
+
+ 16
+
+
+ YES
+
+
+
+
+
+ 53
+
+
+
+
+ 54
+
+
+
+
+ 55
+
+
+
+
+ 56
+
+
+
+
+
+
+ YES
+
+ YES
+ -3.ImportedFromIB2
+ 11.ImportedFromIB2
+ 12.ImportedFromIB2
+ 16.ImportedFromIB2
+ 5.IBEditorWindowLastContentRect
+ 5.IBWindowTemplateEditedContentRect
+ 5.ImportedFromIB2
+ 5.windowTemplate.hasMinSize
+ 5.windowTemplate.minSize
+ 6.ImportedFromIB2
+ 7.ImportedFromIB2
+ 8.ImportedFromIB2
+
+
+ YES
+
+
+
+
+ {{294, 716}, {400, 107}}
+ {{294, 716}, {400, 107}}
+
+
+ {213, 107}
+
+
+
+
+
+
+ YES
+
+
+ YES
+
+
+
+
+ YES
+
+
+ YES
+
+
+
+ 56
+
+
+
+ YES
+
+ FirstResponder
+ NSObject
+
+ IBUserSource
+
+
+
+
+ NSApplication
+ NSResponder
+
+ IBUserSource
+
+
+
+
+ NSObject
+
+ IBUserSource
+
+
+
+
+ SUStatusController
+ SUWindowController
+
+ YES
+
+ YES
+ actionButton
+ progressBar
+
+
+ YES
+ NSButton
+ NSProgressIndicator
+
+
+
+ IBUserSource
+
+
+
+
+ SUWindowController
+ NSWindowController
+
+ IBUserSource
+
+
+
+
+
+ 0
+ IBCocoaFramework
+
+ com.apple.InterfaceBuilder.CocoaPlugin.macosx
+
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3
+
+
+ YES
+ Sparkle.xcodeproj
+ 3
+
+ NSApplicationIcon
+ {128, 128}
+
+
+
diff --git a/SUStatusController.m b/SUStatusController.m
index eea47609..524884ce 100644
--- a/SUStatusController.m
+++ b/SUStatusController.m
@@ -6,8 +6,14 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
#import "SUStatusController.h"
+#import "SUHost.h"
+
@implementation SUStatusController
@@ -31,10 +37,14 @@
[super dealloc];
}
-- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; }
+- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [host bundlePath], [host installationPath]]; }
- (void)awakeFromNib
{
+ if ([host isBackgroundApplication]) {
+ [[self window] setLevel:NSFloatingWindowLevel];
+ }
+
[[self window] center];
[[self window] setFrameAutosaveName:@"SUStatusFrame"];
[progressBar setUsesThreadedAnimation:YES];
@@ -60,7 +70,7 @@
[self setStatusText:aStatusText];
}
-- (void)setButtonTitle:(NSString *)aButtonTitle target:target action:(SEL)action isDefault:(BOOL)isDefault
+- (void)setButtonTitle:(NSString *)aButtonTitle target: (id)target action:(SEL)action isDefault:(BOOL)isDefault
{
[self willChangeValueForKey:@"buttonTitle"];
if (buttonTitle != aButtonTitle)
@@ -82,6 +92,9 @@
[actionButton setTarget:target];
[actionButton setAction:action];
[actionButton setKeyEquivalent:isDefault ? @"\r" : @""];
+
+ // 06/05/2008 Alex: Avoid a crash when cancelling during the extraction
+ [self setButtonEnabled: (target != nil)];
}
- (BOOL)progressBarShouldAnimate
@@ -116,6 +129,7 @@
[self setProgressValue:0.0];
[progressBar setIndeterminate:(value == 0.0)];
[progressBar startAnimation:self];
+ [progressBar setUsesThreadedAnimation: YES];
}
- (void)setStatusText:(NSString *)aStatusText
diff --git a/SUSystemProfiler.h b/SUSystemProfiler.h
index 6238e39c..0835087d 100644
--- a/SUSystemProfiler.h
+++ b/SUSystemProfiler.h
@@ -9,6 +9,8 @@
#ifndef SUSYSTEMPROFILER_H
#define SUSYSTEMPROFILER_H
+#import
+
@class SUHost;
@interface SUSystemProfiler : NSObject {}
+ (SUSystemProfiler *)sharedSystemProfiler;
diff --git a/SUSystemProfiler.m b/SUSystemProfiler.m
index 0fde4a18..a4db3583 100644
--- a/SUSystemProfiler.m
+++ b/SUSystemProfiler.m
@@ -50,9 +50,9 @@
cpuType = value;
NSString *visibleCPUType;
switch(value) {
- case 7: visibleCPUType=@"Intel"; break;
- case 18: visibleCPUType=@"PowerPC"; break;
- default: visibleCPUType=@"Unknown"; break;
+ case CPU_TYPE_X86: visibleCPUType = @"Intel"; break;
+ 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]];
}
diff --git a/SUUIBasedUpdateDriver.h b/SUUIBasedUpdateDriver.h
index 09a96472..c324c6ad 100644
--- a/SUUIBasedUpdateDriver.h
+++ b/SUUIBasedUpdateDriver.h
@@ -13,12 +13,16 @@
#import "SUBasicUpdateDriver.h"
@class SUStatusController, SUUpdateAlert;
-@interface SUUIBasedUpdateDriver : SUBasicUpdateDriver {
+
+@interface SUUIBasedUpdateDriver : SUBasicUpdateDriver
+{
SUStatusController *statusController;
SUUpdateAlert *updateAlert;
}
- (void)showModalAlert:(NSAlert *)alert;
+- (IBAction)cancelDownload: (id)sender;
+- (void)installAndRestart: (id)sender;
@end
diff --git a/SUUIBasedUpdateDriver.m b/SUUIBasedUpdateDriver.m
index 79d509ea..dc37e056 100644
--- a/SUUIBasedUpdateDriver.m
+++ b/SUUIBasedUpdateDriver.m
@@ -9,23 +9,24 @@
#import "SUUIBasedUpdateDriver.h"
#import "SUUpdateAlert.h"
+#import "SUUpdater_Private.h"
#import "SUHost.h"
#import "SUStatusController.h"
+#import "SUConstants.h"
+#import "SUPasswordPrompt.h"
@implementation SUUIBasedUpdateDriver
-- (IBAction)cancelDownload:sender
-{
- if (download)
- [download cancel];
- [self abortUpdate];
-}
-
- (void)didFindValidUpdate
{
updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem host:host];
[updateAlert setDelegate:self];
+ id versDisp = nil;
+ if ([[updater delegate] respondsToSelector:@selector(versionDisplayerForUpdater:)])
+ versDisp = [[updater delegate] versionDisplayerForUpdater: updater];
+ [updateAlert setVersionDisplayer: versDisp];
+
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
[[updater delegate] updater:updater didFindValidUpdate:updateItem];
@@ -49,6 +50,7 @@
{
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)])
[[updater delegate] updaterDidNotFindUpdate:updater];
+
NSAlert *alert = [NSAlert alertWithMessageText:SULocalizedString(@"You're up-to-date!", nil) defaultButton:SULocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [host name], [host displayVersion]];
[self showModalAlert:alert];
[self abortUpdate];
@@ -73,9 +75,17 @@
[statusController showWindow:self];
[self downloadUpdate];
break;
-
+
+ case SUOpenInfoURLChoice:
+ [[NSWorkspace sharedWorkspace] openURL: [updateItem infoURL]];
+ [self abortUpdate];
+ break;
+
case SUSkipThisVersionChoice:
[host setObject:[updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey];
+ [self abortUpdate];
+ break;
+
case SURemindMeLaterChoice:
[self abortUpdate];
break;
@@ -110,6 +120,13 @@
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ downloaded", nil), [self humanReadableSizeFromDouble:[statusController progressValue]]]];
}
+- (IBAction)cancelDownload: (id)sender
+{
+ if (download)
+ [download cancel];
+ [self abortUpdate];
+}
+
- (void)extractUpdate
{
// Now we have to extract the downloaded archive.
@@ -134,22 +151,39 @@
[statusController setProgressValue:[statusController progressValue] + (double)length];
}
-- (void)installAndRestart:sender { [self installUpdate]; }
-
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
{
[statusController beginActionWithTitle:SULocalizedString(@"Ready to Install", nil) maxProgressValue:1.0 statusText:nil];
[statusController setProgressValue:1.0]; // Fill the bar.
[statusController setButtonEnabled:YES];
[statusController setButtonTitle:SULocalizedString(@"Install and Relaunch", nil) target:self action:@selector(installAndRestart:) isDefault:YES];
+ [[statusController window] makeKeyAndOrderFront: self];
[NSApp requestUserAttention:NSInformationalRequest];
}
-- (void)installUpdate
+- (void)unarchiver:(SUUnarchiver *)unarchiver requiresPasswordReturnedViaInvocation:(NSInvocation *)invocation
+{
+ SUPasswordPrompt *prompt = [[SUPasswordPrompt alloc] initWithHost:host];
+ NSString *password = nil;
+ if([prompt run])
+ {
+ password = [prompt password];
+ }
+ [prompt release];
+ [invocation setArgument:&password atIndex:2];
+ [invocation invoke];
+}
+
+- (void)installAndRestart: (id)sender
+{
+ [self installWithToolAndRelaunch:YES];
+}
+
+- (void)installWithToolAndRelaunch:(BOOL)relaunch
{
[statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil];
[statusController setButtonEnabled:NO];
- [super installUpdate];
+ [super installWithToolAndRelaunch:relaunch];
// if a user chooses to NOT relaunch the app (as is the case with WebKit
@@ -185,12 +219,18 @@
- (void)showModalAlert:(NSAlert *)alert
{
+ 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.
if ([host isBackgroundApplication]) { [NSApp activateIgnoringOtherApps:YES]; }
[alert setIcon:[host icon]];
[alert runModal];
+
+ if ([[updater delegate] respondsToSelector:@selector(updaterDidShowModalAlert:)])
+ [[updater delegate] updaterDidShowModalAlert: updater];
}
@end
diff --git a/SUUnarchiver.h b/SUUnarchiver.h
index 261187c5..c726d174 100644
--- a/SUUnarchiver.h
+++ b/SUUnarchiver.h
@@ -28,6 +28,7 @@
- (void)unarchiver:(SUUnarchiver *)unarchiver extractedLength:(unsigned long)length;
- (void)unarchiverDidFinish:(SUUnarchiver *)unarchiver;
- (void)unarchiverDidFail:(SUUnarchiver *)unarchiver;
+- (void)unarchiver:(SUUnarchiver *)unarchiver requiresPasswordReturnedViaInvocation:(NSInvocation *)invocation;
@end
#endif
diff --git a/SUUnarchiver.m b/SUUnarchiver.m
index 399de309..ca437b4a 100644
--- a/SUUnarchiver.m
+++ b/SUUnarchiver.m
@@ -7,7 +7,11 @@
//
-#import "Sparkle.h"
+#import "SUUpdater.h"
+
+#import "SUAppcast.h"
+#import "SUAppcastItem.h"
+#import "SUVersionComparisonProtocol.h"
#import "SUUnarchiver.h"
#import "SUUnarchiver_Private.h"
diff --git a/SUUpdateAlert.h b/SUUpdateAlert.h
index 1602b4a6..5bf9032d 100644
--- a/SUUpdateAlert.h
+++ b/SUUpdateAlert.h
@@ -10,12 +10,15 @@
#define SUUPDATEALERT_H
#import "SUWindowController.h"
+#import "SUVersionDisplayProtocol.h"
+
typedef enum
{
SUInstallUpdateChoice,
SURemindMeLaterChoice,
- SUSkipThisVersionChoice
+ SUSkipThisVersionChoice,
+ SUOpenInfoURLChoice
} SUUpdateAlertChoice;
@class WebView, SUAppcastItem, SUHost;
@@ -23,9 +26,13 @@ typedef enum
SUAppcastItem *updateItem;
SUHost *host;
id delegate;
+ id versionDisplayer;
IBOutlet WebView *releaseNotesView;
IBOutlet NSTextField *description;
+ IBOutlet NSButton *installButton; // UK 2007-08-31.
+ IBOutlet NSButton *skipButton;
+ IBOutlet NSButton *laterButton;
NSProgressIndicator *releaseNotesSpinner;
BOOL webViewFinishedLoading;
}
@@ -37,10 +44,13 @@ typedef enum
- (IBAction)skipThisVersion:sender;
- (IBAction)remindMeLater:sender;
+- (void)setVersionDisplayer: (id)disp;
+
@end
@interface NSObject (SUUpdateAlertDelegate)
- (void)updateAlert:(SUUpdateAlert *)updateAlert finishedWithChoice:(SUUpdateAlertChoice)updateChoice;
+- (void)updateAlert:(SUUpdateAlert *)updateAlert shouldAllowAutoUpdate: (BOOL*)shouldAllowAutoUpdate;
@end
#endif
diff --git a/SUUpdateAlert.m b/SUUpdateAlert.m
index 607e37ab..2ef5158b 100644
--- a/SUUpdateAlert.m
+++ b/SUUpdateAlert.m
@@ -6,11 +6,25 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
+// -----------------------------------------------------------------------------
+// Headers:
+// -----------------------------------------------------------------------------
+
#import "SUUpdateAlert.h"
#import "SUHost.h"
#import
+#import "SUConstants.h"
+
+
+@interface WebView (SUTenFiveProperty)
+
+-(void) setDrawsBackground: (BOOL)state;
+
+@end
+
+
@implementation SUUpdateAlert
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost
@@ -21,6 +35,11 @@
host = [aHost retain];
updateItem = [item retain];
[self setShouldCascadeWindows:NO];
+
+ // Alex: This dummy line makes sure that the binary is linked against WebKit.
+ // The SUUpdateAlert.xib file contains a WebView and if we don't link against WebKit,
+ // we will get a runtime crash when decoding the NIB. It is better to get a link error.
+ [WebView MIMETypesShownAsHTML];
}
return self;
}
@@ -34,6 +53,11 @@
[super dealloc];
}
+- (void)setVersionDisplayer: (id)disp
+{
+ versionDisplayer = disp;
+}
+
- (void)endWithSelection:(SUUpdateAlertChoice)choice
{
[releaseNotesView stopLoading:self];
@@ -45,17 +69,22 @@
[delegate updateAlert:self finishedWithChoice:choice];
}
-- (IBAction)installUpdate:sender
+- (IBAction)installUpdate: (id)sender
{
[self endWithSelection:SUInstallUpdateChoice];
}
-- (IBAction)skipThisVersion:sender
+- (IBAction)openInfoURL: (id)sender
+{
+ [self endWithSelection:SUOpenInfoURLChoice];
+}
+
+- (IBAction)skipThisVersion: (id)sender
{
[self endWithSelection:SUSkipThisVersionChoice];
}
-- (IBAction)remindMeLater:sender
+- (IBAction)remindMeLater: (id)sender
{
[self endWithSelection:SURemindMeLaterChoice];
}
@@ -99,49 +128,142 @@
{
NSNumber *shouldShowReleaseNotes = [host objectForInfoDictionaryKey:SUShowReleaseNotesKey];
if (shouldShowReleaseNotes == nil)
- return YES; // defaults to YES
+ {
+ // UK 2007-09-18: Don't show release notes if RSS item contains no description and no release notes URL:
+ return( ([updateItem itemDescription] != nil
+ && [[[updateItem itemDescription] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]] length] > 0)
+ || [updateItem releaseNotesURL] != nil );
+ }
else
return [shouldShowReleaseNotes boolValue];
}
- (BOOL)allowsAutomaticUpdates
{
- if (![host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey])
- return YES; // defaults to YES
- return [host boolForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey];
+ BOOL allowAutoUpdates = YES; // Defaults to YES.
+ if( [host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] )
+ allowAutoUpdates = [host boolForInfoDictionaryKey: SUAllowsAutomaticUpdatesKey];
+
+ // UK 2007-08-31: Give delegate a chance to modify this choice:
+ if( delegate && [delegate respondsToSelector: @selector(updateAlert:shouldAllowAutoUpdate:)] )
+ [delegate updateAlert: self shouldAllowAutoUpdate: &allowAutoUpdates];
+
+ return allowAutoUpdates;
}
- (void)awakeFromNib
{
- [[self window] setLevel:NSFloatingWindowLevel];
+ NSString* sizeStr = [host objectForInfoDictionaryKey:SUFixedHTMLDisplaySizeKey];
+
+ 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.
- NSRect frame = [[self window] frame];
-
- if (![self showsReleaseNotes])
+ NSRect frame = [[self window] frame];
+ BOOL showReleaseNotes = [self showsReleaseNotes]; // UK 2007-09-18
+ if (!showReleaseNotes) // UK 2007-09-18
{
// 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.
- [[self window] setShowsResizeIndicator:NO];
+
+ 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
+ // inhibit resizing completely:
+ [[self window] setShowsResizeIndicator: NO];
+ [[self window] setMinSize: frame.size];
+ [[self window] setMaxSize: frame.size];
}
-
- if (![self allowsAutomaticUpdates])
+ else if (![self allowsAutomaticUpdates])
{
NSRect boxFrame = [[[releaseNotesView superview] superview] frame];
boxFrame.origin.y -= 20;
boxFrame.size.height += 20;
[[[releaseNotesView superview] superview] setFrame:boxFrame];
}
+
+ if( [updateItem fileURL] == nil ) // UK 2007-08-31 (whole if clause)
+ {
+ [installButton setTitle: SULocalizedString( @"Learn More...", @"Alternate title for 'Install Update' button when there's no download in RSS feed." )];
+ [installButton setAction: @selector(openInfoURL:)];
+ }
- [[self window] setFrame:frame display:NO];
+ // Make sure button widths are OK:
+ #define DISTANCE_BETWEEN_BUTTONS 3
+ #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];
+ 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];
+ installBtnBox.origin.x += installBtnBox.size.width -titleSize.width;
+ installBtnBox.size.width = titleSize.width;
+ [installButton setFrame: installBtnBox];
+ minimumWindowWidth += titleSize.width;
+
+ titleSize = [[laterButton 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 laterBtnBox = [installButton frame];
+ laterBtnBox.origin.x = installBtnBox.origin.x -DISTANCE_BETWEEN_BUTTONS -titleSize.width;
+ laterBtnBox.size.width = titleSize.width;
+ [laterButton setFrame: laterBtnBox];
+ minimumWindowWidth += DISTANCE_BETWEEN_BUTTONS +titleSize.width;
+
+ titleSize = [[skipButton 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 skipBtnBox = [skipButton frame];
+ skipBtnBox.size.width = titleSize.width;
+ [skipButton setFrame: skipBtnBox];
+ minimumWindowWidth += DISTANCE_BETWEEN_BUTTON_GROUPS +titleSize.width;
+
+ if( showReleaseNotes ) // UK 2007-09-18 (whole block)
+ {
+ if( sizeStr )
+ {
+ NSSize desiredSize = NSSizeFromString( sizeStr );
+ NSSize sizeDiff = NSZeroSize;
+ // NSBox* boxView = (NSBox*)[[releaseNotesView superview] superview];
+
+ //[boxView setBorderType: NSNoBorder];
+ [releaseNotesView setDrawsBackground: NO];
+
+ sizeDiff.width = desiredSize.width -[releaseNotesView frame].size.width;
+ sizeDiff.height = desiredSize.height -[releaseNotesView frame].size.height;
+ frame.size.width += sizeDiff.width;
+ frame.size.height += sizeDiff.height;
+
+ // No resizing:
+ [[self window] setShowsResizeIndicator:NO];
+ [[self window] setMinSize:frame.size];
+ [[self window] setMaxSize:frame.size];
+ }
+ }
+
+ if( frame.size.width < minimumWindowWidth )
+ frame.size.width = minimumWindowWidth;
+
+ [[self window] setFrame: frame display: NO];
[[self window] center];
- if ([self showsReleaseNotes])
+ if (showReleaseNotes) // UK 2007-09-18
{
[self displayReleaseNotes];
}
+
+ [[[releaseNotesView superview] superview] setHidden: !showReleaseNotes]; // UK 2007-09-18
+
}
+-(BOOL)showsReleaseNotesText
+{
+ return( [host objectForInfoDictionaryKey:SUFixedHTMLDisplaySizeKey] == nil );
+}
+
+
- (BOOL)windowShouldClose:note
{
[self endWithSelection:SURemindMeLaterChoice];
@@ -163,11 +285,13 @@
NSString *updateItemVersion = [updateItem displayVersionString];
NSString *hostVersion = [host displayVersion];
// Display more info if the version strings are the same; useful for betas.
- if ([updateItemVersion isEqualToString:hostVersion])
+ if( !versionDisplayer && [updateItemVersion isEqualToString:hostVersion] )
{
updateItemVersion = [updateItemVersion stringByAppendingFormat:@" (%@)", [updateItem versionString]];
hostVersion = [hostVersion stringByAppendingFormat:@" (%@)", [host version]];
}
+ 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];
}
diff --git a/SUUpdateDriver.h b/SUUpdateDriver.h
index 1a305d11..9e8a73e2 100644
--- a/SUUpdateDriver.h
+++ b/SUUpdateDriver.h
@@ -27,6 +27,8 @@ extern NSString * const SUUpdateDriverFinishedNotification;
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
- (void)abortUpdate;
- (BOOL)finished;
+- (SUHost*)host;
+- (void)setHost:(SUHost*)newHost;
@end
diff --git a/SUUpdateDriver.m b/SUUpdateDriver.m
index 6b8e2bf5..e1bae4ee 100644
--- a/SUUpdateDriver.m
+++ b/SUUpdateDriver.m
@@ -7,6 +7,7 @@
//
#import "SUUpdateDriver.h"
+#import "SUHost.h"
NSString * const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
@@ -18,7 +19,7 @@ NSString * const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
return self;
}
-- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; }
+- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [host bundlePath], [host installationPath]]; }
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)h
{
@@ -41,4 +42,15 @@ NSString * const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
[super dealloc];
}
+- (SUHost*)host
+{
+ return host;
+}
+
+- (void)setHost:(SUHost*)newHost
+{
+ [host release];
+ host = [newHost retain];
+}
+
@end
diff --git a/SUUpdatePermissionPrompt.h b/SUUpdatePermissionPrompt.h
index fae8d0de..9ead535b 100644
--- a/SUUpdatePermissionPrompt.h
+++ b/SUUpdatePermissionPrompt.h
@@ -24,6 +24,7 @@ typedef enum {
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;
diff --git a/SUUpdatePermissionPrompt.m b/SUUpdatePermissionPrompt.m
index 2da8a146..ad366103 100644
--- a/SUUpdatePermissionPrompt.m
+++ b/SUUpdatePermissionPrompt.m
@@ -9,6 +9,7 @@
#import "SUUpdatePermissionPrompt.h"
#import "SUHost.h"
+#import "SUConstants.h"
@implementation SUUpdatePermissionPrompt
@@ -52,9 +53,14 @@
NSRect frame = [[self window] frame];
frame.size.height -= [moreInfoButton frame].size.height;
[[self window] setFrame:frame display:YES];
- }
+ } else {
+ // Set the table view's delegate so we can disable row selection.
+ [profileTableView setDelegate:(id)self];
+ }
}
+- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row { return NO; }
+
- (void)dealloc
{
[host release];
diff --git a/SUUpdater.h b/SUUpdater.h
index 6874871e..cd795667 100644
--- a/SUUpdater.h
+++ b/SUUpdater.h
@@ -9,9 +9,11 @@
#ifndef SUUPDATER_H
#define SUUPDATER_H
-#import
+#import "SUVersionComparisonProtocol.h"
+#import "SUVersionDisplayProtocol.h"
@class SUUpdateDriver, SUAppcastItem, SUHost, SUAppcast;
+
@interface SUUpdater : NSObject
{
@private
@@ -25,12 +27,12 @@
+ (SUUpdater *)sharedUpdater;
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
-- initForBundle:(NSBundle *)bundle;
+- (id)initForBundle:(NSBundle *)bundle;
- (NSBundle *)hostBundle;
- (void)setDelegate:(id)delegate;
-- delegate;
+- (id)delegate;
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
- (BOOL)automaticallyChecksForUpdates;
@@ -39,7 +41,7 @@
- (NSTimeInterval)updateCheckInterval;
- (void)setFeedURL:(NSURL *)feedURL;
-- (NSURL *)feedURL;
+- (NSURL *)feedURL; // *** MUST BE CALLED ON MAIN THREAD ***
- (void)setUserAgentString:(NSString *)userAgent;
- (NSString *)userAgentString;
@@ -52,14 +54,14 @@
// 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.
-- (IBAction)checkForUpdates:sender;
+- (IBAction)checkForUpdates:(id)sender;
// This kicks off an update meant to be programmatically initiated. That is, it will display no UI unless it actually finds an update,
// in which case it proceeds as usual. If the fully automated updating is turned on, however, this will invoke that behavior, and if an
// update is found, it will be downloaded and prepped for installation.
- (void)checkForUpdatesInBackground;
-// Date of last update check. Returns null if no check has been performed.
+// Date of last update check. Returns nil if no check has been performed.
- (NSDate*)lastUpdateCheckDate;
// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though,
@@ -70,12 +72,25 @@
- (void)resetUpdateCycle;
- (BOOL)updateInProgress;
+
@end
+
+// -----------------------------------------------------------------------------
+// SUUpdater Delegate:
+// -----------------------------------------------------------------------------
+
@interface NSObject (SUUpdaterDelegateInformalProtocol)
+
+// Use this to keep Sparkle from popping up e.g. while your setup assistant is showing:
+- (BOOL)updaterMayCheckForUpdates:(SUUpdater *)bundle;
+
// This method allows you to add extra parameters to the appcast URL, potentially based on whether or not Sparkle will also be sending along the system profile. This method should return an array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user.
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
+// Override this to dynamically specify the entire URL.
+- (NSString*)feedURLStringForUpdater:(SUUpdater*)updater;
+
// Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)bundle;
@@ -96,8 +111,14 @@
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
+// This is not called if the user didn't relaunch on the previous update, in that case it will immediately
+// restart.
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
+// Some apps *can not* be relaunched in certain circumstances. They can use this method
+// to prevent a relaunch "hard":
+- (BOOL)updaterShouldRelaunchApplication:(SUUpdater *)updater;
+
// Called immediately before relaunching.
- (void)updaterWillRelaunchApplication:(SUUpdater *)updater;
@@ -105,19 +126,33 @@
// If you don't implement this method or return nil, the standard version comparator will be used.
- (id )versionComparatorForUpdater:(SUUpdater *)updater;
+// This method allows you to provide a custom version comparator.
+// If you don't implement this method or return nil, the standard version displayer will be used.
+- (id )versionDisplayerForUpdater:(SUUpdater *)updater;
+
// Returns the path which is used to relaunch the client after the update is installed. By default, the path of the host bundle.
- (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater;
+// Called before and after, respectively, an updater shows a modal alert window, to give the host
+// the opportunity to hide attached windows etc. that may get in the way:
+-(void) updaterWillShowModalAlert:(SUUpdater *)updater;
+-(void) updaterDidShowModalAlert:(SUUpdater *)updater;
+
@end
+
+// -----------------------------------------------------------------------------
+// Constants:
+// -----------------------------------------------------------------------------
+
// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds.
-#ifdef DEBUG
+#if defined(DEBUG) && DEBUG && 0
#define SU_MIN_CHECK_INTERVAL 60
#else
#define SU_MIN_CHECK_INTERVAL 60*60
#endif
-#ifdef DEBUG
+#if defined(DEBUG) && DEBUG && 0
#define SU_DEFAULT_CHECK_INTERVAL 60
#else
#define SU_DEFAULT_CHECK_INTERVAL 60*60*24
diff --git a/SUUpdater.m b/SUUpdater.m
index 93c71d00..7b8c81b6 100644
--- a/SUUpdater.m
+++ b/SUUpdater.m
@@ -15,9 +15,14 @@
#import "SUProbingUpdateDriver.h"
#import "SUUserInitiatedUpdateDriver.h"
#import "SUScheduledUpdateDriver.h"
+#import "SUConstants.h"
+#import "SULog.h"
+#import "SUCodeSigningVerifier.h"
+#include
+
@interface SUUpdater (Private)
-- initForBundle:(NSBundle *)bundle;
+- (id)initForBundle:(NSBundle *)bundle;
- (void)startUpdateCycle;
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)updateDriver;
- (BOOL)automaticallyDownloadsUpdates;
@@ -25,8 +30,11 @@
- (void)registerAsObserver;
- (void)unregisterAsObserver;
- (void)updateDriverDidFinish:(NSNotification *)note;
-- initForBundle:(NSBundle *)bundle;
- (NSURL *)parameterizedFeedURL;
+
+-(void) notifyWillShowModalAlert;
+-(void) notifyDidShowModalAlert;
+
@end
@implementation SUUpdater
@@ -52,7 +60,7 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
}
// This is the designated initializer for SUUpdater, important for subclasses
-- initForBundle:(NSBundle *)bundle
+- (id)initForBundle:(NSBundle *)bundle
{
self = [super init];
if (bundle == nil) bundle = [NSBundle mainBundle];
@@ -74,23 +82,50 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
[sharedUpdaters setObject:self forKey:[NSValue valueWithNonretainedObject:bundle]];
host = [[SUHost alloc] initWithBundle:bundle];
+#if !ENDANGER_USERS_WITH_INSECURE_UPDATES
// Saving-the-developer-from-a-stupid-mistake-check:
- if (![[[self feedURL] scheme] isEqualToString:@"https"] && ![host publicDSAKey])
- NSRunAlertPanel(@"Insecure update error!", @"For security reasons, you need to distribute your appcast over SSL or sign your updates. See Sparkle's documentation for more information.", @"OK", nil, nil);
-
+ BOOL hasPublicDSAKey = [host publicDSAKey] != nil;
+ BOOL isMainBundle = [bundle isEqualTo:[NSBundle mainBundle]];
+ BOOL hostIsCodeSigned = [SUCodeSigningVerifier hostApplicationIsCodeSigned];
+ if (!isMainBundle && !hasPublicDSAKey) {
+ [self notifyWillShowModalAlert];
+ NSRunAlertPanel(@"Insecure update error!", @"For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information.", @"OK", nil, nil);
+ [self notifyDidShowModalAlert];
+ } else if (isMainBundle && !(hasPublicDSAKey || hostIsCodeSigned)) {
+ [self notifyWillShowModalAlert];
+ NSRunAlertPanel(@"Insecure update error!", @"For security reasons, you need to code sign your application or sign your updates with a DSA key. See Sparkle's documentation for more information.", @"OK", nil, nil);
+ [self notifyDidShowModalAlert];
+ }
+#endif
// This runs the permission prompt if needed, but never before the app has finished launching because the runloop won't run before that
[self performSelector:@selector(startUpdateCycle) withObject:nil afterDelay:0];
}
return self;
}
+
// This will be used when the updater is instantiated in a nib such as MainMenu
- (id)init
{
return [self initForBundle:[NSBundle mainBundle]];
}
-- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; }
+- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [host bundlePath], [host installationPath]]; }
+
+
+-(void) notifyWillShowModalAlert
+{
+ if( [delegate respondsToSelector: @selector(updaterWillShowModalAlert:)] )
+ [delegate updaterWillShowModalAlert: self];
+}
+
+
+-(void) notifyDidShowModalAlert
+{
+ if( [delegate respondsToSelector: @selector(updaterDidShowModalAlert:)] )
+ [delegate updaterDidShowModalAlert: self];
+}
+
- (void)startUpdateCycle
{
@@ -112,9 +147,14 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
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.
- else if ([host boolForUserDefaultsKey:SUHasLaunchedBeforeKey] == NO)
- [host setBool:YES forUserDefaultsKey:SUHasLaunchedBeforeKey];
+ // We wait until the second launch, unless explicitly overridden via SUPromptUserOnFirstLaunchKey.
+ else if (![host objectForKey:SUPromptUserOnFirstLaunchKey])
+ {
+ if ([host boolForUserDefaultsKey:SUHasLaunchedBeforeKey] == NO)
+ [host setBool:YES forUserDefaultsKey:SUHasLaunchedBeforeKey];
+ else
+ shouldPrompt = YES;
+ }
else
shouldPrompt = YES;
}
@@ -161,6 +201,7 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
if (checkTimer)
{
[checkTimer invalidate];
+ [checkTimer release]; // UK 2009-03-16 Timer is non-repeating, may have invalidated itself, so we had to retain it.
checkTimer = nil;
}
if (![self automaticallyChecksForUpdates]) return;
@@ -178,17 +219,81 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
delayUntilCheck = (updateCheckInterval - intervalSinceCheck); // It hasn't been long enough.
else
delayUntilCheck = 0; // We're overdue! Run one now.
- checkTimer = [NSTimer scheduledTimerWithTimeInterval:delayUntilCheck target:self selector:@selector(checkForUpdatesInBackground) userInfo:nil repeats:NO];
+ checkTimer = [[NSTimer scheduledTimerWithTimeInterval:delayUntilCheck target:self selector:@selector(checkForUpdatesInBackground) userInfo:nil repeats:NO] retain]; // UK 2009-03-16 Timer is non-repeating, may have invalidated itself, so we had to retain it.
}
+
+-(void) putFeedURLIntoDictionary: (NSMutableDictionary*)theDict // You release this.
+{
+ [theDict setObject: [self feedURL] forKey: @"feedURL"];
+}
+
+-(void) checkForUpdatesInBgReachabilityCheckWithDriver: (SUUpdateDriver*)inDriver /* RUNS ON ITS OWN THREAD */
+{
+ NS_DURING
+ // 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;
+
+ //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.
+ [self performSelectorOnMainThread: @selector(checkForUpdatesWithDriver:) withObject: isNetworkReachable ? inDriver : nil waitUntilDone: NO];
+
+ [pool release];
+ NS_HANDLER
+ 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
+}
+
+
- (void)checkForUpdatesInBackground
{
- checkTimer = nil; // Timer doesn't repeat, so it's invalid, just needs to be set to nil.
+ // Background update checks should only happen if we have a network connection.
+ // Wouldn't want to annoy users on dial-up by establishing a connection every
+ // hour or so:
+ SUUpdateDriver * theUpdateDriver = [[[([self automaticallyDownloadsUpdates] ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class]) alloc] initWithUpdater:self] autorelease];
- [self checkForUpdatesWithDriver:[[[([self automaticallyDownloadsUpdates] ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class]) alloc] initWithUpdater:self] autorelease]];
+ [NSThread detachNewThreadSelector: @selector(checkForUpdatesInBgReachabilityCheckWithDriver:) toTarget: self withObject: theUpdateDriver];
}
-- (IBAction)checkForUpdates:sender
+
+- (BOOL)mayUpdateAndRestart
+{
+ return( !delegate || ![delegate respondsToSelector: @selector(updaterShouldRelaunchApplication:)] || [delegate updaterShouldRelaunchApplication: self] );
+}
+
+- (IBAction)checkForUpdates: (id)sender
{
[self checkForUpdatesWithDriver:[[[SUUserInitiatedUpdateDriver alloc] initWithUpdater:self] autorelease]];
}
@@ -201,14 +306,35 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)d
{
if ([self updateInProgress]) { return; }
- if (checkTimer) { [checkTimer invalidate]; checkTimer = nil; }
+ if (checkTimer) { [checkTimer invalidate]; [checkTimer release]; checkTimer = nil; } // UK 2009-03-16 Timer is non-repeating, may have invalidated itself, so we had to retain it.
+
+ SUClearLog();
+ SULog( @"===== %@ =====", [[NSFileManager defaultManager] displayNameAtPath: [[NSBundle mainBundle] bundlePath]] );
[self willChangeValueForKey:@"lastUpdateCheckDate"];
[host setObject:[NSDate date] forUserDefaultsKey:SULastCheckTimeKey];
[self didChangeValueForKey:@"lastUpdateCheckDate"];
- driver = [d retain];
- [driver checkForUpdatesAtURL:[self parameterizedFeedURL] host:host];
+ if( [delegate respondsToSelector: @selector(updaterMayCheckForUpdates:)] && ![delegate updaterMayCheckForUpdates: self] )
+ {
+ [self scheduleNextUpdateCheck];
+ return;
+ }
+
+ driver = [d retain];
+
+ // If we're not given a driver at all, just schedule the next update check and bail.
+ if (!driver)
+ {
+ [self scheduleNextUpdateCheck];
+ return;
+ }
+
+ NSURL* theFeedURL = [self parameterizedFeedURL];
+ if( theFeedURL ) // Use a NIL URL to cancel quietly.
+ [driver checkForUpdatesAtURL: theFeedURL host:host];
+ else
+ [driver abortUpdate];
}
- (void)registerAsObserver
@@ -293,14 +419,20 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
[host setObject:[feedURL absoluteString] forUserDefaultsKey:SUFeedURLKey];
}
-- (NSURL *)feedURL
+- (NSURL *)feedURL // *** MUST BE CALLED ON MAIN THREAD ***
{
// A value in the user defaults overrides one in the Info.plist (so preferences panels can be created wherein users choose between beta / release feeds).
NSString *appcastString = [host objectForKey:SUFeedURLKey];
+ if( [delegate respondsToSelector: @selector(feedURLStringForUpdater:)] )
+ appcastString = [delegate feedURLStringForUpdater: self];
if (!appcastString) // Can't find an appcast string!
[NSException raise:@"SUNoFeedURL" format:@"You must specify the URL of the appcast as the SUFeedURL key in either the Info.plist or the user defaults!"];
NSCharacterSet* quoteSet = [NSCharacterSet characterSetWithCharactersInString: @"\"\'"]; // Some feed publishers add quotes; strip 'em.
- return [NSURL URLWithString:[appcastString stringByTrimmingCharactersInSet:quoteSet]];
+ NSString* castUrlStr = [appcastString stringByTrimmingCharactersInSet:quoteSet];
+ if( !castUrlStr || [castUrlStr length] == 0 )
+ return nil;
+ else
+ return [NSURL URLWithString: castUrlStr];
}
- (void)setUserAgentString:(NSString *)userAgent
@@ -398,7 +530,7 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
{
[self unregisterAsObserver];
[host release];
- if (checkTimer) { [checkTimer invalidate]; }
+ if (checkTimer) { [checkTimer invalidate]; [checkTimer release]; checkTimer = nil; } // UK 2009-03-16 Timer is non-repeating, may have invalidated itself, so we had to retain it.
[super dealloc];
}
@@ -419,7 +551,7 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
return driver && ([driver finished] == NO);
}
-- delegate { return delegate; }
+- (id)delegate { return delegate; }
- (NSBundle *)hostBundle { return [host bundle]; }
@end
diff --git a/SUUpdater_Private.h b/SUUpdater_Private.h
new file mode 100644
index 00000000..599ddfcd
--- /dev/null
+++ b/SUUpdater_Private.h
@@ -0,0 +1,15 @@
+//
+// SUUpdater_Private.h
+// Sparkle
+//
+// Created by Andy Matuschak on 5/9/11.
+// Copyright 2011 Andy Matuschak. All rights reserved.
+//
+
+#import "SUUpdater.h"
+
+@interface SUUpdater (Private)
+
+- (BOOL)mayUpdateAndRestart;
+
+@end
diff --git a/SUVersionComparisonProtocol.h b/SUVersionComparisonProtocol.h
index 3d11ae87..6c65ea45 100644
--- a/SUVersionComparisonProtocol.h
+++ b/SUVersionComparisonProtocol.h
@@ -9,6 +9,8 @@
#ifndef SUVERSIONCOMPARISONPROTOCOL_H
#define SUVERSIONCOMPARISONPROTOCOL_H
+#import
+
/*!
@protocol
@abstract Implement this protocol to provide version comparison facilities for Sparkle.
@@ -20,7 +22,7 @@
@abstract An abstract method to compare two version strings.
@discussion Should return NSOrderedAscending if b > a, NSOrderedDescending if b < a, and NSOrderedSame if they are equivalent.
*/
-- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB;
+- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB; // *** MAY BE CALLED ON NON-MAIN THREAD!
@end
diff --git a/SUVersionDisplayProtocol.h b/SUVersionDisplayProtocol.h
new file mode 100644
index 00000000..368b9c9f
--- /dev/null
+++ b/SUVersionDisplayProtocol.h
@@ -0,0 +1,27 @@
+//
+// SUVersionDisplayProtocol.h
+// EyeTV
+//
+// Created by Uli Kusterer on 08.12.09.
+// Copyright 2009 Elgato Systems GmbH. All rights reserved.
+//
+
+#import
+
+
+/*!
+ @protocol
+ @abstract Implement this protocol to apply special formatting to the two
+ version numbers.
+*/
+@protocol SUVersionDisplay
+
+/*!
+ @method
+ @abstract An abstract method to format two version strings.
+ @discussion You get both so you can display important distinguishing
+ information, but leave out unnecessary/confusing parts.
+*/
+-(void) formatVersion: (NSString**)inOutVersionA andVersion: (NSString**)inOutVersionB;
+
+@end
diff --git a/Sparkle.xcodeproj/.gitignore b/Sparkle.xcodeproj/.gitignore
new file mode 100644
index 00000000..9c4f6f50
--- /dev/null
+++ b/Sparkle.xcodeproj/.gitignore
@@ -0,0 +1,5 @@
+*.pbxuser
+*.perspectivev3
+*.mode1v3
+project.xcworkspace/
+xcuserdata/
diff --git a/Sparkle.xcodeproj/default.pbxuser b/Sparkle.xcodeproj/default.pbxuser
deleted file mode 100644
index 1bddcecd..00000000
--- a/Sparkle.xcodeproj/default.pbxuser
+++ /dev/null
@@ -1,245 +0,0 @@
-// !$*UTF8*$!
-{
- 0867D690FE84028FC02AAC07 /* Project object */ = {
- activeArchitecture = i386;
- activeBuildConfigurationName = Debug;
- activeExecutable = FAEC981A0D94C8750008EDA9 /* Sparkle Test App */;
- activeTarget = 61B5F90109C4CEE200B25A18 /* Sparkle Test App */;
- codeSenseManager = FAEC98240D94C8760008EDA9 /* Code sense */;
- executables = (
- FAEC981A0D94C8750008EDA9 /* Sparkle Test App */,
- FAEC981B0D94C8750008EDA9 /* Relaunch Tool */,
- );
- perUserDictionary = {
- PBXPerProjectTemplateStateSaveDate = 227854453;
- PBXWorkspaceStateSaveDate = 227854453;
- };
- sourceControlManager = FAEC98230D94C8760008EDA9 /* Source Control */;
- userBuildSettings = {
- };
- };
- 61B5F90109C4CEE200B25A18 /* Sparkle Test App */ = {
- activeExec = 0;
- executables = (
- FAEC981A0D94C8750008EDA9 /* Sparkle Test App */,
- );
- };
- 8DC2EF4F0486A6940098B216 /* Sparkle */ = {
- activeExec = 0;
- };
- D1E42C2E0CE754AE00F50EB9 /* Relaunch Tool */ = {
- activeExec = 0;
- executables = (
- FAEC981B0D94C8750008EDA9 /* Relaunch Tool */,
- );
- };
- FAEC981A0D94C8750008EDA9 /* Sparkle Test App */ = {
- isa = PBXExecutable;
- activeArgIndices = (
- );
- argumentStrings = (
- );
- autoAttachOnCrash = 1;
- breakpointsEnabled = 1;
- configStateDict = {
- };
- customDataFormattersEnabled = 1;
- debuggerPlugin = GDBDebugging;
- disassemblyDisplayState = 0;
- dylibVariantSuffix = "";
- enableDebugStr = 1;
- environmentEntries = (
- {
- active = YES;
- name = MallocPreScribble;
- value = 1;
- },
- {
- active = YES;
- name = MallocScribble;
- value = 1;
- },
- {
- active = YES;
- name = MallocGuardEdges;
- value = 1;
- },
- {
- active = YES;
- name = MallocCheckHeapStart;
- value = 1;
- },
- {
- active = YES;
- name = MallocCheckHeapEach;
- value = 100000;
- },
- {
- active = YES;
- name = MallocStackLogging;
- value = 1;
- },
- {
- active = NO;
- name = MallocStackLoggingNoCompact;
- value = 1;
- },
- {
- active = YES;
- name = NSDebugEnabled;
- value = YES;
- },
- {
- active = YES;
- name = NSZombieEnabled;
- value = YES;
- },
- {
- active = NO;
- name = NSDeallocateZombies;
- value = NO;
- },
- {
- active = YES;
- name = NSAutoreleaseFreedObjectCheckEnabled;
- value = YES;
- },
- {
- active = NO;
- name = MALLOC_PROTECT_BEFORE;
- value = 1;
- },
- {
- active = YES;
- name = MALLOC_ALTIVEC_SIZE;
- value = 1;
- },
- {
- active = YES;
- name = MALLOC_FILL_SPACE;
- value = 1;
- },
- {
- active = NO;
- name = CFZombieLevel;
- value = 65553;
- },
- );
- executableSystemSymbolLevel = 0;
- executableUserSymbolLevel = 0;
- libgmallocEnabled = 0;
- name = "Sparkle Test App";
- sourceDirectories = (
- );
- };
- FAEC981B0D94C8750008EDA9 /* Relaunch Tool */ = {
- isa = PBXExecutable;
- activeArgIndices = (
- );
- argumentStrings = (
- );
- autoAttachOnCrash = 1;
- breakpointsEnabled = 1;
- configStateDict = {
- };
- customDataFormattersEnabled = 1;
- debuggerPlugin = GDBDebugging;
- disassemblyDisplayState = 0;
- dylibVariantSuffix = "";
- enableDebugStr = 1;
- environmentEntries = (
- {
- active = YES;
- name = MallocPreScribble;
- value = 1;
- },
- {
- active = YES;
- name = MallocScribble;
- value = 1;
- },
- {
- active = YES;
- name = MallocGuardEdges;
- value = 1;
- },
- {
- active = YES;
- name = MallocCheckHeapStart;
- value = 1;
- },
- {
- active = YES;
- name = MallocCheckHeapEach;
- value = 100000;
- },
- {
- active = YES;
- name = MallocStackLogging;
- value = 1;
- },
- {
- active = NO;
- name = MallocStackLoggingNoCompact;
- value = 1;
- },
- {
- active = YES;
- name = NSDebugEnabled;
- value = YES;
- },
- {
- active = YES;
- name = NSZombieEnabled;
- value = YES;
- },
- {
- active = NO;
- name = NSDeallocateZombies;
- value = NO;
- },
- {
- active = YES;
- name = NSAutoreleaseFreedObjectCheckEnabled;
- value = YES;
- },
- {
- active = NO;
- name = MALLOC_PROTECT_BEFORE;
- value = 1;
- },
- {
- active = YES;
- name = MALLOC_ALTIVEC_SIZE;
- value = 1;
- },
- {
- active = YES;
- name = MALLOC_FILL_SPACE;
- value = 1;
- },
- {
- active = NO;
- name = CFZombieLevel;
- value = 65553;
- },
- );
- executableSystemSymbolLevel = 0;
- executableUserSymbolLevel = 0;
- libgmallocEnabled = 0;
- name = "Relaunch Tool";
- sourceDirectories = (
- );
- };
- FAEC98230D94C8760008EDA9 /* Source Control */ = {
- isa = PBXSourceControlManager;
- fallbackIsa = XCSourceControlManager;
- isSCMEnabled = 0;
- scmConfiguration = {
- };
- };
- FAEC98240D94C8760008EDA9 /* Code sense */ = {
- isa = PBXCodeSenseManager;
- indexTemplatePath = "";
- };
-}
diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj
index 37ee3501..d5ebe18d 100644
--- a/Sparkle.xcodeproj/project.pbxproj
+++ b/Sparkle.xcodeproj/project.pbxproj
@@ -7,6 +7,35 @@
objects = {
/* Begin PBXBuildFile section */
+ 3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 3772FEA813DE0B6B00F79537 /* SUVersionDisplayProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 525A2790133D6AE900FD8D70 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 525A278F133D6AE900FD8D70 /* Cocoa.framework */; };
+ 525A27A0133D6B9700FD8D70 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 525A278F133D6AE900FD8D70 /* Cocoa.framework */; };
+ 550347011370023A00AE7681 /* Sparkle.icns in Resources */ = {isa = PBXBuildFile; fileRef = 550347001370023A00AE7681 /* Sparkle.icns */; };
+ 55C14BD4136EEFCE00649790 /* finish_installation.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14BD3136EEFCE00649790 /* finish_installation.m */; };
+ 55C14BD9136EF00C00649790 /* SUStatus.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55C14BD8136EF00C00649790 /* SUStatus.xib */; };
+ 55C14BEE136EF20D00649790 /* SUAutomaticUpdateAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55C14BDA136EF20D00649790 /* SUAutomaticUpdateAlert.xib */; };
+ 55C14BEF136EF21700649790 /* SUStatus.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55C14BD8136EF00C00649790 /* SUStatus.xib */; };
+ 55C14C04136EF26100649790 /* SUUpdateAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55C14BF0136EF26100649790 /* SUUpdateAlert.xib */; };
+ 55C14C19136EF2C700649790 /* SUUpdatePermissionPrompt.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55C14C05136EF2C700649790 /* SUUpdatePermissionPrompt.xib */; };
+ 55C14EE8136EF61D00649790 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 525A278F133D6AE900FD8D70 /* Cocoa.framework */; };
+ 55C14F00136EF6B700649790 /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; };
+ 55C14F06136EF6DB00649790 /* SULog.h in Headers */ = {isa = PBXBuildFile; fileRef = 55C14F04136EF6DB00649790 /* SULog.h */; };
+ 55C14F07136EF6DB00649790 /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; };
+ 55C14F08136EF6DB00649790 /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; };
+ 55C14F0C136EF6EA00649790 /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; };
+ 55C14F0D136EF6F200649790 /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; };
+ 55C14F0F136EF73600649790 /* finish_installation.pch in Headers */ = {isa = PBXBuildFile; fileRef = 55C14F0E136EF73600649790 /* finish_installation.pch */; };
+ 55C14F20136EF84300649790 /* SUStatusController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6196CFE409C71ADE000DC222 /* SUStatusController.m */; };
+ 55C14F21136EF84D00649790 /* SUPlainInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5040DAE8AB80026945C /* SUPlainInstaller.m */; };
+ 55C14F22136EF86000649790 /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; };
+ 55C14F23136EF86700649790 /* SUSystemProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A2279B0D1CEE7600430CCD /* SUSystemProfiler.m */; };
+ 55C14F24136EF86F00649790 /* SUPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */; };
+ 55C14F2A136EF9A900649790 /* SUWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61180BC90D64138900B4E0D1 /* SUWindowController.m */; };
+ 55C14F32136EFC2400649790 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55C14F31136EFC2400649790 /* SystemConfiguration.framework */; };
+ 55C14F3B136EFCB300649790 /* finish_installation.app in Resources */ = {isa = PBXBuildFile; fileRef = 55C14BB7136EEF1500649790 /* finish_installation.app */; };
+ 55C14F7E136F005000649790 /* SUPlainInstallerInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */; };
+ 55C14F9A136F045400649790 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; };
+ 55C14FC7136F05E100649790 /* Sparkle.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8220A321A7F00D8810D /* Sparkle.strings */; };
5D06E8D80FD68C8E005AE3F6 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; };
5D06E8E90FD68CDB005AE3F6 /* bsdiff.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8DB0FD68CB9005AE3F6 /* bsdiff.c */; settings = {COMPILER_FLAGS = "-Wno-shorten-64-to-32"; }; };
5D06E8EA0FD68CDB005AE3F6 /* SUBinaryDeltaTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E30FD68CC7005AE3F6 /* SUBinaryDeltaTool.m */; };
@@ -22,9 +51,7 @@
5D1AF58B0FD7678C0065DB48 /* libxar.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */; };
5D1AF5900FD767AD0065DB48 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF58F0FD767AD0065DB48 /* libxml2.dylib */; };
5D1AF59A0FD767E50065DB48 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF5990FD767E50065DB48 /* libz.dylib */; };
- 5D1AF59C0FD768010065DB48 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF59B0FD768010065DB48 /* libcrypto.dylib */; };
5D1AF82B0FD768180065DB48 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF5990FD767E50065DB48 /* libz.dylib */; };
- 5D1AF82C0FD7681A0065DB48 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF59B0FD768010065DB48 /* libcrypto.dylib */; };
610134730DD250470049ACDF /* SUUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134710DD250470049ACDF /* SUUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
610134740DD250470049ACDF /* SUUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 610134720DD250470049ACDF /* SUUpdateDriver.m */; };
6101347B0DD2541A0049ACDF /* SUProbingUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134790DD2541A0049ACDF /* SUProbingUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
@@ -34,8 +61,6 @@
6102FE4B0E07803800F85D09 /* SUDiskImageUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */; };
6102FE5B0E08C7EC00F85D09 /* SUUnarchiver_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE590E08C7EC00F85D09 /* SUUnarchiver_Private.h */; settings = {ATTRIBUTES = (); }; };
6102FE5C0E08C7EC00F85D09 /* SUUnarchiver_Private.m in Sources */ = {isa = PBXBuildFile; fileRef = 6102FE5A0E08C7EC00F85D09 /* SUUnarchiver_Private.m */; };
- 610D5A1A0A1661B8004AAD9C /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; };
- 610D5A750A1670A4004AAD9C /* SUStatus.nib in Resources */ = {isa = PBXBuildFile; fileRef = 610D5A740A1670A4004AAD9C /* SUStatus.nib */; };
610EC1E00CF3A5FE00AE239E /* NTSynchronousTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 610EC1BF0CF3914D00AE239E /* NTSynchronousTask.m */; };
611142E910FB1BE5009810AA /* bspatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 611142E810FB1BE5009810AA /* bspatch.h */; };
61177A1F0D1112E900749C97 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6117796E0D1112E000749C97 /* IOKit.framework */; };
@@ -55,6 +80,7 @@
612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; settings = {ATTRIBUTES = (); }; };
612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */; };
61407C390A4099050009F71F /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; };
+ 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 = (); }; };
@@ -75,8 +101,8 @@
61A354550DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A354530DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
61A354560DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A354540DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.m */; };
61AAE8280A321A7F00D8810D /* Sparkle.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8220A321A7F00D8810D /* Sparkle.strings */; };
- 61AAE8290A321A8000D8810D /* SUAutomaticUpdateAlert.nib in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8240A321A7F00D8810D /* SUAutomaticUpdateAlert.nib */; };
- 61AAE82A0A321A8000D8810D /* SUUpdateAlert.nib in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8260A321A7F00D8810D /* SUUpdateAlert.nib */; };
+ 61B078CE15A5FB6100600039 /* SUCodeSigningVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B078CC15A5FB6100600039 /* SUCodeSigningVerifier.h */; };
+ 61B078CF15A5FB6100600039 /* SUCodeSigningVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B078CD15A5FB6100600039 /* SUCodeSigningVerifier.m */; };
61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */; settings = {ATTRIBUTES = (Public, ); }; };
61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */; };
61B5F8EF09C4CE3C00B25A18 /* SUPlainInstallerInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */; };
@@ -100,7 +126,6 @@
61B93C0A0DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93C080DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m */; };
61BBDF820A49220C00378739 /* Sparkle.icns in Resources */ = {isa = PBXBuildFile; fileRef = 61BBDF810A49220C00378739 /* Sparkle.icns */; };
61C2680A0E2DB5D000175E6C /* License.txt in Resources */ = {isa = PBXBuildFile; fileRef = 61C268090E2DB5D000175E6C /* License.txt */; };
- 61C46F340D9C54F300B06326 /* SUUpdatePermissionPrompt.nib in Resources */ = {isa = PBXBuildFile; fileRef = 61C46F330D9C54F300B06326 /* SUUpdatePermissionPrompt.nib */; };
61CFB3290E385186007A1735 /* Sparkle.pch in Headers */ = {isa = PBXBuildFile; fileRef = 61CFB3280E385186007A1735 /* Sparkle.pch */; };
61D85D6D0E10B2ED00F9B4A9 /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */; };
61EF67560E25B58D00F754E0 /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; };
@@ -108,18 +133,19 @@
61F83F720DBFE140006FDD30 /* SUBasicUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */; };
61F83F740DBFE141006FDD30 /* SUBasicUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
61FA52880E2D9EA400EF58AD /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; settings = {ATTRIBUTES = (Required, ); }; };
- DAAEFC9B0DA5722F0051E0D0 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
- DAAEFD4E0DA572330051E0D0 /* relaunch.m in Sources */ = {isa = PBXBuildFile; fileRef = 613242130CD06CEF00106AA4 /* relaunch.m */; };
- DAAEFD510DA572550051E0D0 /* relaunch in Resources */ = {isa = PBXBuildFile; fileRef = DAAEFC960DA571DF0051E0D0 /* relaunch */; };
- FA8342D2104A4B1F001FE2FF /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; };
- FA8342DE104A4B54001FE2FF /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; };
- FAEFA2F70D94AA7500472538 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- FAEFA2F80D94AA7900472538 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
- FAEFA3040D94AB3400472538 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
- FAEFA3050D94AB3400472538 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
+ 93FB277A156BD80D001937C7 /* SUPasswordPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FB2778156BD80D001937C7 /* SUPasswordPrompt.h */; };
+ 93FB277B156BD80D001937C7 /* SUPasswordPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 93FB2779156BD80D001937C7 /* SUPasswordPrompt.m */; };
+ 93FB277F156BD826001937C7 /* SUPasswordPrompt.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93FB277D156BD826001937C7 /* SUPasswordPrompt.xib */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
+ 55C14F96136F044100649790 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 55C14BB6136EEF1500649790;
+ remoteInfo = finish_installation;
+ };
5D06E8D50FD68C86005AE3F6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -127,13 +153,6 @@
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = Sparkle;
};
- 61227AB90DB5C4BB00AB99EA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 612279D80DB5470200AB99EA;
- remoteInfo = "Sparkle Unit Tests";
- };
61B5F91B09C4CF7200B25A18 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -148,13 +167,6 @@
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = Sparkle;
};
- DAAEFD4F0DA572460051E0D0 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = DAAEFC950DA571DF0051E0D0;
- remoteInfo = relaunch;
- };
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -171,8 +183,77 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 0263187214FEBB31005EBF43 /* uk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Sparkle.strings; sourceTree = ""; };
+ 0263187514FEBB42005EBF43 /* uk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = uk; path = uk.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 0263187614FEBB42005EBF43 /* uk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = uk; path = uk.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 0263187714FEBB42005EBF43 /* uk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = uk; path = uk.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; };
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; };
+ 3772FEA813DE0B6B00F79537 /* SUVersionDisplayProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUVersionDisplayProtocol.h; sourceTree = ""; };
+ 525A278F133D6AE900FD8D70 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; };
+ 550347001370023A00AE7681 /* Sparkle.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Sparkle.icns; sourceTree = ""; };
+ 55C14BB7136EEF1500649790 /* finish_installation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = finish_installation.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 55C14BB9136EEF1500649790 /* finish_installation-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "finish_installation-Info.plist"; sourceTree = ""; };
+ 55C14BD3136EEFCE00649790 /* finish_installation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = finish_installation.m; sourceTree = ""; };
+ 55C14BD8136EF00C00649790 /* SUStatus.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SUStatus.xib; sourceTree = ""; };
+ 55C14BDB136EF20D00649790 /* cs */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = cs; path = cs.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BDC136EF20D00649790 /* da */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = da; path = da.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BDD136EF20D00649790 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BDE136EF20D00649790 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BDF136EF20D00649790 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BE0136EF20D00649790 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BE1136EF20D00649790 /* is */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = is; path = is.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BE2136EF20D00649790 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = it.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BE3136EF20D00649790 /* ja */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ja; path = ja.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BE4136EF20D00649790 /* ko */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ko; path = ko.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BE5136EF20D00649790 /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = nl.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BE6136EF20D00649790 /* pl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pl; path = pl.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BE7136EF20D00649790 /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_BR; path = pt_BR.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BE9136EF20D00649790 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = ru.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BEA136EF20D00649790 /* sk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sk; path = sk.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BEB136EF20D00649790 /* sv */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sv; path = sv.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BEC136EF20D00649790 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh_CN; path = zh_CN.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BED136EF20D00649790 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh_TW; path = zh_TW.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 55C14BF1136EF26100649790 /* cs */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = cs; path = cs.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BF2136EF26100649790 /* da */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = da; path = da.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BF3136EF26100649790 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BF4136EF26100649790 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BF5136EF26100649790 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BF6136EF26100649790 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BF7136EF26100649790 /* is */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = is; path = is.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BF8136EF26100649790 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = it.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BF9136EF26100649790 /* ja */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ja; path = ja.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BFA136EF26100649790 /* ko */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ko; path = ko.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BFB136EF26100649790 /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = nl.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BFC136EF26100649790 /* pl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pl; path = pl.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BFD136EF26100649790 /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_BR; path = pt_BR.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14BFF136EF26100649790 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = ru.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14C00136EF26100649790 /* sk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sk; path = sk.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14C01136EF26100649790 /* sv */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sv; path = sv.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14C02136EF26100649790 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh_CN; path = zh_CN.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14C03136EF26100649790 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh_TW; path = zh_TW.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 55C14C06136EF2C700649790 /* cs */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = cs; path = cs.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C07136EF2C700649790 /* da */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = da; path = da.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C08136EF2C700649790 /* de */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = de; path = de.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C09136EF2C700649790 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C0A136EF2C700649790 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C0B136EF2C700649790 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C0C136EF2C700649790 /* is */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = is; path = is.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C0D136EF2C700649790 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = it.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C0E136EF2C700649790 /* ja */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ja; path = ja.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C0F136EF2C700649790 /* ko */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ko; path = ko.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C10136EF2C700649790 /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = nl.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C11136EF2C700649790 /* pl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pl; path = pl.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C12136EF2C700649790 /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_BR; path = pt_BR.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C14136EF2C700649790 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = ru.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C15136EF2C700649790 /* sk */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sk; path = sk.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C16136EF2C700649790 /* sv */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sv; path = sv.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C17136EF2C700649790 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh_CN; path = zh_CN.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14C18136EF2C700649790 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = zh_TW; path = zh_TW.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 55C14F04136EF6DB00649790 /* SULog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SULog.h; sourceTree = ""; };
+ 55C14F05136EF6DB00649790 /* SULog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SULog.m; sourceTree = ""; };
+ 55C14F0E136EF73600649790 /* finish_installation.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = finish_installation.pch; sourceTree = ""; };
+ 55C14F31136EFC2400649790 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
5D06E8D00FD68C7C005AE3F6 /* BinaryDelta */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = BinaryDelta; sourceTree = BUILT_PRODUCTS_DIR; };
5D06E8DB0FD68CB9005AE3F6 /* bsdiff.c */ = {isa = PBXFileReference; comments = "-Wno-shorten-64-to-32"; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bsdiff.c; sourceTree = ""; };
5D06E8DC0FD68CB9005AE3F6 /* bspatch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bspatch.c; sourceTree = ""; };
@@ -190,7 +271,6 @@
5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxar.1.dylib; path = /usr/lib/libxar.1.dylib; sourceTree = ""; };
5D1AF58F0FD767AD0065DB48 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = ""; };
5D1AF5990FD767E50065DB48 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = ""; };
- 5D1AF59B0FD768010065DB48 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = /usr/lib/libcrypto.dylib; sourceTree = ""; };
610134710DD250470049ACDF /* SUUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdateDriver.h; sourceTree = ""; };
610134720DD250470049ACDF /* SUUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdateDriver.m; sourceTree = ""; };
610134790DD2541A0049ACDF /* SUProbingUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUProbingUpdateDriver.h; sourceTree = ""; };
@@ -201,33 +281,18 @@
6102FE590E08C7EC00F85D09 /* SUUnarchiver_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiver_Private.h; sourceTree = ""; };
6102FE5A0E08C7EC00F85D09 /* SUUnarchiver_Private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUnarchiver_Private.m; sourceTree = ""; };
61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigFrameworkReleaseGCSupport.xcconfig; sourceTree = ""; };
- 610D5A740A1670A4004AAD9C /* SUStatus.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = SUStatus.nib; sourceTree = ""; };
610EC1BF0CF3914D00AE239E /* NTSynchronousTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NTSynchronousTask.m; sourceTree = ""; };
610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NTSynchronousTask.h; sourceTree = ""; };
611142E810FB1BE5009810AA /* bspatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bspatch.h; sourceTree = ""; };
- 61131A050F846CE600E97AF6 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Sparkle.strings; sourceTree = ""; };
- 61131A090F846D0A00E97AF6 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Sparkle.strings; sourceTree = ""; };
- 61131A0A0F846D1100E97AF6 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Sparkle.strings; sourceTree = ""; };
- 61131A0B0F846D3F00E97AF6 /* da */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = da; path = da.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 61131A0C0F846D4700E97AF6 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_CN; path = zh_CN.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 61131A0D0F846D4F00E97AF6 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_TW; path = zh_TW.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 61131A0E0F846D5A00E97AF6 /* da */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = da; path = da.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 61131A0F0F846D6100E97AF6 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_CN; path = zh_CN.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 61131A100F846D6800E97AF6 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_TW; path = zh_TW.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 61131A110F846D7300E97AF6 /* da */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = da; path = da.lproj/SUUpdateAlert.nib; sourceTree = ""; };
- 61131A120F846D7C00E97AF6 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_CN; path = zh_CN.lproj/SUUpdateAlert.nib; sourceTree = ""; };
- 61131A130F846D8400E97AF6 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_TW; path = zh_TW.lproj/SUUpdateAlert.nib; sourceTree = ""; };
+ 61131A050F846CE600E97AF6 /* da */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Sparkle.strings; sourceTree = ""; };
+ 61131A090F846D0A00E97AF6 /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Sparkle.strings; sourceTree = ""; };
+ 61131A0A0F846D1100E97AF6 /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Sparkle.strings; sourceTree = ""; };
+ 6113C9D315BE1D3600C303E7 /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_BR; path = pt_BR.lproj/SUPasswordPrompt.xib; sourceTree = ""; };
6117796E0D1112E000749C97 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; };
61180BC80D64138900B4E0D1 /* SUWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUWindowController.h; sourceTree = ""; };
61180BC90D64138900B4E0D1 /* SUWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUWindowController.m; sourceTree = ""; };
- 611A904210240DD300CC659E /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Sparkle.strings; sourceTree = ""; };
- 611A904310240DE000CC659E /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pl; path = pl.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 611A904410240DE800CC659E /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pl; path = pl.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 611A904510240DF000CC659E /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pl; path = pl.lproj/SUUpdateAlert.nib; sourceTree = ""; };
- 611A904610240DF700CC659E /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Sparkle.strings; sourceTree = ""; };
- 611A904710240DFF00CC659E /* ja */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ja; path = ja.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 611A904810240E0600CC659E /* ja */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ja; path = ja.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 611A904910240E0C00CC659E /* ja */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ja; path = ja.lproj/SUUpdateAlert.nib; sourceTree = ""; };
+ 611A904210240DD300CC659E /* pl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Sparkle.strings; sourceTree = ""; };
+ 611A904610240DF700CC659E /* ja */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Sparkle.strings; sourceTree = ""; };
6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAutomaticUpdateAlert.h; sourceTree = ""; };
6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAutomaticUpdateAlert.m; sourceTree = ""; };
612279D90DB5470200AB99EA /* Sparkle Unit Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Sparkle Unit Tests.octest"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -245,25 +310,25 @@
6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPipedUnarchiver.m; sourceTree = ""; };
612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermissionPrompt.h; sourceTree = ""; };
612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermissionPrompt.m; sourceTree = ""; };
- 613151B20FB4946A000DCD59 /* is */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/Sparkle.strings; sourceTree = ""; };
- 613151B30FB49480000DCD59 /* is */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = is; path = is.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 613151B40FB49488000DCD59 /* is */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = is; path = is.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 613151B50FB49492000DCD59 /* is */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = is; path = is.lproj/SUUpdateAlert.nib; sourceTree = ""; };
- 613242130CD06CEF00106AA4 /* relaunch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = relaunch.m; sourceTree = ""; };
+ 613151B20FB4946A000DCD59 /* is */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/Sparkle.strings; sourceTree = ""; };
+ 6149E6EA1601ABAC008A351E /* ar */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Sparkle.strings; sourceTree = ""; };
+ 6149E6ED1601ABAC008A351E /* ar */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ar; path = ar.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 6149E6EE1601ABAC008A351E /* ar */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ar; path = ar.lproj/SUPasswordPrompt.xib; sourceTree = ""; };
+ 6149E6EF1601ABAC008A351E /* ar */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ar; path = ar.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 6149E6F01601ABAC008A351E /* ar */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ar; path = ar.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
615409A8103BA09100125AF1 /* ConfigTestAppReleaseGCSupport.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigTestAppReleaseGCSupport.xcconfig; sourceTree = ""; };
- 615409C4103BBC4000125AF1 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Sparkle.strings; sourceTree = ""; };
- 615409C5103BBC5000125AF1 /* cs */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = cs; path = cs.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 615409C6103BBD9F00125AF1 /* cs */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = cs; path = cs.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 615409C7103BBDA600125AF1 /* cs */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = cs; path = cs.lproj/SUUpdateAlert.nib; sourceTree = ""; };
+ 615409C4103BBC4000125AF1 /* cs */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Sparkle.strings; sourceTree = ""; };
+ 6158A1B81378F64700487EC1 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_PT; path = pt_PT.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 6158A1BA1378F68100487EC1 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_PT; path = pt_PT.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 6158A1BB1378F68100487EC1 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = pt_PT; path = pt_PT.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 6158A1BE1378F8BB00487EC1 /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = tr.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 6158A1BF1378F8BB00487EC1 /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = tr.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 6158A1C01378F8BB00487EC1 /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = tr.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 6158A1C4137904B300487EC1 /* SUUpdater_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdater_Private.h; sourceTree = ""; };
615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SUModelTranslation.plist; sourceTree = ""; };
- 6186554210D7484300B1E074 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt_PT; path = pt_PT.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 6186554310D7484E00B1E074 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Sparkle.strings; sourceTree = ""; };
- 6186554410D7486E00B1E074 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt_PT; path = pt_PT.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 6186554510D7488400B1E074 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt_PT; path = pt_PT.lproj/SUUpdateAlert.nib; sourceTree = ""; };
- 618915700E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 618915710E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/SUUpdateAlert.nib; sourceTree = ""; };
- 618915720E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 618915730E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = ""; };
+ 6160FD85134ABCD5007FFC5F /* tr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Sparkle.strings; sourceTree = ""; };
+ 6186554310D7484E00B1E074 /* pt_PT */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Sparkle.strings; sourceTree = ""; };
+ 618915730E35937600B5E981 /* sv */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = ""; };
618E9CFC0E7328F1004646D8 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = "Test Application/dsa_pub.pem"; sourceTree = ""; };
618FA4FF0DAE88B40026945C /* SUInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstaller.h; sourceTree = ""; };
618FA5000DAE88B40026945C /* SUInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstaller.m; sourceTree = ""; };
@@ -271,16 +336,10 @@
618FA5040DAE8AB80026945C /* SUPlainInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPlainInstaller.m; sourceTree = ""; };
618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPackageInstaller.h; sourceTree = ""; };
618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPackageInstaller.m; sourceTree = ""; };
- 6195D48F0E404AD600D41A50 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ru; path = ru.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 6195D4900E404AD600D41A50 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ru; path = ru.lproj/SUUpdateAlert.nib; sourceTree = ""; };
- 6195D4910E404AD600D41A50 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ru; path = ru.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 6195D4920E404AD700D41A50 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Sparkle.strings; sourceTree = ""; };
+ 6195D4920E404AD700D41A50 /* ru */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Sparkle.strings; sourceTree = ""; };
6196CFE309C71ADE000DC222 /* SUStatusController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStatusController.h; sourceTree = ""; };
6196CFE409C71ADE000DC222 /* SUStatusController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUStatusController.m; sourceTree = ""; };
- 619B17200E1E9D0800E72754 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Sparkle.strings; sourceTree = ""; };
- 619B17210E1E9D0800E72754 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 619B17220E1E9D0800E72754 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/SUUpdateAlert.nib; sourceTree = ""; };
- 619B17230E1E9D0800E72754 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
+ 619B17200E1E9D0800E72754 /* de */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Sparkle.strings; sourceTree = ""; };
61A2259C0D1C495D00430CCD /* SUVersionComparisonProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUVersionComparisonProtocol.h; sourceTree = ""; };
61A225A20D1C4AC000430CCD /* SUStandardVersionComparator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStandardVersionComparator.h; sourceTree = ""; };
61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUStandardVersionComparator.m; sourceTree = ""; };
@@ -289,11 +348,12 @@
61A354530DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUserInitiatedUpdateDriver.h; sourceTree = ""; };
61A354540DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUserInitiatedUpdateDriver.m; sourceTree = ""; };
61AAE8230A321A7F00D8810D /* en */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Sparkle.strings; sourceTree = ""; };
- 61AAE8250A321A7F00D8810D /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = en; path = en.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 61AAE8270A321A7F00D8810D /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = en; path = en.lproj/SUUpdateAlert.nib; sourceTree = ""; };
61AAE84F0A321AF700D8810D /* es */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Sparkle.strings; sourceTree = ""; };
61AAE8590A321B0400D8810D /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Sparkle.strings; sourceTree = ""; };
61AAE8710A321F7700D8810D /* nl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Sparkle.strings; sourceTree = ""; };
+ 61B078CC15A5FB6100600039 /* SUCodeSigningVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUCodeSigningVerifier.h; sourceTree = ""; };
+ 61B078CD15A5FB6100600039 /* SUCodeSigningVerifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUCodeSigningVerifier.m; sourceTree = ""; };
+ 61B26BF817B2F76600F99C77 /* da */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = da; path = da.lproj/SUPasswordPrompt.xib; sourceTree = ""; };
61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SUUpdater.h; sourceTree = ""; };
61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUUpdater.m; sourceTree = ""; };
61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUPlainInstallerInternals.m; sourceTree = ""; };
@@ -316,34 +376,33 @@
61B93B260DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAutomaticUpdateDriver.m; sourceTree = ""; };
61B93C070DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUScheduledUpdateDriver.h; sourceTree = ""; };
61B93C080DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUScheduledUpdateDriver.m; sourceTree = ""; };
+ 61BA66CC14BDFA0400D02D86 /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/Sparkle.strings; sourceTree = ""; };
+ 61BA66DA14BDFC5500D02D86 /* sl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sl; path = sl.lproj/SUAutomaticUpdateAlert.xib; sourceTree = ""; };
+ 61BA66DB14BDFC5500D02D86 /* sl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sl; path = sl.lproj/SUUpdateAlert.xib; sourceTree = ""; };
+ 61BA66DC14BDFC5500D02D86 /* sl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sl; path = sl.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
61BBDF810A49220C00378739 /* Sparkle.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Sparkle.icns; sourceTree = ""; };
61C268090E2DB5D000175E6C /* License.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = License.txt; sourceTree = ""; };
- 61C46F350D9C54F300B06326 /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = en; path = en.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
61CFB3280E385186007A1735 /* Sparkle.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sparkle.pch; sourceTree = ""; };
- 61E31A7F103299450051D188 /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt_BR; path = pt_BR.lproj/SUUpdatePermissionPrompt.nib; sourceTree = ""; };
- 61E31A80103299500051D188 /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_BR; path = pt_BR.lproj/Sparkle.strings; sourceTree = ""; };
- 61E31A81103299560051D188 /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt_BR; path = pt_BR.lproj/SUAutomaticUpdateAlert.nib; sourceTree = ""; };
- 61E31A821032995F0051D188 /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt_BR; path = pt_BR.lproj/SUUpdateAlert.nib; sourceTree = ""; };
+ 61DEC1161477565C00931268 /* ro */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/Sparkle.strings; sourceTree = ""; };
+ 61DEC1181477566800931268 /* ro */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ro; path = ro.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; };
+ 61DEC11A1477567800931268 /* ro */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ro; path = ro.lproj/SUUpdateAlert.xib; sourceTree = "