mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Compare commits
141
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9eb4368d6f | ||
|
|
783fd4b475 | ||
|
|
00efab8ad2 | ||
|
|
d73b3745bf | ||
|
|
ccd44c0cb2 | ||
|
|
9a0acca849 | ||
|
|
95f9658a7e | ||
|
|
0fa24ce313 | ||
|
|
28ad466aa8 | ||
|
|
7e9fc0f20b | ||
|
|
7f5689835b | ||
|
|
478e0a53d0 | ||
|
|
588cad8d91 | ||
|
|
1d3ab8d6bb | ||
|
|
e086aa1660 | ||
|
|
188a15a948 | ||
|
|
874660f52e | ||
|
|
29bd46d68d | ||
|
|
cb80e0ef51 | ||
|
|
ccef53a3d3 | ||
|
|
d201803259 | ||
|
|
74b206dc77 | ||
|
|
42cda2d2e0 | ||
|
|
c386b704b5 | ||
|
|
84be00b29f | ||
|
|
d064b589ae | ||
|
|
90edd12e43 | ||
|
|
c71bf3ccbe | ||
|
|
724b4de07e | ||
|
|
444b0a928d | ||
|
|
ec8fcbc02f | ||
|
|
68e2cd67d1 | ||
|
|
c21e1aba35 | ||
|
|
ec7f38d157 | ||
|
|
5b38483981 | ||
|
|
46312a2d15 | ||
|
|
8a240f7c46 | ||
|
|
17ca061cda | ||
|
|
4da902b46c | ||
|
|
7b39268171 | ||
|
|
0343569cdc | ||
|
|
32a804e2ea | ||
|
|
7ce078eb16 | ||
|
|
f9dda21088 | ||
|
|
00c5ae4a42 | ||
|
|
d73d8333a1 | ||
|
|
9c720fd6b7 | ||
|
|
7228235ce3 | ||
|
|
5684a1477e | ||
|
|
347dd73269 | ||
|
|
a14850458d | ||
|
|
e249e3cfb6 | ||
|
|
d1c0978ee5 | ||
|
|
e3226d3511 | ||
|
|
ae7c416f16 | ||
|
|
1456fa0f75 | ||
|
|
d6acd07d5c | ||
|
|
d8149e9eb0 | ||
|
|
d6557e21a0 | ||
|
|
3bccef8d22 | ||
|
|
a27e8316fe | ||
|
|
b419948c8d | ||
|
|
211555639d | ||
|
|
46125abdeb | ||
|
|
69e4e7cc49 | ||
|
|
fe9dedb9ad | ||
|
|
47e6a96800 | ||
|
|
f42fb51952 | ||
|
|
1aea1b699a | ||
|
|
e769ba58cc | ||
|
|
f815eec2c0 | ||
|
|
de9be8b481 | ||
|
|
7454b8f2f6 | ||
|
|
b4c7dbe478 | ||
|
|
e14727dcc3 | ||
|
|
ac4e4e405b | ||
|
|
898216ac9f | ||
|
|
c42e3a3f47 | ||
|
|
cec9166956 | ||
|
|
675c66ff9d | ||
|
|
962a110b16 | ||
|
|
405410b8c8 | ||
|
|
32e014af06 | ||
|
|
0af86bbb9d | ||
|
|
a31dc3a102 | ||
|
|
7b212ea7fd | ||
|
|
b3f3944495 | ||
|
|
58a05e2ee7 | ||
|
|
3146ffb8e1 | ||
|
|
b815ce9db4 | ||
|
|
b14aa16a23 | ||
|
|
4397d85727 | ||
|
|
98832c4914 | ||
|
|
720269b118 | ||
|
|
c9bd13213b | ||
|
|
5fdddaeede | ||
|
|
8570539aab | ||
|
|
f4c6738793 | ||
|
|
e018ee98d3 | ||
|
|
95aabd561b | ||
|
|
a1b295c2c9 | ||
|
|
bc7aff3f11 | ||
|
|
dc249c1ec5 | ||
|
|
660228fb0e | ||
|
|
57c1f3e067 | ||
|
|
6ed9ae4bb9 | ||
|
|
752f754bb2 | ||
|
|
44a547341d | ||
|
|
c3f2c693a2 | ||
|
|
918217f6d2 | ||
|
|
bbdc432a20 | ||
|
|
5ba9562b17 | ||
|
|
fabfdcd178 | ||
|
|
33fac1c5af | ||
|
|
d60b87d98e | ||
|
|
c7881dec35 | ||
|
|
df0178e2de | ||
|
|
aaa60d261d | ||
|
|
88ab4b6f52 | ||
|
|
f9d3dbfa61 | ||
|
|
41d05dd922 | ||
|
|
82c2448321 | ||
|
|
a67b546a02 | ||
|
|
842d318277 | ||
|
|
251706d646 | ||
|
|
cbaa635a89 | ||
|
|
0a4bc6576a | ||
|
|
9a266ca52e | ||
|
|
4b6fc55056 | ||
|
|
c9bdb6ef04 | ||
|
|
bc52c0141a | ||
|
|
b2145b6838 | ||
|
|
74337fb65a | ||
|
|
4ffb7ea64a | ||
|
|
3d7e8c6c95 | ||
|
|
50de4d78e5 | ||
|
|
14358a8c37 | ||
|
|
9afa5febc2 | ||
|
|
70e09246ee | ||
|
|
4e8e3b9774 | ||
|
|
32129634ee |
No files matched your search
@@ -4,16 +4,16 @@ PREBINDING = NO
|
||||
ZERO_LINK = NO
|
||||
CURRENT_PROJECT_VERSION = 1.5
|
||||
SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.3
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.4
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.4
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5
|
||||
GCC_C_LANGUAGE_STANDARD = c99
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES
|
||||
GCC_DEBUGGING_SYMBOLS = full
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES
|
||||
GCC_PREFIX_HEADER = $(SDKROOT)/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h
|
||||
GCC_FAST_OBJC_DISPATCH = YES
|
||||
GCC_FAST_OBJC_DISPATCH[arch=ppc] = NO // requires 10.4
|
||||
|
||||
// Enable warnings
|
||||
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Framework only
|
||||
|
||||
INSTALL_PATH = @executable_path/../Frameworks
|
||||
INSTALL_PATH = @loader_path/../Frameworks
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.5
|
||||
DYLIB_CURRENT_VERSION = 1.5
|
||||
PRODUCT_NAME = Sparkle
|
||||
@@ -8,3 +8,4 @@ WRAPPER_EXTENSION = framework
|
||||
OTHER_LDFLAGS = -lcrypto
|
||||
FRAMEWORK_VERSION = A
|
||||
INFOPLIST_FILE = Info.plist
|
||||
GCC_PREFIX_HEADER = Sparkle.pch
|
||||
@@ -1,3 +1,9 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonRelease.xcconfig"
|
||||
#include "ConfigFramework.xcconfig"
|
||||
|
||||
STRIP_INSTALLED_PRODUCT = YES
|
||||
DEPLOYMENT_POSTPROCESSING = YES
|
||||
STRIPFLAGS = -u -r
|
||||
STRIP_STYLE = non-global
|
||||
SEPARATE_STRIP = YES
|
||||
@@ -1,59 +0,0 @@
|
||||
//
|
||||
// NSBundle+SUAdditions.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 12/21/07.
|
||||
// Copyright 2007 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NSBUNDLE_PLUS_ADDITIONS_H
|
||||
#define NSBUNDLE_PLUS_ADDITIONS_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSBundle (SUAdditions)
|
||||
/*!
|
||||
@method
|
||||
@abstract Returns a name for the bundle suitable for display to the user.
|
||||
@discussion This is performed by asking NSFileManager for the display name of the bundle.
|
||||
*/
|
||||
- (NSString *)name;
|
||||
|
||||
/*!
|
||||
@method
|
||||
@abstract Returns the current internal version of the bundle.
|
||||
@discussion This uses the CFBundleVersion info value. This string is not appropriate for display to users: use -displayVersion instead.
|
||||
*/
|
||||
- (NSString *)version;
|
||||
|
||||
/*!
|
||||
@method
|
||||
@abstract Returns the bundle's version, suitable for display to the user.
|
||||
@discussion If the CFBundleShortVersionString is available and different from the CFBundleVersion, this looks like CFBundleShortVersionString (CFBundleVersion). If the version strings are the same or CFBundleShortVersionString is not defined, this is equivalent to -version.
|
||||
*/
|
||||
- (NSString *)displayVersion;
|
||||
|
||||
/*!
|
||||
@method
|
||||
@abstract Returns a suitable icon for this bundle.
|
||||
@discussion Uses the CFBundleIconFile icon if defined; otherwise, uses the default application icon.
|
||||
*/
|
||||
- (NSImage *)icon;
|
||||
|
||||
/*!
|
||||
@method
|
||||
@abstract Returns whether the application is running from a disk image.
|
||||
*/
|
||||
- (BOOL)isRunningFromDiskImage;
|
||||
|
||||
/*!
|
||||
@method
|
||||
@abstract Returns a profile of the users system useful for statistical purposes.
|
||||
@discussion Returns an array of dictionaries; each dictionary represents a piece of data and has keys "key", "visibleKey", "value", and "visibleValue".
|
||||
*/
|
||||
- (NSArray *)systemProfile;
|
||||
|
||||
- (NSString *)publicDSAKey;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,89 +0,0 @@
|
||||
//
|
||||
// NSBundle+SUAdditions.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 12/21/07.
|
||||
// Copyright 2007 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "NSBundle+SUAdditions.h"
|
||||
|
||||
#ifndef NSAppKitVersionNumber10_4
|
||||
#define NSAppKitVersionNumber10_4 824
|
||||
#endif
|
||||
|
||||
@implementation NSBundle (SUAdditions)
|
||||
|
||||
- (NSString *)name
|
||||
{
|
||||
NSString *name = [self objectForInfoDictionaryKey:@"CFBundleDisplayName"];
|
||||
if (name) return name;
|
||||
|
||||
name = [self objectForInfoDictionaryKey:@"CFBundleName"];
|
||||
if (name) return name;
|
||||
|
||||
return [[[NSFileManager defaultManager] displayNameAtPath:[self bundlePath]] stringByDeletingPathExtension];
|
||||
}
|
||||
|
||||
- (NSString *)version
|
||||
{
|
||||
return [self objectForInfoDictionaryKey:@"CFBundleVersion"];
|
||||
}
|
||||
|
||||
- (NSString *)displayVersion
|
||||
{
|
||||
NSString *shortVersionString = [self objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
|
||||
if (shortVersionString)
|
||||
return shortVersionString;
|
||||
else
|
||||
return [self version]; // Fall back on the normal version string.
|
||||
}
|
||||
|
||||
- (NSImage *)icon
|
||||
{
|
||||
// Cache the application icon.
|
||||
NSString *iconPath = [self pathForResource:[self objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType:@"icns"];
|
||||
// According to the OS X docs, "CFBundleIconFile - This key identifies the file containing
|
||||
// the icon for the bundle. The filename you specify does not need to include the .icns
|
||||
// extension, although it may."
|
||||
//
|
||||
// However, if it *does* include the '.icns' the above method fails (tested on OS X 10.3.9) so we'll also try:
|
||||
if (!iconPath)
|
||||
iconPath = [self pathForResource:[self objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType: nil];
|
||||
NSImage *icon = [[[NSImage alloc] initWithContentsOfFile:iconPath] autorelease];
|
||||
// Use a default icon if none is defined.
|
||||
if (!icon) { [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericApplicationIcon)]; }
|
||||
return icon;
|
||||
}
|
||||
|
||||
- (BOOL)isRunningFromDiskImage
|
||||
{
|
||||
// This check causes crashes on 10.3; for now, we'll just skip it.
|
||||
if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_4)
|
||||
return NO;
|
||||
|
||||
NSDictionary *pathProperties = [[NSWorkspace sharedWorkspace] propertiesForPath:[self bundlePath]];
|
||||
BOOL isDiskImage = [pathProperties objectForKey:NSWorkspace_RBimagefilepath] != nil;
|
||||
BOOL isFileVault = [[pathProperties objectForKey:NSWorkspace_RBmntonname] hasPrefix:@"/Users/"];
|
||||
return isDiskImage && !isFileVault;
|
||||
}
|
||||
|
||||
- (NSString *)publicDSAKey
|
||||
{
|
||||
// Maybe the key is just a string in the Info.plist.
|
||||
NSString *key = [self objectForInfoDictionaryKey:SUPublicDSAKeyKey];
|
||||
if (key) { return key; }
|
||||
|
||||
// More likely, we've got a reference to a Resources file by filename:
|
||||
NSString *keyFilename = [self objectForInfoDictionaryKey:SUPublicDSAKeyFileKey];
|
||||
if (!keyFilename) { return nil; }
|
||||
return [NSString stringWithContentsOfFile:[self pathForResource:keyFilename ofType:nil]];
|
||||
}
|
||||
|
||||
- (NSArray *)systemProfile
|
||||
{
|
||||
return [[SUSystemProfiler sharedSystemProfiler] systemProfileArrayForHostBundle:self];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// NSFileManager+Aliases.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 2/4/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NSFILEMANAGER_PLUS_ALIASES_H
|
||||
#define NSFILEMANAGER_PLUS_ALIASES_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSFileManager (SUAliases)
|
||||
- (BOOL)isAliasFolderAtPath:(NSString *)path;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,33 +0,0 @@
|
||||
//
|
||||
// NSFileManager+Aliases.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 2/4/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSFileManager+Aliases.h"
|
||||
|
||||
|
||||
@implementation NSFileManager (SUAliases)
|
||||
|
||||
- (BOOL)isAliasFolderAtPath:(NSString *)path
|
||||
{
|
||||
FSRef fileRef;
|
||||
OSStatus err = noErr;
|
||||
Boolean aliasFileFlag, folderFlag;
|
||||
NSURL *fileURL = [NSURL fileURLWithPath:path];
|
||||
|
||||
if (FALSE == CFURLGetFSRef((CFURLRef)fileURL, &fileRef))
|
||||
err = coreFoundationUnknownErr;
|
||||
|
||||
if (noErr == err)
|
||||
err = FSIsAliasFile(&fileRef, &aliasFileFlag, &folderFlag);
|
||||
|
||||
if (noErr == err)
|
||||
return (BOOL)(aliasFileFlag && folderFlag);
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// NSFileManager+Authentication.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/9/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NSFILEMANAGER_PLUS_AUTHENTICATION_H
|
||||
#define NSFILEMANAGER_PLUS_AUTHENTICATION_H
|
||||
|
||||
@interface NSFileManager (SUAuthenticationAdditions)
|
||||
- (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// NSFileManager+ExtendedAttributes.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mark Mentovai on 2008-01-22.
|
||||
// Copyright 2008 Mark Mentovai. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
|
||||
#define NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSFileManager (MMExtendedAttributes)
|
||||
|
||||
// Wraps the removexattr system call, allowing an AppKit-style NSString* to
|
||||
// be used for the pathname argument. Note that the order of the arguments
|
||||
// has changed from what removexattr accepts, so that code reads more
|
||||
// naturally.
|
||||
//
|
||||
// removexattr is only available on Mac OS X 10.4 ("Tiger") and later. If
|
||||
// built with an SDK that includes removexattr, this method will link against
|
||||
// removexattr directly. When using earlier SDKs, this method will dynamically
|
||||
// look up the removexattr symbol at runtime. If the symbol is not present,
|
||||
// as will be the case when running on 10.3, this method returns -1 and sets
|
||||
// errno to ENOSYS.
|
||||
- (int)removeXAttr:(const char*)name
|
||||
fromFile:(NSString*)file
|
||||
options:(int)options;
|
||||
|
||||
// Removes the directory tree rooted at |root| from the file quarantine.
|
||||
// The quarantine was introduced on Mac OS X 10.5 and is described at:
|
||||
//
|
||||
// http://developer.apple.com/releasenotes/Carbon/RN-LaunchServices/index.html
|
||||
//#apple_ref/doc/uid/TP40001369-DontLinkElementID_2
|
||||
//
|
||||
// If |root| is not a directory, then it alone is removed from the quarantine.
|
||||
// Symbolic links, including |root| if it is a symbolic link, will not be
|
||||
// traversed.
|
||||
//
|
||||
// Ordinarily, the quarantine is managed by calling LSSetItemAttribute
|
||||
// to set the kLSItemQuarantineProperties attribute to a dictionary specifying
|
||||
// the quarantine properties to be applied. However, it does not appear to be
|
||||
// possible to remove an item from the quarantine directly through any public
|
||||
// Launch Services calls. Instead, this method takes advantage of the fact
|
||||
// that the quarantine is implemented in part by setting an extended attribute,
|
||||
// "com.apple.quarantine", on affected files. Removing this attribute is
|
||||
// sufficient to remove files from the quarantine.
|
||||
- (void)releaseFromQuarantine:(NSString*)root;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,98 +0,0 @@
|
||||
//
|
||||
// NSFileManager+ExtendedAttributes.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mark Mentovai on 2008-01-22.
|
||||
// Copyright 2008 Mark Mentovai. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSFileManager+ExtendedAttributes.h"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
|
||||
// Extended attribute support was introduced in Mac OS X 10.4 ("Tiger").
|
||||
// If building with an earlier SDK, provide definitions needed to handle
|
||||
// extended attributes at runtime.
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 // SDK >= 10.4
|
||||
#include <sys/xattr.h>
|
||||
#else // SDK >= 10.4
|
||||
#define XATTR_NOFOLLOW 1
|
||||
#endif // SDK >= 10.4
|
||||
|
||||
@implementation NSFileManager (MMExtendedAttributes)
|
||||
|
||||
- (int)removeXAttr:(const char*)name
|
||||
fromFile:(NSString*)file
|
||||
options:(int)options
|
||||
{
|
||||
typedef int (*removexattr_type)(const char*, const char*, int);
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 // SDK >= 10.4
|
||||
// Reference removexattr directly, it's in the SDK.
|
||||
static removexattr_type removexattr_func = removexattr;
|
||||
#else // SDK >= 10.4
|
||||
// removexattr isn't in this SDK, look it up at runtime.
|
||||
static removexattr_type removexattr_func = NULL;
|
||||
static BOOL didSymbolLookup = NO;
|
||||
if (!didSymbolLookup) {
|
||||
didSymbolLookup = YES;
|
||||
removexattr_func = dlsym(RTLD_NEXT, "removexattr");
|
||||
}
|
||||
#endif // SDK >= 10.4
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4 // DT < 10.4
|
||||
// Make sure that the symbol is present. This checks the deployment
|
||||
// target instead of the SDK so that it's able to catch dlsym failures
|
||||
// as well as the null symbol that would result from building with the
|
||||
// 10.4 SDK and a lower deployment target, and running on 10.3.
|
||||
if (!removexattr_func) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
#endif // DT < 10.4
|
||||
|
||||
const char* path = NULL;
|
||||
@try {
|
||||
path = [file fileSystemRepresentation];
|
||||
}
|
||||
@catch (id exception) {
|
||||
// -[NSString fileSystemRepresentation] throws an exception if it's
|
||||
// unable to convert the string to something suitable. Map that to
|
||||
// EDOM, "argument out of domain", which sort of conveys that there
|
||||
// was a conversion failure.
|
||||
errno = EDOM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return removexattr_func(path, name, options);
|
||||
}
|
||||
|
||||
- (void)releaseFromQuarantine:(NSString*)root
|
||||
{
|
||||
const char* quarantineAttribute = "com.apple.quarantine";
|
||||
const int removeXAttrOptions = XATTR_NOFOLLOW;
|
||||
|
||||
[self removeXAttr:quarantineAttribute
|
||||
fromFile:root
|
||||
options:removeXAttrOptions];
|
||||
|
||||
// Only recurse if it's actually a directory. Don't recurse into a
|
||||
// root-level symbolic link.
|
||||
NSDictionary* rootAttributes =
|
||||
[self fileAttributesAtPath:root traverseLink:NO];
|
||||
NSString* rootType = [rootAttributes objectForKey:NSFileType];
|
||||
|
||||
if (rootType == NSFileTypeDirectory) {
|
||||
// The NSDirectoryEnumerator will avoid recursing into any contained
|
||||
// symbolic links, so no further type checks are needed.
|
||||
NSDirectoryEnumerator* directoryEnumerator = [self enumeratorAtPath:root];
|
||||
NSString* file = nil;
|
||||
while ((file = [directoryEnumerator nextObject])) {
|
||||
[self removeXAttr:quarantineAttribute
|
||||
fromFile:[root stringByAppendingPathComponent:file]
|
||||
options:removeXAttrOptions];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// NSNumber+Units.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Jonas Witt on 5/18/08.
|
||||
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface NSNumber (JWUnits)
|
||||
|
||||
+ (NSString *)humanReadableSizeFromDouble:(double)value;
|
||||
|
||||
@end
|
||||
@@ -1,28 +0,0 @@
|
||||
//
|
||||
// NSNumber+Units.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Jonas Witt on 5/18/08.
|
||||
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSNumber+Units.h"
|
||||
#import "Sparkle.h"
|
||||
|
||||
@implementation NSNumber (JWUnits)
|
||||
|
||||
+ (NSString *)humanReadableSizeFromDouble:(double)value
|
||||
{
|
||||
if (value < 1024)
|
||||
return [NSString stringWithFormat:@"%.0lf %@", value, SULocalizedString(@"B", @"the unit for bytes")];
|
||||
|
||||
if (value < 1024 * 1024)
|
||||
return [NSString stringWithFormat:@"%.0lf %@", value / 1024.0, SULocalizedString(@"KB", @"the unit for kilobytes")];
|
||||
|
||||
if (value < 1024 * 1024 * 1024)
|
||||
return [NSString stringWithFormat:@"%.1lf %@", value / 1024.0 / 1024.0, SULocalizedString(@"MB", @"the unit for megabytes")];
|
||||
|
||||
return [NSString stringWithFormat:@"%.2lf %@", value / 1024.0 / 1024.0 / 1024.0, SULocalizedString(@"GB", @"the unit for gigabytes")];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
|
||||
BSD License
|
||||
|
||||
Copyright (c) 2002, Brent Simmons
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* Neither the name of ranchero.com or Brent Simmons nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER 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.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef NSSTRING_PLUS_EXTRAS_H
|
||||
#define NSSTRING_PLUS_EXTRAS_H
|
||||
|
||||
|
||||
/*
|
||||
NSString+extras.h
|
||||
NetNewsWire
|
||||
|
||||
Created by Brent Simmons on Fri Jun 14 2002.
|
||||
Copyright (c) 2002 Brent Simmons. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
#import "SUConstants.h" // for NSInteger
|
||||
|
||||
@interface NSString (BSextras)
|
||||
|
||||
- (NSString *)stringWithSubstitute:(NSString *)subs forCharactersFromSet:(NSCharacterSet *)set;
|
||||
|
||||
- (NSString *) trimWhiteSpace;
|
||||
|
||||
- (NSString *) stripHTML;
|
||||
|
||||
- (NSString *) ellipsizeAfterNWords: (NSInteger) n;
|
||||
|
||||
+ (BOOL) stringIsEmpty: (NSString *) s;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
|
||||
BSD License
|
||||
|
||||
Copyright (c) 2002, Brent Simmons
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* Neither the name of ranchero.com or Brent Simmons nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER 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.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
NSString+extras.m
|
||||
NetNewsWire
|
||||
|
||||
Created by Brent Simmons on Fri Jun 14 2002.
|
||||
Copyright (c) 2002 Brent Simmons. All rights reserved.
|
||||
*/
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "NSString+extras.h"
|
||||
|
||||
|
||||
@implementation NSString (BSextras)
|
||||
|
||||
- (NSString *)stringWithSubstitute:(NSString *)subs forCharactersFromSet:(NSCharacterSet *)set
|
||||
{
|
||||
NSRange r = [self rangeOfCharacterFromSet:set];
|
||||
if (r.location == NSNotFound) return self;
|
||||
NSMutableString *newString = [self mutableCopy];
|
||||
do
|
||||
{
|
||||
[newString replaceCharactersInRange:r withString:subs];
|
||||
r = [newString rangeOfCharacterFromSet:set];
|
||||
}
|
||||
while (r.location != NSNotFound);
|
||||
return [newString autorelease];
|
||||
}
|
||||
|
||||
- (NSString *) trimWhiteSpace {
|
||||
|
||||
NSMutableString *s = [[self mutableCopy] autorelease];
|
||||
|
||||
CFStringTrimWhitespace ((CFMutableStringRef) s);
|
||||
|
||||
return (NSString *) [[s copy] autorelease];
|
||||
} /*trimWhiteSpace*/
|
||||
|
||||
|
||||
- (NSString *) ellipsizeAfterNWords: (NSInteger) n {
|
||||
|
||||
NSArray *stringComponents = [self componentsSeparatedByString: @" "];
|
||||
NSMutableArray *componentsCopy = [stringComponents mutableCopy];
|
||||
NSInteger ix = n;
|
||||
NSInteger len = [componentsCopy count];
|
||||
|
||||
if (len < n)
|
||||
ix = len;
|
||||
|
||||
[componentsCopy removeObjectsInRange: NSMakeRange (ix, len - ix)];
|
||||
|
||||
return [componentsCopy componentsJoinedByString: @" "];
|
||||
} /*ellipsizeAfterNWords*/
|
||||
|
||||
|
||||
- (NSString *) stripHTML {
|
||||
|
||||
NSUInteger len = [self length];
|
||||
NSMutableString *s = [NSMutableString stringWithCapacity: len];
|
||||
NSUInteger i = 0, level = 0;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
|
||||
NSString *ch = [self substringWithRange: NSMakeRange (i, 1)];
|
||||
|
||||
if ([ch isEqualTo: @"<"])
|
||||
level++;
|
||||
|
||||
else if ([ch isEqualTo: @">"]) {
|
||||
|
||||
level--;
|
||||
|
||||
if (level == 0)
|
||||
[s appendString: @" "];
|
||||
} /*else if*/
|
||||
|
||||
else if (level == 0)
|
||||
[s appendString: ch];
|
||||
} /*for*/
|
||||
|
||||
return (NSString *) [[s copy] autorelease];
|
||||
} /*stripHTML*/
|
||||
|
||||
|
||||
+ (BOOL) stringIsEmpty: (NSString *) s {
|
||||
|
||||
NSString *copy;
|
||||
|
||||
if (s == nil)
|
||||
return (YES);
|
||||
|
||||
if ([s isEqualTo: @""])
|
||||
return (YES);
|
||||
|
||||
copy = [[s copy] autorelease];
|
||||
|
||||
if ([[copy trimWhiteSpace] isEqualTo: @""])
|
||||
return (YES);
|
||||
|
||||
return (NO);
|
||||
} /*stringIsEmpty*/
|
||||
|
||||
@end
|
||||
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// NSURL+Parameters.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 5/6/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NSURL_PLUS_PARAMETERS_H
|
||||
#define NSURL_PLUS_PARAMETERS_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSURL (SUParameterAdditions)
|
||||
- (NSURL *)URLWithParameters:(NSArray *)parameters;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// NSURL+Parameters.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 5/6/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSURL+Parameters.h"
|
||||
|
||||
@implementation NSURL (SUParameterAdditions)
|
||||
- (NSURL *)URLWithParameters:(NSArray *)parameters;
|
||||
{
|
||||
if (parameters == nil || [parameters count] == 0) { return self; }
|
||||
NSMutableArray *profileInfo = [NSMutableArray array];
|
||||
NSEnumerator *profileInfoEnumerator = [parameters objectEnumerator];
|
||||
NSDictionary *currentProfileInfo;
|
||||
while ((currentProfileInfo = [profileInfoEnumerator nextObject])) {
|
||||
[profileInfo addObject:[NSString stringWithFormat:@"%@=%@", [currentProfileInfo objectForKey:@"key"], [currentProfileInfo objectForKey:@"value"]]];
|
||||
}
|
||||
|
||||
NSString *appcastStringWithProfile = [NSString stringWithFormat:@"%@?%@", [self absoluteString], [profileInfo componentsJoinedByString:@"&"]];
|
||||
|
||||
// Clean it up so it's a valid URL
|
||||
return [NSURL URLWithString:[appcastStringWithProfile stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
@end
|
||||
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// NSWorkspace+SystemVersion.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 5/7/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NSWORKSPACE_PLUS_SYSTEMVERSION_H
|
||||
#define NSWORKSPACE_PLUS_SYSTEMVERSION_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSWorkspace (SUSystemVersion)
|
||||
+ (NSString *)systemVersionString;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,36 +0,0 @@
|
||||
//
|
||||
// NSWorkspace+SystemVersion.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 5/7/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSWorkspace+SystemVersion.h"
|
||||
|
||||
|
||||
@implementation NSWorkspace (SUSystemVersion)
|
||||
+ (NSString *)systemVersionString
|
||||
{
|
||||
// This returns a version string of the form X.Y.Z
|
||||
// There may be a better way to deal with the problem that gestaltSystemVersionMajor
|
||||
// et al. are not defined in 10.3, but this is probably good enough.
|
||||
NSString* verStr = nil;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
SInt32 major, minor, bugfix;
|
||||
OSErr err1 = Gestalt(gestaltSystemVersionMajor, &major);
|
||||
OSErr err2 = Gestalt(gestaltSystemVersionMinor, &minor);
|
||||
OSErr err3 = Gestalt(gestaltSystemVersionBugFix, &bugfix);
|
||||
if (!err1 && !err2 && !err3)
|
||||
{
|
||||
verStr = [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix];
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
NSString *versionPlistPath = @"/System/Library/CoreServices/SystemVersion.plist";
|
||||
verStr = [[[NSDictionary dictionaryWithContentsOfFile:versionPlistPath] objectForKey:@"ProductVersion"] retain];
|
||||
}
|
||||
return verStr;
|
||||
}
|
||||
@end
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// NSWorkspace_RBAdditions.h
|
||||
// PathProps
|
||||
//
|
||||
// Created by Rainer Brockerhoff on 10/04/2007.
|
||||
// Copyright 2007 Rainer Brockerhoff. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NSWORKSPACE_RBADDITIONS_H
|
||||
#define NSWORKSPACE_RBADDITIONS_H
|
||||
|
||||
|
||||
extern NSString* NSWorkspace_RBfstypename;
|
||||
extern NSString* NSWorkspace_RBmntonname;
|
||||
extern NSString* NSWorkspace_RBmntfromname;
|
||||
extern NSString* NSWorkspace_RBdeviceinfo;
|
||||
extern NSString* NSWorkspace_RBimagefilepath;
|
||||
extern NSString* NSWorkspace_RBconnectiontype;
|
||||
extern NSString* NSWorkspace_RBpartitionscheme;
|
||||
extern NSString* NSWorkspace_RBserverURL;
|
||||
|
||||
@interface NSWorkspace (NSWorkspace_RBAdditions)
|
||||
|
||||
// This method will return nil if the input path is invalid. Otherwise, the returned NSDictionary may contain
|
||||
// the following keys:
|
||||
//- NSWorkspace_RBfstypename: will always be present.Shows the filesystem type (usually "hfs"), from statfs.
|
||||
//- NSWorkspace_RBmntonname: will always be present. Shows the volume mount point.
|
||||
//- NSWorkspace_RBmntfromname: will always be present. Shows the BSD device path for local volumes; info for
|
||||
// remote volumes depends on the filesystem type.
|
||||
//- NSWorkspace_RBconnectiontype: should always be present for local volumes. Shows the connection type ("SATA", "USB", etc.).
|
||||
//- NSWorkspace_RBpartitionscheme: should always be present for local volumes. Shows the partition scheme.
|
||||
//- NSWorkspace_RBdeviceinfo: should always be present for local volumes. Shows some information about the
|
||||
// physical device; varies widely.
|
||||
//- NSWorkspace_RBimagefilepath: should be present for disk images only. Shows the path of the disk image file.
|
||||
//- NSWorkspace_RBserverURL: should be present for remote volumes only. Shows the server URL.
|
||||
|
||||
- (NSDictionary*)propertiesForPath:(NSString*)path;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,177 +0,0 @@
|
||||
//
|
||||
// NSWorkspace_RBAdditions.m
|
||||
// PathProps
|
||||
//
|
||||
// Created by Rainer Brockerhoff on 10/04/2007.
|
||||
// Copyright 2007 Rainer Brockerhoff. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "NSWorkspace_RBAdditions.h"
|
||||
|
||||
#include <IOKit/IOKitLib.h>
|
||||
#include <sys/mount.h>
|
||||
#include <mach/mach.h>
|
||||
|
||||
NSString* NSWorkspace_RBfstypename = @"NSWorkspace_RBfstypename";
|
||||
NSString* NSWorkspace_RBmntonname = @"NSWorkspace_RBmntonname";
|
||||
NSString* NSWorkspace_RBmntfromname = @"NSWorkspace_RBmntfromname";
|
||||
NSString* NSWorkspace_RBdeviceinfo = @"NSWorkspace_RBdeviceinfo";
|
||||
NSString* NSWorkspace_RBimagefilepath = @"NSWorkspace_RBimagefilepath";
|
||||
NSString* NSWorkspace_RBconnectiontype = @"NSWorkspace_RBconnectiontype";
|
||||
NSString* NSWorkspace_RBpartitionscheme = @"NSWorkspace_RBpartitionscheme";
|
||||
NSString* NSWorkspace_RBserverURL = @"NSWorkspace_RBserverURL";
|
||||
|
||||
// This static funtion concatenates two strings, but first checks several possibilities...
|
||||
// like one or the other nil, or one containing the other already.
|
||||
|
||||
static NSString* AddPart(NSString* first,NSString* second) {
|
||||
if (!second) {
|
||||
return first;
|
||||
}
|
||||
second = [second stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
if (first) {
|
||||
if ([first rangeOfString:second options:NSCaseInsensitiveSearch].location==NSNotFound) {
|
||||
if ([second rangeOfString:first options:NSCaseInsensitiveSearch].location==NSNotFound) {
|
||||
return [NSString stringWithFormat:@"%@; %@",first,second];
|
||||
}
|
||||
return second;
|
||||
}
|
||||
return first;
|
||||
}
|
||||
return second;
|
||||
}
|
||||
|
||||
// This static functions recurses "upwards" over the IO registry. Returns strings that are concatenated
|
||||
// and ultimately end up under the NSWorkspace_RBdeviceinfo key.
|
||||
// This isn't too robust in that it assumes that objects returned by the objectForKey methods are
|
||||
// either strings or dictionaries. A "standard" implementations would use either only CoreFoundation and
|
||||
// IOKit calls for this, or do more robust type checking on the returned objects.
|
||||
//
|
||||
// Also notice that this works as determined experimentally in 10.4.9, there's no official docs I could find.
|
||||
// YMMV, and it may stop working in any new version of Mac OS X.
|
||||
|
||||
static NSString* CheckParents(io_object_t thing,NSString* part,NSMutableDictionary* dict) {
|
||||
NSString* result = part;
|
||||
io_iterator_t parentsIterator = 0;
|
||||
kern_return_t kernResult = IORegistryEntryGetParentIterator(thing,kIOServicePlane,&parentsIterator);
|
||||
if ((kernResult==KERN_SUCCESS)&&parentsIterator) {
|
||||
io_object_t nextParent = 0;
|
||||
while ((nextParent = IOIteratorNext(parentsIterator))) {
|
||||
NSDictionary* props = nil;
|
||||
NSString* image = nil;
|
||||
NSString* partition = nil;
|
||||
NSString* connection = nil;
|
||||
kernResult = IORegistryEntryCreateCFProperties(nextParent,(CFMutableDictionaryRef*)&props,kCFAllocatorDefault,0);
|
||||
if (IOObjectConformsTo(nextParent,"IOApplePartitionScheme")) {
|
||||
partition = [props objectForKey:@"Content Mask"];
|
||||
} else if (IOObjectConformsTo(nextParent,"IOMedia")) {
|
||||
partition = [props objectForKey:@"Content"];
|
||||
} else if (IOObjectConformsTo(nextParent,"IODiskImageBlockStorageDeviceOutKernel")) {
|
||||
NSData* data = nil;
|
||||
if ((data = [[props objectForKey:@"Protocol Characteristics"] objectForKey:@"Virtual Interface Location Path"])) {
|
||||
image = [[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding] autorelease];
|
||||
}
|
||||
} else if (IOObjectConformsTo(nextParent,"IOHDIXHDDriveInKernel")) {
|
||||
image = [props objectForKey:@"KDIURLPath"];
|
||||
}
|
||||
NSDictionary* subdict;
|
||||
if ((subdict = [props objectForKey:@"Protocol Characteristics"])) {
|
||||
connection = [subdict objectForKey:@"Physical Interconnect"];
|
||||
} else {
|
||||
connection = [props objectForKey:@"Physical Interconnect"];
|
||||
}
|
||||
if (connection) {
|
||||
[dict setObject:AddPart([dict objectForKey:NSWorkspace_RBconnectiontype],connection) forKey:NSWorkspace_RBconnectiontype];
|
||||
}
|
||||
if (partition) {
|
||||
[dict setObject:partition forKey:NSWorkspace_RBpartitionscheme];
|
||||
}
|
||||
if (image) {
|
||||
[dict setObject:image forKey:NSWorkspace_RBimagefilepath];
|
||||
}
|
||||
NSString* value;
|
||||
if ((subdict = [props objectForKey:@"Device Characteristics"])) {
|
||||
if ((value = [subdict objectForKey:@"Product Name"])) {
|
||||
result = AddPart(result,value);
|
||||
}
|
||||
if ((value = [subdict objectForKey:@"Product Revision Level"])) {
|
||||
result = AddPart(result,value);
|
||||
}
|
||||
if ((value = [subdict objectForKey:@"Vendor Name"])) {
|
||||
result = AddPart(result,value);
|
||||
}
|
||||
}
|
||||
if ((value = [props objectForKey:@"USB Serial Number"])) {
|
||||
result = AddPart(result,value);
|
||||
}
|
||||
if ((value = [props objectForKey:@"USB Vendor Name"])) {
|
||||
result = AddPart(result,value);
|
||||
}
|
||||
io_name_t ts; // char[128]
|
||||
NSString* cls = ( IOObjectGetClass (nextParent, ts) == KERN_SUCCESS ) ? [NSString stringWithUTF8String:ts ] : nil;
|
||||
if (![cls isEqualToString:@"IOPCIDevice"]) {
|
||||
|
||||
// Uncomment the following line to have the device tree dumped to the console.
|
||||
// NSLog(@"=================================> %@:%@\n",cls,props);
|
||||
|
||||
result = CheckParents(nextParent,result,dict);
|
||||
}
|
||||
if (props) { CFRelease(props); }
|
||||
IOObjectRelease(nextParent);
|
||||
}
|
||||
}
|
||||
if (parentsIterator) {
|
||||
IOObjectRelease(parentsIterator);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@implementation NSWorkspace (NSWorkspace_RBAdditions)
|
||||
|
||||
// Returns a NSDictionary with properties for the path. See details in the .h file.
|
||||
// This assumes that the length of path is less than PATH_MAX (currently 1024 characters).
|
||||
|
||||
- (NSDictionary*)propertiesForPath:(NSString*)path {
|
||||
const char* ccpath = [path fileSystemRepresentation];
|
||||
NSMutableDictionary* result = nil;
|
||||
struct statfs fs = {};
|
||||
if (!statfs(ccpath,&fs)) {
|
||||
NSString* from = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:fs.f_mntfromname length:strlen(fs.f_mntfromname)];
|
||||
result = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSString stringWithUTF8String:fs.f_fstypename], NSWorkspace_RBfstypename, [[NSFileManager defaultManager] stringWithFileSystemRepresentation:fs.f_mntonname length:strlen(fs.f_mntonname)], NSWorkspace_RBmntonname, nil];
|
||||
const char* devstring = "/dev/";
|
||||
size_t devstringlen = 5;
|
||||
if (strncmp(fs.f_mntfromname,devstring,devstringlen)==0) {
|
||||
// For a local volume,get the IO registry tree and search it for further info.
|
||||
mach_port_t masterPort = 0;
|
||||
io_iterator_t mediaIterator = 0;
|
||||
kern_return_t kernResult = IOMasterPort(bootstrap_port,&masterPort);
|
||||
if (kernResult==KERN_SUCCESS) {
|
||||
CFMutableDictionaryRef classesToMatch = IOBSDNameMatching(masterPort,0,&fs.f_mntfromname[devstringlen]);
|
||||
if (classesToMatch) {
|
||||
kernResult = IOServiceGetMatchingServices(masterPort,classesToMatch,&mediaIterator);
|
||||
if ((kernResult==KERN_SUCCESS)&&mediaIterator) {
|
||||
io_object_t firstMedia = 0;
|
||||
while ((firstMedia = IOIteratorNext(mediaIterator))) {
|
||||
NSString* stuff = CheckParents(firstMedia,nil,result);
|
||||
if (stuff) {
|
||||
[result setObject:stuff forKey:NSWorkspace_RBdeviceinfo];
|
||||
}
|
||||
IOObjectRelease(firstMedia);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mediaIterator) {
|
||||
IOObjectRelease(mediaIterator);
|
||||
}
|
||||
if (masterPort) {
|
||||
mach_port_deallocate(mach_task_self(),masterPort);
|
||||
}
|
||||
}
|
||||
[result setObject:from forKey:NSWorkspace_RBmntfromname];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
|
||||
BSD License
|
||||
|
||||
Copyright (c) 2002, Brent Simmons
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* Neither the name of ranchero.com or Brent Simmons nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER 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.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef RSS_H
|
||||
#define RSS_H
|
||||
|
||||
|
||||
/*
|
||||
RSS.h
|
||||
A class for reading RSS feeds.
|
||||
|
||||
Created by Brent Simmons on Wed Apr 17 2002.
|
||||
Copyright (c) 2002 Brent Simmons. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
#import "NSString+extras.h"
|
||||
|
||||
|
||||
@interface RSS : NSObject {
|
||||
NSMutableData *incrementalData;
|
||||
id delegate;
|
||||
|
||||
NSDictionary *headerItems;
|
||||
NSMutableArray *newsItems;
|
||||
NSString *version;
|
||||
|
||||
BOOL flRdf;
|
||||
BOOL normalize;
|
||||
}
|
||||
|
||||
- (RSS *)initWithURL:(NSURL *) url userAgent:(NSString*)userAgent delegate:delegate;
|
||||
- (BOOL)loadData:(NSData *)rssData normalize:(BOOL)fl;
|
||||
|
||||
- (NSMutableArray *)newsItems;
|
||||
- (NSDictionary *)newestItem;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (RSSDelegateProtocol)
|
||||
- (void)feedDidFinishLoading:(RSS *)feed;
|
||||
- (void)feed:(RSS *)feed didFailWithError:(NSError *)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,727 +0,0 @@
|
||||
/*
|
||||
|
||||
BSD License
|
||||
|
||||
Copyright (c) 2002, Brent Simmons
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* Neither the name of ranchero.com or Brent Simmons nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER 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.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
RSS.m
|
||||
A class for reading RSS feeds.
|
||||
|
||||
Created by Brent Simmons on Wed Apr 17 2002.
|
||||
Copyright (c) 2002 Brent Simmons. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "RSS.h"
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
|
||||
@interface NSError (TigerPlusMethods)
|
||||
- (NSString *)localizedFailureReason;
|
||||
@end
|
||||
#endif
|
||||
|
||||
@interface RSS (Private)
|
||||
- (void) createheaderdictionary: (CFXMLTreeRef) tree;
|
||||
- (void) createitemsarray: (CFXMLTreeRef) tree;
|
||||
- (void) setversionstring: (CFXMLTreeRef) tree;
|
||||
- (void) flattenimagechildren: (CFXMLTreeRef) tree into: (NSMutableDictionary *) dictionary;
|
||||
- (void) flattensourceattributes: (CFXMLNodeRef) node into: (NSMutableDictionary *) dictionary;
|
||||
- (CFXMLTreeRef) getchanneltree: (CFXMLTreeRef) tree;
|
||||
- (CFXMLTreeRef) getnamedtree: (CFXMLTreeRef) currentTree name: (NSString *) name;
|
||||
- (void) normalizeRSSItem: (NSMutableDictionary *) rssItem;
|
||||
- (NSString *) getelementvalue: (CFXMLTreeRef) tree;
|
||||
@end
|
||||
|
||||
// This comparator function is used to sort the RSS items by their published date.
|
||||
NSComparisonResult compareNewsItems(id item1, id item2, void *context)
|
||||
{
|
||||
// We compare item2 with item1 instead of the other way 'round because we want descending, not ascending. Bit of a hack.
|
||||
return [(NSDate *)[NSDate dateWithNaturalLanguageString:[item2 objectForKey:@"pubDate"]] compare:(NSDate *)[NSDate dateWithNaturalLanguageString:[item1 objectForKey:@"pubDate"]]];
|
||||
}
|
||||
|
||||
@implementation RSS
|
||||
|
||||
|
||||
#define titleKey @"title"
|
||||
#define linkKey @"link"
|
||||
#define descriptionKey @"description"
|
||||
|
||||
|
||||
/*Public interface*/
|
||||
|
||||
- (NSDictionary *)newestItem
|
||||
{
|
||||
// The news items are already sorted by published date, descending.
|
||||
return [[self newsItems] objectAtIndex:0];
|
||||
}
|
||||
|
||||
- (RSS *) initWithTitle: (NSString *) title andDescription: (NSString *) description {
|
||||
|
||||
/*
|
||||
Create an empty feed. Useful for synthetic feeds.
|
||||
*/
|
||||
|
||||
NSMutableDictionary *header;
|
||||
|
||||
flRdf = NO;
|
||||
|
||||
header = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
|
||||
[header setObject: title forKey: titleKey];
|
||||
|
||||
[header setObject: description forKey: descriptionKey];
|
||||
|
||||
headerItems = (NSDictionary *) [header copy];
|
||||
|
||||
newsItems = [[NSMutableArray alloc] initWithCapacity: 0];
|
||||
|
||||
version = [[NSString alloc] initWithString: @"synthetic"];
|
||||
|
||||
return (self);
|
||||
} /*initWithTitle*/
|
||||
|
||||
|
||||
- (BOOL)loadData:(NSData *)rssData normalize:(BOOL)fl
|
||||
{
|
||||
CFXMLTreeRef tree;
|
||||
flRdf = NO;
|
||||
normalize = fl;
|
||||
|
||||
NS_DURING
|
||||
tree = CFXMLTreeCreateFromData (kCFAllocatorDefault, (CFDataRef) rssData,
|
||||
NULL, kCFXMLParserSkipWhitespace, kCFXMLNodeCurrentVersion);
|
||||
NS_HANDLER
|
||||
tree = nil;
|
||||
NS_ENDHANDLER
|
||||
|
||||
if (tree == nil)
|
||||
return NO;
|
||||
|
||||
[self createheaderdictionary: tree];
|
||||
[self createitemsarray: tree];
|
||||
[self setversionstring: tree];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (RSS *)initWithURL:(NSURL *)url userAgent:(NSString*)userAgent delegate:del
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
delegate = del;
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: url cachePolicy: NSURLRequestReloadIgnoringCacheData
|
||||
timeoutInterval: 30.0];
|
||||
if (userAgent)
|
||||
[request setValue: userAgent forHTTPHeaderField: @"User-Agent"];
|
||||
|
||||
incrementalData = [[NSMutableData data] retain];
|
||||
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];
|
||||
CFRetain(connection);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
|
||||
{
|
||||
[incrementalData appendData:data];
|
||||
}
|
||||
|
||||
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
|
||||
{
|
||||
CFRelease(connection);
|
||||
|
||||
NSError *error = nil;
|
||||
@try
|
||||
{
|
||||
if (![self loadData:incrementalData normalize:YES])
|
||||
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObject:SULocalizedString(@"An error occurred while parsing the update feed.", nil) forKey:NSLocalizedDescriptionKey]];
|
||||
}
|
||||
@catch (NSException *parseException)
|
||||
{
|
||||
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"An error occurred while parsing the update feed: %@", nil), [parseException reason]] forKey:NSLocalizedFailureReasonErrorKey]];
|
||||
}
|
||||
|
||||
if (error)
|
||||
[delegate feed:self didFailWithError:error];
|
||||
else
|
||||
[delegate feedDidFinishLoading:self];
|
||||
}
|
||||
|
||||
- (void)connection:(NSURLConnection*) connection didFailWithError:(NSError *)error
|
||||
{
|
||||
CFRelease(connection);
|
||||
[delegate feed:self didFailWithError:error];
|
||||
}
|
||||
|
||||
- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
|
||||
{
|
||||
return request;
|
||||
}
|
||||
|
||||
- (NSDictionary *) headerItems {
|
||||
|
||||
return (headerItems);
|
||||
} /*headerItems*/
|
||||
|
||||
|
||||
- (NSMutableArray *) newsItems {
|
||||
|
||||
return (newsItems);
|
||||
} /*newsItems*/
|
||||
|
||||
|
||||
- (NSString *) version {
|
||||
|
||||
return (version);
|
||||
} /*version*/
|
||||
|
||||
|
||||
- (void) dealloc {
|
||||
[incrementalData release];
|
||||
[headerItems release];
|
||||
|
||||
[newsItems release];
|
||||
|
||||
[version release];
|
||||
[super dealloc];
|
||||
} /*dealloc*/
|
||||
|
||||
|
||||
|
||||
/*Private methods. Don't call these: they may change.*/
|
||||
|
||||
|
||||
- (void) createheaderdictionary: (CFXMLTreeRef) tree {
|
||||
|
||||
CFXMLTreeRef channelTree, childTree;
|
||||
CFXMLNodeRef childNode;
|
||||
CFIndex childCount, i;
|
||||
NSString *childName;
|
||||
NSMutableDictionary *headerItemsMutable;
|
||||
|
||||
channelTree = [self getchanneltree: tree];
|
||||
|
||||
if (channelTree == nil) {
|
||||
|
||||
NSException *exception = [NSException exceptionWithName: @"RSSCreateHeaderDictionaryFailed"
|
||||
reason: @"Couldn't find the channel tree." userInfo: nil];
|
||||
|
||||
[exception raise];
|
||||
} /*if*/
|
||||
|
||||
childCount = CFTreeGetChildCount (channelTree);
|
||||
|
||||
headerItemsMutable = [NSMutableDictionary dictionaryWithCapacity: childCount];
|
||||
|
||||
for (i = 0; i < childCount; i++) {
|
||||
|
||||
childTree = CFTreeGetChildAtIndex (channelTree, i);
|
||||
|
||||
childNode = CFXMLTreeGetNode (childTree);
|
||||
|
||||
childName = (NSString *) CFXMLNodeGetString (childNode);
|
||||
|
||||
if ([childName hasPrefix: @"rss:"])
|
||||
childName = [childName substringFromIndex: 4];
|
||||
|
||||
if ([childName isEqualToString: @"item"])
|
||||
break;
|
||||
|
||||
if ([childName isEqualTo: @"image"])
|
||||
[self flattenimagechildren: childTree into: headerItemsMutable];
|
||||
|
||||
[headerItemsMutable setObject: [self getelementvalue: childTree] forKey: childName];
|
||||
} /*for*/
|
||||
|
||||
headerItems = [headerItemsMutable copy];
|
||||
} /*initheaderdictionary*/
|
||||
|
||||
|
||||
- (void) createitemsarray: (CFXMLTreeRef) tree {
|
||||
|
||||
CFXMLTreeRef channelTree, childTree, itemTree;
|
||||
CFXMLNodeRef childNode, itemNode;
|
||||
NSString *childName;
|
||||
NSString *itemName, *itemValue;
|
||||
CFIndex childCount, itemChildCount, i, j;
|
||||
NSMutableDictionary *itemDictionaryMutable;
|
||||
NSMutableArray *itemsArrayMutable;
|
||||
|
||||
if (flRdf)
|
||||
channelTree = [self getnamedtree: tree name: @"rdf:RDF"];
|
||||
else
|
||||
channelTree = [self getchanneltree: tree];
|
||||
|
||||
if (channelTree == nil) {
|
||||
|
||||
NSException *exception = [NSException exceptionWithName: @"RSSCreateItemsArrayFailed"
|
||||
reason: @"Couldn't find the news items." userInfo: nil];
|
||||
|
||||
[exception raise];
|
||||
} /*if*/
|
||||
|
||||
childCount = CFTreeGetChildCount (channelTree);
|
||||
|
||||
itemsArrayMutable = [NSMutableArray arrayWithCapacity: childCount];
|
||||
|
||||
for (i = 0; i < childCount; i++) {
|
||||
|
||||
childTree = CFTreeGetChildAtIndex (channelTree, i);
|
||||
|
||||
childNode = CFXMLTreeGetNode (childTree);
|
||||
|
||||
childName = (NSString *) CFXMLNodeGetString (childNode);
|
||||
|
||||
if ([childName hasPrefix: @"rss:"])
|
||||
childName = [childName substringFromIndex: 4];
|
||||
|
||||
if (![childName isEqualToString: @"item"])
|
||||
continue;
|
||||
|
||||
itemChildCount = CFTreeGetChildCount (childTree);
|
||||
|
||||
itemDictionaryMutable = [NSMutableDictionary dictionaryWithCapacity: itemChildCount];
|
||||
|
||||
for (j = 0; j < itemChildCount; j++) {
|
||||
|
||||
itemTree = CFTreeGetChildAtIndex (childTree, j);
|
||||
|
||||
itemNode = CFXMLTreeGetNode (itemTree);
|
||||
|
||||
itemName = (NSString *) CFXMLNodeGetString (itemNode);
|
||||
|
||||
if ([itemName hasPrefix: @"rss:"])
|
||||
itemName = [itemName substringFromIndex: 4];
|
||||
|
||||
if ([itemName isEqualTo:@"enclosure"])
|
||||
{
|
||||
// Hack to add attributes to the dictionary in addition to children. (AMM)
|
||||
const CFXMLElementInfo *websiteInfo = CFXMLNodeGetInfoPtr(itemNode);
|
||||
NSMutableDictionary *enclosureDictionary = [NSMutableDictionary dictionary];
|
||||
id keyEnumerator = [(NSDictionary *)websiteInfo->attributes keyEnumerator], current;
|
||||
while ((current = [keyEnumerator nextObject]))
|
||||
{
|
||||
NSString *escapedAttributeValue = [(NSDictionary *)websiteInfo->attributes objectForKey:current];
|
||||
CFStringRef attributeValue = CFXMLCreateStringByUnescapingEntities(kCFAllocatorDefault, (CFStringRef)escapedAttributeValue, NULL);
|
||||
if (attributeValue)
|
||||
{
|
||||
// Do a stringWithString dance rather than just casting so that it's GC safe without using the 10.4+ CFMakeCollectable.
|
||||
[enclosureDictionary setObject:[NSString stringWithString:(NSString *)attributeValue] forKey:current];
|
||||
CFRelease(attributeValue);
|
||||
}
|
||||
}
|
||||
[itemDictionaryMutable setObject: enclosureDictionary forKey: itemName];
|
||||
continue;
|
||||
}
|
||||
|
||||
itemValue = [self getelementvalue: itemTree];
|
||||
|
||||
if ([itemName isEqualTo: @"source"])
|
||||
[self flattensourceattributes: itemNode into: itemDictionaryMutable];
|
||||
|
||||
[itemDictionaryMutable setObject: itemValue forKey: itemName];
|
||||
} /*for*/
|
||||
|
||||
if (normalize)
|
||||
[self normalizeRSSItem: itemDictionaryMutable];
|
||||
|
||||
[itemsArrayMutable addObject: itemDictionaryMutable];
|
||||
} /*for*/
|
||||
|
||||
// Sort the news items by published date, descending.
|
||||
newsItems = [[itemsArrayMutable sortedArrayUsingFunction:compareNewsItems context:NULL] retain];
|
||||
} /*createitemsarray*/
|
||||
|
||||
|
||||
- (void) setversionstring: (CFXMLTreeRef) tree {
|
||||
|
||||
CFXMLTreeRef rssTree;
|
||||
const CFXMLElementInfo *elementInfo;
|
||||
CFXMLNodeRef node;
|
||||
|
||||
if (flRdf) {
|
||||
|
||||
version = [[NSString alloc] initWithString: @"rdf"];
|
||||
|
||||
return;
|
||||
} /*if*/
|
||||
|
||||
rssTree = [self getnamedtree: tree name: @"rss"];
|
||||
|
||||
node = CFXMLTreeGetNode (rssTree);
|
||||
|
||||
elementInfo = CFXMLNodeGetInfoPtr (node);
|
||||
|
||||
version = [[NSString alloc] initWithString: [(NSDictionary *) (*elementInfo).attributes objectForKey: @"version"]];
|
||||
} /*setversionstring*/
|
||||
|
||||
|
||||
- (void) flattenimagechildren: (CFXMLTreeRef) tree into: (NSMutableDictionary *) dictionary {
|
||||
|
||||
CFIndex childCount = CFTreeGetChildCount (tree);
|
||||
CFIndex i = 0;
|
||||
CFXMLTreeRef childTree;
|
||||
CFXMLNodeRef childNode;
|
||||
NSString *childName, *childValue, *keyName;
|
||||
|
||||
if (childCount < 1)
|
||||
return;
|
||||
|
||||
for (i = 0; i < childCount; i++) {
|
||||
|
||||
childTree = CFTreeGetChildAtIndex (tree, i);
|
||||
|
||||
childNode = CFXMLTreeGetNode (childTree);
|
||||
|
||||
childName = (NSString *) CFXMLNodeGetString (childNode);
|
||||
|
||||
if ([childName hasPrefix: @"rss:"])
|
||||
childName = [childName substringFromIndex: 4];
|
||||
|
||||
childValue = [self getelementvalue: childTree];
|
||||
|
||||
keyName = [NSString stringWithFormat: @"image%@", childName];
|
||||
|
||||
[dictionary setObject: childValue forKey: keyName];
|
||||
} /*for*/
|
||||
} /*flattenimagechildren*/
|
||||
|
||||
|
||||
- (void) flattensourceattributes: (CFXMLNodeRef) node into: (NSMutableDictionary *) dictionary {
|
||||
|
||||
const CFXMLElementInfo *elementInfo;
|
||||
NSString *sourceHomeUrl, *sourceRssUrl;
|
||||
|
||||
elementInfo = CFXMLNodeGetInfoPtr (node);
|
||||
|
||||
sourceHomeUrl = [(NSDictionary *) (*elementInfo).attributes objectForKey: @"homeUrl"];
|
||||
|
||||
sourceRssUrl = [(NSDictionary *) (*elementInfo).attributes objectForKey: @"url"];
|
||||
|
||||
if (sourceHomeUrl != nil)
|
||||
[dictionary setObject: sourceHomeUrl forKey: @"sourceHomeUrl"];
|
||||
|
||||
if (sourceRssUrl != nil)
|
||||
[dictionary setObject: sourceRssUrl forKey: @"sourceRssUrl"];
|
||||
} /*flattensourceattributes*/
|
||||
|
||||
|
||||
- (CFXMLTreeRef) getchanneltree: (CFXMLTreeRef) tree {
|
||||
|
||||
CFXMLTreeRef rssTree, channelTree;
|
||||
|
||||
rssTree = [self getnamedtree: tree name: @"rss"];
|
||||
|
||||
if (rssTree == nil) { /*It might be "rdf:RDF" instead, a 1.0 or greater feed.*/
|
||||
|
||||
rssTree = [self getnamedtree: tree name: @"rdf:RDF"];
|
||||
|
||||
if (rssTree != nil)
|
||||
flRdf = YES; /*This info will be needed later when creating the items array.*/
|
||||
} /*if*/
|
||||
|
||||
if (rssTree == nil)
|
||||
return (nil);
|
||||
|
||||
channelTree = [self getnamedtree: rssTree name: @"channel"];
|
||||
|
||||
if (channelTree == nil)
|
||||
channelTree = [self getnamedtree: rssTree name: @"rss:channel"];
|
||||
|
||||
return (channelTree);
|
||||
} /*getchanneltree*/
|
||||
|
||||
|
||||
- (CFXMLTreeRef) getnamedtree: (CFXMLTreeRef) currentTree name: (NSString *) name {
|
||||
|
||||
CFIndex childCount, i;
|
||||
CFXMLNodeRef xmlNode;
|
||||
CFXMLTreeRef xmlTreeNode;
|
||||
NSString *itemName;
|
||||
|
||||
childCount = CFTreeGetChildCount (currentTree);
|
||||
|
||||
for (i = childCount - 1; i >= 0; i--) {
|
||||
|
||||
xmlTreeNode = CFTreeGetChildAtIndex (currentTree, i);
|
||||
|
||||
xmlNode = CFXMLTreeGetNode (xmlTreeNode);
|
||||
|
||||
itemName = (NSString *) CFXMLNodeGetString (xmlNode);
|
||||
|
||||
if ([itemName isEqualToString: name])
|
||||
return (xmlTreeNode);
|
||||
} /*for*/
|
||||
|
||||
return (nil);
|
||||
} /*getnamedtree*/
|
||||
|
||||
|
||||
- (void) normalizeRSSItem: (NSMutableDictionary *) rssItem {
|
||||
|
||||
/*
|
||||
Make sure item, link, and description are present and have
|
||||
reasonable values. Description and link may be "".
|
||||
Also trim white space, remove HTML when appropriate.
|
||||
*/
|
||||
|
||||
NSString *description, *normalizedLink, *title;
|
||||
BOOL nilDescription = NO;
|
||||
|
||||
/*Description*/
|
||||
|
||||
description = [rssItem objectForKey: descriptionKey];
|
||||
|
||||
if (description == nil) {
|
||||
|
||||
description = @"";
|
||||
|
||||
nilDescription = YES;
|
||||
} /*if*/
|
||||
|
||||
description = [description trimWhiteSpace];
|
||||
|
||||
if ([description isEqualTo: @""])
|
||||
nilDescription = YES;
|
||||
|
||||
[rssItem setObject: description forKey: descriptionKey];
|
||||
|
||||
/*Link*/
|
||||
|
||||
normalizedLink = [rssItem objectForKey: linkKey];
|
||||
|
||||
if ([NSString stringIsEmpty: normalizedLink]) {
|
||||
|
||||
/*Try to get a URL from the description.*/
|
||||
|
||||
if (!nilDescription) {
|
||||
|
||||
NSArray *stringComponents = [description componentsSeparatedByString: @"href=\""];
|
||||
|
||||
if ([stringComponents count] > 1) {
|
||||
|
||||
normalizedLink = [stringComponents objectAtIndex: 1];
|
||||
|
||||
stringComponents = [normalizedLink componentsSeparatedByString: @"\""];
|
||||
|
||||
normalizedLink = [stringComponents objectAtIndex: 0];
|
||||
} /*if*/
|
||||
} /*if*/
|
||||
} /*if*/
|
||||
|
||||
if (normalizedLink == nil)
|
||||
normalizedLink = @"";
|
||||
|
||||
normalizedLink = [normalizedLink trimWhiteSpace];
|
||||
|
||||
[rssItem setObject: normalizedLink forKey: linkKey];
|
||||
|
||||
/*Title*/
|
||||
|
||||
title = [rssItem objectForKey: titleKey];
|
||||
|
||||
if (title != nil) {
|
||||
|
||||
title = [title stripHTML];
|
||||
|
||||
title = [title trimWhiteSpace];
|
||||
} /*if*/
|
||||
|
||||
if ([NSString stringIsEmpty: title]) {
|
||||
|
||||
/*Grab a title from the description.*/
|
||||
|
||||
if (!nilDescription) {
|
||||
|
||||
NSArray *stringComponents = [description componentsSeparatedByString: @">"];
|
||||
|
||||
if ([stringComponents count] > 1) {
|
||||
|
||||
title = [stringComponents objectAtIndex: 1];
|
||||
|
||||
stringComponents = [title componentsSeparatedByString: @"<"];
|
||||
|
||||
title = [stringComponents objectAtIndex: 0];
|
||||
|
||||
title = [title stripHTML];
|
||||
|
||||
title = [title trimWhiteSpace];
|
||||
} /*if*/
|
||||
|
||||
if ([NSString stringIsEmpty: title]) { /*use first part of description*/
|
||||
|
||||
NSString *shortTitle = [[[description stripHTML] trimWhiteSpace] ellipsizeAfterNWords: 5];
|
||||
|
||||
shortTitle = [shortTitle trimWhiteSpace];
|
||||
|
||||
title = [NSString stringWithFormat: @"%@\u2026", shortTitle];
|
||||
} /*else*/
|
||||
} /*if*/
|
||||
|
||||
title = [title stripHTML];
|
||||
|
||||
title = [title trimWhiteSpace];
|
||||
|
||||
if ([NSString stringIsEmpty: title])
|
||||
title = @"Untitled";
|
||||
} /*if*/
|
||||
|
||||
[rssItem setObject: title forKey: titleKey];
|
||||
|
||||
/*dangerousmeta case: super-long title with no description*/
|
||||
|
||||
if ((nilDescription) && ([title length] > 50)) {
|
||||
|
||||
NSString *shortTitle = [[[title stripHTML] trimWhiteSpace] ellipsizeAfterNWords: 7];
|
||||
|
||||
description = [[title copy] autorelease];
|
||||
|
||||
[rssItem setObject: description forKey: descriptionKey];
|
||||
|
||||
title = [NSString stringWithFormat: @"%@\u2026", shortTitle];
|
||||
|
||||
[rssItem setObject: title forKey: titleKey];
|
||||
} /*if*/
|
||||
|
||||
{ /*deal with entities*/
|
||||
|
||||
const char *tempcstring;
|
||||
NSAttributedString *s = nil;
|
||||
NSString *convertedTitle = nil;
|
||||
NSArray *stringComponents;
|
||||
|
||||
stringComponents = [title componentsSeparatedByString: @"&"];
|
||||
|
||||
if ([stringComponents count] > 1) {
|
||||
|
||||
stringComponents = [title componentsSeparatedByString: @";"];
|
||||
|
||||
if ([stringComponents count] > 1) {
|
||||
|
||||
size_t len;
|
||||
|
||||
tempcstring = [title UTF8String];
|
||||
|
||||
len = strlen (tempcstring);
|
||||
|
||||
if (len > 0) {
|
||||
|
||||
s = [[NSAttributedString alloc]
|
||||
initWithHTML: [NSData dataWithBytes: tempcstring length: strlen (tempcstring)]
|
||||
documentAttributes: (NSDictionary **) NULL];
|
||||
|
||||
convertedTitle = [s string];
|
||||
|
||||
[s autorelease];
|
||||
|
||||
convertedTitle = [convertedTitle stripHTML];
|
||||
|
||||
convertedTitle = [convertedTitle trimWhiteSpace];
|
||||
} /*if*/
|
||||
|
||||
if ([NSString stringIsEmpty: convertedTitle])
|
||||
convertedTitle = @"Untitled";
|
||||
|
||||
[rssItem setObject: convertedTitle forKey: @"convertedTitle"];
|
||||
} /*if*/
|
||||
} /*if*/
|
||||
} /*deal with entities*/
|
||||
} /*normalizeRSSItem*/
|
||||
|
||||
|
||||
- (NSString *) getelementvalue: (CFXMLTreeRef) tree {
|
||||
|
||||
CFXMLNodeRef node;
|
||||
CFXMLTreeRef itemTree;
|
||||
CFIndex childCount, ix;
|
||||
NSMutableString *valueMutable;
|
||||
NSString *value;
|
||||
NSString *name;
|
||||
|
||||
childCount = CFTreeGetChildCount (tree);
|
||||
|
||||
valueMutable = [[NSMutableString alloc] init];
|
||||
|
||||
for (ix = 0; ix < childCount; ix++) {
|
||||
|
||||
itemTree = CFTreeGetChildAtIndex (tree, ix);
|
||||
|
||||
node = CFXMLTreeGetNode (itemTree);
|
||||
|
||||
name = (NSString *) CFXMLNodeGetString (node);
|
||||
|
||||
if (name != nil) {
|
||||
|
||||
if (CFXMLNodeGetTypeCode (node) == kCFXMLNodeTypeEntityReference) {
|
||||
|
||||
if ([name isEqualTo: @"lt"])
|
||||
name = @"<";
|
||||
|
||||
else if ([name isEqualTo: @"gt"])
|
||||
name = @">";
|
||||
|
||||
else if ([name isEqualTo: @"quot"])
|
||||
name = @"\"";
|
||||
|
||||
else if ([name isEqualTo: @"amp"])
|
||||
name = @"&";
|
||||
|
||||
else if ([name isEqualTo: @"rsquo"]) {
|
||||
char rsquo[4] = { 0xe2, 0x80, 0x99, 0x0 };
|
||||
name = [NSString stringWithUTF8String: rsquo];
|
||||
}
|
||||
|
||||
else if ([name isEqualTo: @"lsquo"]) {
|
||||
char lsquo[4] = { 0xe2, 0x80, 0x98, 0x0 };
|
||||
name = [NSString stringWithUTF8String: lsquo];
|
||||
}
|
||||
|
||||
else if ([name isEqualTo: @"apos"])
|
||||
name = @"'";
|
||||
else
|
||||
name = [NSString stringWithFormat: @"&%@;", name];
|
||||
} /*if*/
|
||||
|
||||
[valueMutable appendString: name];
|
||||
} /*if*/
|
||||
} /*for*/
|
||||
|
||||
value = [[valueMutable trimWhiteSpace] retain];
|
||||
|
||||
[valueMutable autorelease];
|
||||
|
||||
return ([value autorelease]);
|
||||
} /*getelementvalue*/
|
||||
|
||||
@end
|
||||
+2
-1
@@ -9,11 +9,12 @@
|
||||
#ifndef SUAPPCAST_H
|
||||
#define SUAPPCAST_H
|
||||
|
||||
@class RSS, SUAppcastItem;
|
||||
@class SUAppcastItem;
|
||||
@interface SUAppcast : NSObject {
|
||||
NSArray *items;
|
||||
NSString *userAgentString;
|
||||
id delegate;
|
||||
NSMutableData *incrementalData;
|
||||
}
|
||||
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url;
|
||||
|
||||
+161
-20
@@ -11,6 +11,7 @@
|
||||
|
||||
@interface SUAppcast (Private)
|
||||
- (void)reportError:(NSError *)error;
|
||||
- (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes;
|
||||
@end
|
||||
|
||||
@implementation SUAppcast
|
||||
@@ -18,6 +19,8 @@
|
||||
- (void)dealloc
|
||||
{
|
||||
[items release];
|
||||
[userAgentString release];
|
||||
[incrementalData release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -28,38 +31,151 @@
|
||||
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url
|
||||
{
|
||||
RSS *feed = [[RSS alloc] initWithURL:url userAgent:userAgentString delegate:self];
|
||||
CFRetain(feed); // Manage the RSS feed's memory manually.
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
|
||||
if (userAgentString)
|
||||
[request setValue:userAgentString forHTTPHeaderField:@"User-Agent"];
|
||||
|
||||
incrementalData = [[NSMutableData alloc] init];
|
||||
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];
|
||||
CFRetain(connection);
|
||||
}
|
||||
|
||||
- (void)feedDidFinishLoading:(RSS *)feed
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
|
||||
{
|
||||
// Set up all the appcast items:
|
||||
NSArray *tempItems = [NSMutableArray array];
|
||||
id enumerator = [[feed newsItems] objectEnumerator], current;
|
||||
@try
|
||||
{
|
||||
while ((current = [enumerator nextObject]))
|
||||
{
|
||||
[(NSMutableArray *)tempItems addObject:[[[SUAppcastItem alloc] initWithDictionary:current] autorelease]];
|
||||
}
|
||||
items = [[NSArray arrayWithArray:tempItems] retain]; // Make the items list immutable.
|
||||
[incrementalData appendData:data];
|
||||
}
|
||||
|
||||
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
|
||||
{
|
||||
CFRelease(connection);
|
||||
|
||||
NSError *error = nil;
|
||||
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:incrementalData options:0 error:&error];
|
||||
BOOL failed = NO;
|
||||
NSArray *xmlItems = nil;
|
||||
NSMutableArray *appcastItems = [NSMutableArray array];
|
||||
|
||||
if (nil == document)
|
||||
{
|
||||
failed = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlItems = [document nodesForXPath:@"/rss/channel/item" error:&error];
|
||||
if (nil == xmlItems)
|
||||
{
|
||||
failed = YES;
|
||||
}
|
||||
}
|
||||
|
||||
if (failed == NO)
|
||||
{
|
||||
|
||||
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)])
|
||||
[delegate performSelectorOnMainThread:@selector(appcastDidFinishLoading:) withObject:self waitUntilDone:NO];
|
||||
NSEnumerator *nodeEnum = [xmlItems objectEnumerator];
|
||||
NSXMLNode *node;
|
||||
NSMutableDictionary *nodesDict = [NSMutableDictionary dictionary];
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
||||
|
||||
while (failed == NO && (node = [nodeEnum nextObject]))
|
||||
{
|
||||
// First, we'll "index" all the first-level children of this appcast item so we can pick them out by language later.
|
||||
if ([[node children] count])
|
||||
{
|
||||
node = [node childAtIndex:0];
|
||||
while (nil != node)
|
||||
{
|
||||
NSString *name = [node name];
|
||||
if (name)
|
||||
{
|
||||
NSMutableArray *nodes = [nodesDict objectForKey:name];
|
||||
if (nodes == nil)
|
||||
{
|
||||
nodes = [NSMutableArray array];
|
||||
[nodesDict setObject:nodes forKey:name];
|
||||
}
|
||||
[nodes addObject:node];
|
||||
}
|
||||
node = [node nextSibling];
|
||||
}
|
||||
}
|
||||
|
||||
NSEnumerator *nameEnum = [nodesDict keyEnumerator];
|
||||
NSString *name;
|
||||
while ((name = [nameEnum nextObject]))
|
||||
{
|
||||
node = [self bestNodeInNodes:[nodesDict objectForKey:name]];
|
||||
if ([name isEqualToString:@"enclosure"])
|
||||
{
|
||||
// enclosure is flattened as a separate dictionary for some reason
|
||||
NSEnumerator *attributeEnum = [[(NSXMLElement *)node attributes] objectEnumerator];
|
||||
NSXMLNode *attribute;
|
||||
NSMutableDictionary *encDict = [NSMutableDictionary dictionary];
|
||||
|
||||
while ((attribute = [attributeEnum nextObject]))
|
||||
[encDict setObject:[attribute stringValue] forKey:[attribute name]];
|
||||
[dict setObject:encDict forKey:@"enclosure"];
|
||||
|
||||
}
|
||||
else if ([name isEqualToString:@"pubDate"])
|
||||
{
|
||||
// pubDate is expected to be an NSDate by SUAppcastItem, but the RSS class was returning an NSString
|
||||
NSDate *date = [NSDate dateWithNaturalLanguageString:[node stringValue]];
|
||||
if (date)
|
||||
[dict setObject:date forKey:name];
|
||||
}
|
||||
else if (name != nil)
|
||||
{
|
||||
// add all other values as strings
|
||||
[dict setObject:[[node stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] forKey:name];
|
||||
}
|
||||
}
|
||||
|
||||
SUAppcastItem *anItem = [[SUAppcastItem alloc] initWithDictionary:dict];
|
||||
if (anItem)
|
||||
{
|
||||
[appcastItems addObject:anItem];
|
||||
[anItem release];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Sparkle Updater: Failed to parse appcast item with appcast dictionary %@!", dict);
|
||||
}
|
||||
[nodesDict removeAllObjects];
|
||||
[dict removeAllObjects];
|
||||
}
|
||||
}
|
||||
@catch (NSException *parseException)
|
||||
{
|
||||
[self reportError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while parsing the update feed.", nil), NSLocalizedDescriptionKey, [parseException reason], SUTechnicalErrorInformationKey, nil]]];
|
||||
|
||||
[document release];
|
||||
|
||||
if ([appcastItems count])
|
||||
{
|
||||
NSSortDescriptor *sort = [[[NSSortDescriptor alloc] initWithKey:@"date" ascending:NO] autorelease];
|
||||
[appcastItems sortUsingDescriptors:[NSArray arrayWithObject:sort]];
|
||||
items = [appcastItems copy];
|
||||
}
|
||||
|
||||
if (failed)
|
||||
{
|
||||
[self reportError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while parsing the update feed.", nil), NSLocalizedDescriptionKey, nil]]];
|
||||
}
|
||||
else if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)])
|
||||
{
|
||||
[delegate appcastDidFinishLoading:self];
|
||||
}
|
||||
CFRelease(feed);
|
||||
}
|
||||
|
||||
- (void)feed:(RSS *)feed didFailWithError:(NSError *)error
|
||||
- (void)connection:(NSURLConnection*)connection didFailWithError:(NSError *)error
|
||||
{
|
||||
CFRelease(connection);
|
||||
|
||||
[self reportError:error];
|
||||
}
|
||||
|
||||
- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
|
||||
{
|
||||
return request;
|
||||
}
|
||||
|
||||
- (void)reportError:(NSError *)error
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(appcast:failedToLoadWithError:)])
|
||||
@@ -68,6 +184,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes
|
||||
{
|
||||
// We use this method to pick out the localized version of a node when one's available.
|
||||
if ([nodes count] == 1)
|
||||
return [nodes objectAtIndex:0];
|
||||
else if ([nodes count] == 0)
|
||||
return nil;
|
||||
|
||||
NSEnumerator *nodeEnum = [nodes objectEnumerator];
|
||||
NSXMLElement *node;
|
||||
NSMutableArray *languages = [NSMutableArray array];
|
||||
NSString *lang;
|
||||
NSInteger i;
|
||||
while ((node = [nodeEnum nextObject]))
|
||||
{
|
||||
lang = [[node attributeForName:@"xml:lang"] stringValue];
|
||||
[languages addObject:(lang ?: @"")];
|
||||
}
|
||||
lang = [[NSBundle preferredLocalizationsFromArray:languages] objectAtIndex:0];
|
||||
i = [languages indexOfObject:([languages containsObject:lang] ? lang : @"")];
|
||||
if (i == NSNotFound)
|
||||
i = 0;
|
||||
return [nodes objectAtIndex:i];
|
||||
}
|
||||
|
||||
- (void)setUserAgentString:(NSString *)uas
|
||||
{
|
||||
if (uas != userAgentString)
|
||||
|
||||
+2
-3
@@ -9,11 +9,10 @@
|
||||
#ifndef SUAPPCASTITEM_H
|
||||
#define SUAPPCASTITEM_H
|
||||
|
||||
|
||||
@interface SUAppcastItem : NSObject {
|
||||
NSString *title;
|
||||
NSDate *date;
|
||||
NSString *description;
|
||||
NSString *itemDescription;
|
||||
|
||||
NSURL *releaseNotesURL;
|
||||
|
||||
@@ -34,7 +33,7 @@
|
||||
- (NSString *)versionString;
|
||||
- (NSString *)displayVersionString;
|
||||
- (NSDate *)date;
|
||||
- (NSString *)description;
|
||||
- (NSString *)itemDescription;
|
||||
- (NSURL *)releaseNotesURL;
|
||||
- (NSURL *)fileURL;
|
||||
- (NSString *)DSASignature;
|
||||
|
||||
+40
-34
@@ -33,13 +33,13 @@
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)description { return [[description retain] autorelease]; }
|
||||
- (NSString *)itemDescription { return [[itemDescription retain] autorelease]; }
|
||||
|
||||
- (void)setDescription:(NSString *)aDescription
|
||||
- (void)setItemDescription:(NSString *)anItemDescription
|
||||
{
|
||||
if (description == aDescription) return;
|
||||
[description release];
|
||||
description = [aDescription copy];
|
||||
if (itemDescription == anItemDescription) return;
|
||||
[itemDescription release];
|
||||
itemDescription = [anItemDescription copy];
|
||||
}
|
||||
|
||||
|
||||
@@ -106,16 +106,7 @@
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
propertiesDictionary = [dict retain];
|
||||
[self setTitle:[dict objectForKey:@"title"]];
|
||||
[self setDate:[dict objectForKey:@"pubDate"]];
|
||||
[self setDescription:[dict objectForKey:@"description"]];
|
||||
|
||||
id enclosure = [dict objectForKey:@"enclosure"];
|
||||
if (enclosure == nil || [enclosure objectForKey:@"url"] == nil)
|
||||
[NSException raise:@"SUAppcastException" format:@"Couldn't find an download URL for feed entry %@!", [self title]];
|
||||
[self setFileURL:[NSURL URLWithString:[[enclosure objectForKey:@"url"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
|
||||
[self setDSASignature:[enclosure objectForKey:@"sparkle:dsaSignature"]];
|
||||
|
||||
// Try to find a version string.
|
||||
// Finding the new version number from the RSS feed is a little bit hacky. There are two ways:
|
||||
@@ -126,32 +117,47 @@
|
||||
// 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) // no sparkle:version attribute
|
||||
if (newVersion == nil) // no sparkle:version attribute
|
||||
{
|
||||
// Separate the url by underscores and take the last component, as that'll be closest to the end,
|
||||
// then we remove the extension. Hopefully, this will be the version.
|
||||
NSArray *fileComponents = [[enclosure objectForKey:@"url"] componentsSeparatedByString:@"_"];
|
||||
if ([fileComponents count] > 1)
|
||||
newVersion = [[fileComponents lastObject] stringByDeletingPathExtension];
|
||||
else
|
||||
[NSException raise:@"SUAppcastException" format:@"Couldn't find a version string for %@! You need a sparkle:version attribute.", [enclosure objectForKey:@"url"]];
|
||||
}
|
||||
[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 description] hasPrefix:@"http://"]) // if the description starts with http://, use that.
|
||||
[self setReleaseNotesURL:[NSURL URLWithString:[self description]]];
|
||||
else
|
||||
[self setReleaseNotesURL: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];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -160,7 +166,7 @@
|
||||
{
|
||||
[self setTitle:nil];
|
||||
[self setDate:nil];
|
||||
[self setDescription:nil];
|
||||
[self setItemDescription:nil];
|
||||
[self setReleaseNotesURL:nil];
|
||||
[self setDSASignature:nil];
|
||||
[self setFileURL:nil];
|
||||
|
||||
@@ -18,14 +18,14 @@ typedef enum
|
||||
SUDoNotInstallChoice
|
||||
} SUAutomaticInstallationChoice;
|
||||
|
||||
@class SUAppcastItem;
|
||||
@class SUAppcastItem, SUHost;
|
||||
@interface SUAutomaticUpdateAlert : SUWindowController {
|
||||
SUAppcastItem *updateItem;
|
||||
id delegate;
|
||||
NSBundle *hostBundle;
|
||||
SUHost *host;
|
||||
}
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle delegate:delegate;
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)hostBundle delegate:delegate;
|
||||
- (IBAction)installNow:sender;
|
||||
- (IBAction)installLater:sender;
|
||||
- (IBAction)doNotInstall:sender;
|
||||
|
||||
@@ -6,19 +6,20 @@
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "SUAutomaticUpdateAlert.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
|
||||
@implementation SUAutomaticUpdateAlert
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb delegate:del;
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost delegate:del;
|
||||
{
|
||||
self = [super initWithHostBundle:hb windowNibName:@"SUAutomaticUpdateAlert"];
|
||||
self = [super initWithHost:aHost windowNibName:@"SUAutomaticUpdateAlert"];
|
||||
if (self)
|
||||
{
|
||||
updateItem = [item retain];
|
||||
delegate = del;
|
||||
hostBundle = [hb retain];
|
||||
host = [aHost retain];
|
||||
[self setShouldCascadeWindows:NO];
|
||||
[[self window] center];
|
||||
}
|
||||
@@ -27,11 +28,12 @@
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[hostBundle release];
|
||||
[host release];
|
||||
[updateItem release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; }
|
||||
|
||||
- (IBAction)installNow:sender
|
||||
{
|
||||
@@ -53,17 +55,17 @@
|
||||
|
||||
- (NSImage *)applicationIcon
|
||||
{
|
||||
return [hostBundle icon];
|
||||
return [host icon];
|
||||
}
|
||||
|
||||
- (NSString *)titleText
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"A new version of %@ is ready to install!", nil), [hostBundle name]];
|
||||
return [NSString stringWithFormat:SULocalizedString(@"A new version of %@ is ready to install!", nil), [host name]];
|
||||
}
|
||||
|
||||
- (NSString *)descriptionText
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?", nil), [hostBundle name], [hostBundle displayVersion]];
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?", nil), [host name], [host displayVersion]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -7,13 +7,15 @@
|
||||
//
|
||||
|
||||
#import "SUAutomaticUpdateDriver.h"
|
||||
#import "Sparkle.h"
|
||||
|
||||
#import "SUAutomaticUpdateAlert.h"
|
||||
#import "SUHost.h"
|
||||
|
||||
@implementation SUAutomaticUpdateDriver
|
||||
|
||||
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
|
||||
{
|
||||
alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:updateItem hostBundle:hostBundle delegate:self];
|
||||
alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:updateItem host:host delegate:self];
|
||||
if ([NSApp isActive])
|
||||
[[alert window] makeKeyAndOrderFront:self];
|
||||
else
|
||||
@@ -40,7 +42,7 @@
|
||||
break;
|
||||
|
||||
case SUDoNotInstallChoice:
|
||||
[[SUUserDefaults standardUserDefaults] setObject:[updateItem versionString] forKey:SUSkippedVersionKey];
|
||||
[host setObject:[updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey];
|
||||
[self abortUpdate];
|
||||
break;
|
||||
}
|
||||
@@ -59,9 +61,9 @@
|
||||
[self installUpdate];
|
||||
}
|
||||
|
||||
- (void)installerFinishedForHostBundle:(NSBundle *)hb
|
||||
- (void)installerFinishedForHost:(SUHost *)aHost
|
||||
{
|
||||
if (hb != hostBundle) { return; }
|
||||
if (aHost != host) { return; }
|
||||
if (!postponingInstallation)
|
||||
[self relaunchHostApp];
|
||||
}
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUUpdateDriver.h"
|
||||
|
||||
@class SUAppcastItem, SUUnarchiver, SUAppcast, SUUnarchiver;
|
||||
@class SUAppcastItem, SUUnarchiver, SUAppcast, SUUnarchiver, SUHost;
|
||||
@interface SUBasicUpdateDriver : SUUpdateDriver {
|
||||
NSBundle *hostBundle;
|
||||
SUAppcastItem *updateItem;
|
||||
|
||||
NSURLDownload *download;
|
||||
@@ -23,7 +22,7 @@
|
||||
NSString *relaunchPath;
|
||||
}
|
||||
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb;
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
|
||||
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac;
|
||||
- (void)appcast:(SUAppcast *)ac failedToLoadWithError:(NSError *)error;
|
||||
@@ -45,8 +44,8 @@
|
||||
- (void)unarchiverDidFail:(SUUnarchiver *)ua;
|
||||
|
||||
- (void)installUpdate;
|
||||
- (void)installerFinishedForHostBundle:(NSBundle *)hb;
|
||||
- (void)installerForHostBundle:(NSBundle *)hb failedWithError:(NSError *)error;
|
||||
- (void)installerFinishedForHost:(SUHost *)host;
|
||||
- (void)installerForHost:(SUHost *)host failedWithError:(NSError *)error;
|
||||
|
||||
- (void)relaunchHostApp;
|
||||
- (void)cleanUp;
|
||||
|
||||
+92
-61
@@ -7,17 +7,21 @@
|
||||
//
|
||||
|
||||
#import "SUBasicUpdateDriver.h"
|
||||
#import "Sparkle.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
#import "SUDSAVerifier.h"
|
||||
#import "SUInstaller.h"
|
||||
#import "SUStandardVersionComparator.h"
|
||||
#import "SUUnarchiver.h"
|
||||
|
||||
@implementation SUBasicUpdateDriver
|
||||
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
|
||||
{
|
||||
hostBundle = [hb retain];
|
||||
|
||||
if ([hostBundle isRunningFromDiskImage])
|
||||
[super checkForUpdatesAtURL:URL host:aHost];
|
||||
if ([aHost isRunningOnReadOnlyVolume])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated when it's running from a disk image. Move %1$@ to your Applications folder, relaunch it from there, and try again.", nil), [hostBundle name]] forKey:NSLocalizedDescriptionKey]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated when it's running from a read-only volume like a disk image or an optical drive. Move %1$@ to your Applications folder, relaunch it from there, and try again.", nil), [aHost name]] forKey:NSLocalizedDescriptionKey]]];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,29 +30,44 @@
|
||||
[appcast release];
|
||||
|
||||
[appcast setDelegate:self];
|
||||
[appcast setUserAgentString:[NSString stringWithFormat: @"%@/%@ Sparkle/1.5b2", [hostBundle name], [hostBundle displayVersion]]];
|
||||
[appcast fetchAppcastFromURL:appcastURL];
|
||||
NSString *userAgent = [NSString stringWithFormat: @"%@/%@ Sparkle/%@", [aHost name], [aHost displayVersion], ([SPARKLE_BUNDLE objectForInfoDictionaryKey:@"CFBundleVersion"] ?: nil)];
|
||||
NSData * cleanedAgent = [userAgent dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
|
||||
userAgent = [NSString stringWithCString:[cleanedAgent bytes] length:[cleanedAgent length]];
|
||||
[appcast setUserAgentString:userAgent];
|
||||
[appcast fetchAppcastFromURL:URL];
|
||||
}
|
||||
|
||||
- (id <SUVersionComparison>)_versionComparator
|
||||
{
|
||||
id <SUVersionComparison> comparator = nil;
|
||||
|
||||
// Give the delegate a chance to provide a custom version comparator
|
||||
if ([[updater delegate] respondsToSelector:@selector(versionComparatorForUpdater:)])
|
||||
comparator = [[updater delegate] versionComparatorForUpdater:updater];
|
||||
|
||||
// If we don't get a comparator from the delegate, use the default comparator
|
||||
if (!comparator)
|
||||
comparator = [SUStandardVersionComparator defaultComparator];
|
||||
|
||||
return comparator;
|
||||
}
|
||||
|
||||
- (BOOL)isItemNewer:(SUAppcastItem *)ui
|
||||
{
|
||||
return [[SUStandardVersionComparator defaultComparator] compareVersion:[hostBundle version]
|
||||
toVersion:[ui versionString]] == NSOrderedAscending;
|
||||
return [[self _versionComparator] compareVersion:[host version] toVersion:[ui versionString]] == NSOrderedAscending;
|
||||
}
|
||||
|
||||
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui
|
||||
{
|
||||
if ([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) { return YES; }
|
||||
return [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion]
|
||||
toVersion:[NSWorkspace systemVersionString]] != NSOrderedDescending;
|
||||
return [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion] toVersion:[SUHost systemVersionString]] != NSOrderedDescending;
|
||||
}
|
||||
|
||||
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui
|
||||
{
|
||||
NSString *skippedVersion = [[SUUserDefaults standardUserDefaults] objectForKey:SUSkippedVersionKey];
|
||||
NSString *skippedVersion = [host objectForUserDefaultsKey:SUSkippedVersionKey];
|
||||
if (skippedVersion == nil) { return NO; }
|
||||
return [[SUStandardVersionComparator defaultComparator] compareVersion:[ui versionString]
|
||||
toVersion:skippedVersion] != NSOrderedDescending;
|
||||
return [[self _versionComparator] compareVersion:[ui versionString] toVersion:skippedVersion] != NSOrderedDescending;
|
||||
}
|
||||
|
||||
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui
|
||||
@@ -58,28 +77,26 @@
|
||||
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:forHostBundle:)])
|
||||
[delegate appcastDidFinishLoading:ac forHostBundle:hostBundle];
|
||||
|
||||
NSArray* updates = [ac items];
|
||||
if ([updates count] > 0)
|
||||
[[SUUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:SULastCheckTimeKey];
|
||||
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)])
|
||||
[[updater delegate] updater:updater didFinishLoadingAppcast:ac];
|
||||
|
||||
SUAppcastItem *item = nil;
|
||||
|
||||
// Now we have to find the best valid update in the appcast.
|
||||
if ([delegate respondsToSelector:@selector(bestValidUpdateInAppcast:forHostBundle:)]) // Does the delegate want to handle it?
|
||||
if ([[updater delegate] respondsToSelector:@selector(bestValidUpdateInAppcast:forUpdater:)]) // Does the delegate want to handle it?
|
||||
{
|
||||
updateItem = [delegate bestValidUpdateInAppcast:ac forHostBundle:hostBundle];
|
||||
item = [[updater delegate] bestValidUpdateInAppcast:ac forUpdater:updater];
|
||||
}
|
||||
else // If not, we'll take care of it ourselves.
|
||||
{
|
||||
// Find the first update we can actually use.
|
||||
NSEnumerator *updateEnumerator = [updates objectEnumerator];
|
||||
NSEnumerator *updateEnumerator = [[ac items] objectEnumerator];
|
||||
do {
|
||||
updateItem = [updateEnumerator nextObject];
|
||||
} while (updateItem && ![self hostSupportsItem:updateItem]);
|
||||
|
||||
[updateItem retain];
|
||||
item = [updateEnumerator nextObject];
|
||||
} while (item && ![self hostSupportsItem:item]);
|
||||
}
|
||||
|
||||
updateItem = [item retain];
|
||||
CFRelease(ac); // Remember that we're explicitly managing the memory of the appcast.
|
||||
if (updateItem == nil) { [self didNotFindUpdate]; return; }
|
||||
|
||||
@@ -97,16 +114,16 @@
|
||||
|
||||
- (void)didFindValidUpdate
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(didFindValidUpdate:toHostBundle:)])
|
||||
[delegate didFindValidUpdate:updateItem toHostBundle:hostBundle];
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
|
||||
[[updater delegate] updater:updater didFindValidUpdate:updateItem];
|
||||
[self downloadUpdate];
|
||||
}
|
||||
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(didNotFindUpdateToHostBundle:)])
|
||||
[delegate didNotFindUpdateToHostBundle:hostBundle];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUNoUpdateError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", nil), [hostBundle name]] forKey:NSLocalizedDescriptionKey]]];
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)])
|
||||
[[updater delegate] updaterDidNotFindUpdate:updater];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUNoUpdateError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", nil), [host name]] forKey:NSLocalizedDescriptionKey]]];
|
||||
}
|
||||
|
||||
- (void)downloadUpdate
|
||||
@@ -122,7 +139,7 @@
|
||||
|
||||
// We create a temporary directory in /tmp and stick the file there.
|
||||
// Not using a GUID here because hdiutil for some reason chokes on GUIDs. Too long? I really have no idea.
|
||||
NSString *prefix = [NSString stringWithFormat:@"%@ %@ Update", [hostBundle name], [hostBundle version]];
|
||||
NSString *prefix = [NSString stringWithFormat:@"%@ %@ Update", [host name], [host version]];
|
||||
NSString *tempDir = [NSTemporaryDirectory() stringByAppendingPathComponent:prefix];
|
||||
int cnt=1;
|
||||
while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt <= 999999)
|
||||
@@ -141,6 +158,17 @@
|
||||
|
||||
- (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"] || [host publicDSAKey])
|
||||
{
|
||||
if (![SUDSAVerifier validatePath:downloadPath withEncodedDSASignature:[updateItem DSASignature] withPublicDSAKey:[host publicDSAKey]])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUSignatureError userInfo:[NSDictionary dictionaryWithObject:@"The update is improperly signed." forKey:NSLocalizedDescriptionKey]]];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[self extractUpdate];
|
||||
}
|
||||
|
||||
@@ -152,19 +180,16 @@
|
||||
[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]]];
|
||||
}
|
||||
|
||||
- (void)extractUpdate
|
||||
- (BOOL)download:(NSURLDownload *)download shouldDecodeSourceDataOfMIMEType:(NSString *)encodingType
|
||||
{
|
||||
// DSA verification, if activated by the developer
|
||||
if ([[hostBundle objectForInfoDictionaryKey:SUExpectsDSASignatureKey] boolValue])
|
||||
{
|
||||
if (![[NSFileManager defaultManager] validatePath:downloadPath withEncodedDSASignature:[updateItem DSASignature] withPublicDSAKey:[hostBundle publicDSAKey]])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUSignatureError userInfo:[NSDictionary dictionaryWithObject:@"The update is improperly signed." forKey:NSLocalizedDescriptionKey]]];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
SUUnarchiver *unarchiver = [SUUnarchiver unarchiverForURL:[[[NSURL alloc] initFileURLWithPath:downloadPath] autorelease]];
|
||||
// We don't want the download system to extract our gzips.
|
||||
// Note that we use a substring matching here instead of direct comparison because the docs say "application/gzip" but the system *uses* "application/x-gzip". This is a documentation bug.
|
||||
return ([encodingType rangeOfString:@"gzip"].location == NSNotFound);
|
||||
}
|
||||
|
||||
- (void)extractUpdate
|
||||
{
|
||||
SUUnarchiver *unarchiver = [SUUnarchiver unarchiverForPath:downloadPath];
|
||||
if (!unarchiver)
|
||||
{
|
||||
NSLog(@"Sparkle Error: No valid unarchiver for %@!", downloadPath);
|
||||
@@ -192,8 +217,8 @@
|
||||
|
||||
- (void)installUpdate
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(updateWillInstall:toHostBundle:)])
|
||||
[delegate updateWillInstall:updateItem toHostBundle:hostBundle];
|
||||
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 = [[NSBundle bundleForClass:[self class]] pathForResource:@"relaunch" ofType:@""];
|
||||
NSString *targetPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]];
|
||||
@@ -202,12 +227,12 @@
|
||||
if ([[NSFileManager defaultManager] copyPath:relaunchPathToCopy toPath:targetPath handler:nil])
|
||||
relaunchPath = [targetPath retain];
|
||||
|
||||
[SUInstaller installFromUpdateFolder:[downloadPath stringByDeletingLastPathComponent] overHostBundle:hostBundle delegate:self synchronously:[self shouldInstallSynchronously]];
|
||||
[SUInstaller installFromUpdateFolder:[downloadPath stringByDeletingLastPathComponent] overHost:host delegate:self synchronously:[self shouldInstallSynchronously] versionComparator:[self _versionComparator]];
|
||||
}
|
||||
|
||||
- (void)installerFinishedForHostBundle:(NSBundle *)hb
|
||||
- (void)installerFinishedForHost:(SUHost *)aHost
|
||||
{
|
||||
if (hb != hostBundle) { return; }
|
||||
if (aHost != host) { return; }
|
||||
[self relaunchHostApp];
|
||||
}
|
||||
|
||||
@@ -215,31 +240,34 @@
|
||||
{
|
||||
// Give the host app an opportunity to postpone the relaunch.
|
||||
static BOOL postponedOnce = NO;
|
||||
if (!postponedOnce && [delegate respondsToSelector:@selector(shouldPostponeRelaunchForUpdate:toHostBundle:untilInvoking:)])
|
||||
if (!postponedOnce && [[updater delegate] respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)])
|
||||
{
|
||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[[self class] instanceMethodSignatureForSelector:@selector(relaunchHostApp)] retain]];
|
||||
[invocation setSelector:@selector(relaunchHostApp)];
|
||||
[invocation setTarget:self];
|
||||
postponedOnce = YES;
|
||||
if ([delegate shouldPostponeRelaunchForUpdate:updateItem toHostBundle:hostBundle untilInvoking:invocation])
|
||||
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 ([delegate respondsToSelector:@selector(updaterWillRelaunchApplication)])
|
||||
[delegate updaterWillRelaunchApplication];
|
||||
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), [[NSBundle mainBundle] name]], NSLocalizedDescriptionKey, [NSString stringWithFormat:@"Couldn't find the relauncher (expected to find it at %@)", relaunchPath], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[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;
|
||||
}
|
||||
|
||||
[NSTask launchedTaskWithLaunchPath:relaunchPath arguments:[NSArray arrayWithObjects:[hostBundle bundlePath], [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]];
|
||||
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]];
|
||||
|
||||
[NSApp terminate:self];
|
||||
}
|
||||
@@ -249,9 +277,9 @@
|
||||
[[NSFileManager defaultManager] removeFileAtPath:[downloadPath stringByDeletingLastPathComponent] handler:nil];
|
||||
}
|
||||
|
||||
- (void)installerForHostBundle:(NSBundle *)hb failedWithError:(NSError *)error
|
||||
- (void)installerForHost:(SUHost *)aHost failedWithError:(NSError *)error
|
||||
{
|
||||
if (hb != hostBundle) { return; }
|
||||
if (aHost != host) { return; }
|
||||
[[NSFileManager defaultManager] removeFileAtPath:relaunchPath handler:NULL]; // Clean up the copied relauncher.
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while installing the update. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
}
|
||||
@@ -268,12 +296,15 @@
|
||||
NSLog(@"Sparkle Error: %@", [error localizedDescription]);
|
||||
if ([error localizedFailureReason])
|
||||
NSLog(@"Sparkle Error (continued): %@", [error localizedFailureReason]);
|
||||
if (download)
|
||||
[download cancel];
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[hostBundle release];
|
||||
[updateItem release];
|
||||
[download release];
|
||||
[downloadPath release];
|
||||
[relaunchPath release];
|
||||
[super dealloc];
|
||||
|
||||
+2
-1
@@ -20,7 +20,6 @@ extern NSString *SUShowReleaseNotesKey;
|
||||
extern NSString *SUSkippedVersionKey;
|
||||
extern NSString *SUScheduledCheckIntervalKey;
|
||||
extern NSString *SULastCheckTimeKey;
|
||||
extern NSString *SUExpectsDSASignatureKey;
|
||||
extern NSString *SUPublicDSAKeyKey;
|
||||
extern NSString *SUPublicDSAKeyFileKey;
|
||||
extern NSString *SUAutomaticallyUpdateKey;
|
||||
@@ -29,6 +28,7 @@ extern NSString *SUEnableAutomaticChecksKey;
|
||||
extern NSString *SUEnableAutomaticChecksKeyOld;
|
||||
extern NSString *SUEnableSystemProfilingKey;
|
||||
extern NSString *SUSendProfileInfoKey;
|
||||
extern NSString *SULastProfileSubmitDateKey;
|
||||
|
||||
extern NSString *SUSparkleErrorDomain;
|
||||
// Appcast phase errors.
|
||||
@@ -51,6 +51,7 @@ extern OSStatus SUMissingUpdateError;
|
||||
extern OSStatus SUMissingInstallerToolError;
|
||||
extern OSStatus SURelaunchError;
|
||||
extern OSStatus SUInstallationError;
|
||||
extern OSStatus SUDowngradeError;
|
||||
|
||||
// NSInteger is a type that was added to Leopard.
|
||||
// Here is some glue to ensure that NSInteger will work with pre-10.5 SDKs:
|
||||
|
||||
@@ -27,6 +27,7 @@ NSString *SUEnableSystemProfilingKey = @"SUEnableSystemProfiling";
|
||||
NSString *SUEnableAutomaticChecksKey = @"SUEnableAutomaticChecks";
|
||||
NSString *SUEnableAutomaticChecksKeyOld = @"SUCheckAtStartup";
|
||||
NSString *SUSendProfileInfoKey = @"SUSendProfileInfo";
|
||||
NSString *SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate";
|
||||
|
||||
NSString *SUSparkleErrorDomain = @"SUSparkleErrorDomain";
|
||||
OSStatus SUAppcastParseError = 1000;
|
||||
@@ -45,3 +46,4 @@ OSStatus SUMissingUpdateError = 4002;
|
||||
OSStatus SUMissingInstallerToolError = 4003;
|
||||
OSStatus SURelaunchError = 4004;
|
||||
OSStatus SUInstallationError = 4005;
|
||||
OSStatus SUDowngradeError = 4006;
|
||||
@@ -1,17 +1,17 @@
|
||||
//
|
||||
// NSFileManager+Verification.h
|
||||
// SUDSAVerifier.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/16/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NSFILEMANAGER_PLUS_VERIFICATION_H
|
||||
#define NSFILEMANAGER_PLUS_VERIFICATION_H
|
||||
#ifndef SUDSAVERIFIER_H
|
||||
#define SUDSAVERIFIER_H
|
||||
|
||||
// For the paranoid folks!
|
||||
@interface NSFileManager (SUVerification)
|
||||
- (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString;
|
||||
@interface SUDSAVerifier : NSObject {}
|
||||
+ (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// NSFileManager+Verification.m
|
||||
// SUDSAVerifier.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/16/06.
|
||||
@@ -8,8 +8,7 @@
|
||||
|
||||
// DSA stuff adapted from code provided by Allan Odgaard. Thanks, Allan!
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "NSFileManager+Verification.h"
|
||||
#import "SUDSAVerifier.h"
|
||||
|
||||
#import <stdio.h>
|
||||
#import <openssl/evp.h>
|
||||
@@ -102,9 +101,9 @@ EVP_PKEY* load_dsa_key(char *key)
|
||||
return pkey;
|
||||
}
|
||||
|
||||
@implementation NSFileManager (SUVerification)
|
||||
@implementation SUDSAVerifier
|
||||
|
||||
- (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString
|
||||
+ (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString
|
||||
{
|
||||
BOOL result = NO;
|
||||
if (!encodedSignature) { return NO; }
|
||||
+10
-7
@@ -12,9 +12,9 @@
|
||||
|
||||
@implementation SUDiskImageUnarchiver
|
||||
|
||||
+ (BOOL)_canUnarchiveURL:(NSURL *)URL
|
||||
+ (BOOL)_canUnarchivePath:(NSString *)path
|
||||
{
|
||||
return [URL conformsToType:@"public.disk-image"];
|
||||
return [[path pathExtension] isEqualToString:@"dmg"];
|
||||
}
|
||||
|
||||
- (void)start
|
||||
@@ -25,12 +25,10 @@
|
||||
- (void)_extractDMG
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString *archivePath = [archiveURL path];
|
||||
BOOL mountedSuccessfully = NO;
|
||||
|
||||
// get a unique mount point path
|
||||
NSString *mountPrefix = [@"/Volumes" stringByAppendingPathComponent:[[archivePath lastPathComponent] stringByDeletingPathExtension]];
|
||||
NSString *mountPoint = [mountPrefix stringByAppendingString:[[NSProcessInfo processInfo] globallyUniqueString]];
|
||||
NSString *mountPoint = [@"/Volumes" stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]];
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:mountPoint]) goto reportError;
|
||||
|
||||
@@ -55,7 +53,10 @@
|
||||
id subpathEnumerator = [[[NSFileManager defaultManager] directoryContentsAtPath:mountPoint] objectEnumerator], currentSubpath;
|
||||
while ((currentSubpath = [subpathEnumerator nextObject]))
|
||||
{
|
||||
if (![[NSFileManager defaultManager] copyPath:[mountPoint stringByAppendingPathComponent:currentSubpath] toPath:[targetPath stringByAppendingPathComponent:currentSubpath] handler:nil])
|
||||
NSString *currentFullPath = [mountPoint stringByAppendingPathComponent:currentSubpath];
|
||||
// Don't bother trying (and failing) to copy out files we can't read. That's not going to be the app anyway.
|
||||
if (![[NSFileManager defaultManager] isReadableFileAtPath:currentFullPath]) continue;
|
||||
if (![[NSFileManager defaultManager] copyPath:currentFullPath toPath:[targetPath stringByAppendingPathComponent:currentSubpath] handler:nil])
|
||||
goto reportError;
|
||||
}
|
||||
|
||||
@@ -67,7 +68,9 @@ reportError:
|
||||
|
||||
finally:
|
||||
if (mountedSuccessfully)
|
||||
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray arrayWithObjects:@"detach", mountPoint, @"-force", nil]];
|
||||
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray arrayWithObjects:@"detach", mountPoint, @"-force", nil]];
|
||||
else
|
||||
[[NSFileManager defaultManager] removeFileAtPath:mountPoint handler:nil];
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// SUHost.h
|
||||
// Sparkle
|
||||
//
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Sparkle.h"
|
||||
|
||||
@interface SUHost : NSObject
|
||||
{
|
||||
NSBundle *bundle;
|
||||
}
|
||||
|
||||
+ (NSString *)systemVersionString;
|
||||
|
||||
- (id)initWithBundle:(NSBundle *)aBundle;
|
||||
- (NSBundle *)bundle;
|
||||
- (NSString *)bundlePath;
|
||||
- (NSString *)name;
|
||||
- (NSString *)version;
|
||||
- (NSString *)displayVersion;
|
||||
- (NSImage *)icon;
|
||||
- (BOOL)isRunningOnReadOnlyVolume;
|
||||
- (BOOL)isBackgroundApplication;
|
||||
- (NSString *)publicDSAKey;
|
||||
- (NSArray *)systemProfile;
|
||||
|
||||
- (id)objectForInfoDictionaryKey:(NSString *)key;
|
||||
- (BOOL)boolForInfoDictionaryKey:(NSString *)key;
|
||||
- (id)objectForUserDefaultsKey:(NSString *)defaultName;
|
||||
- (void)setObject:(id)value forUserDefaultsKey:(NSString *)defaultName;
|
||||
- (BOOL)boolForUserDefaultsKey:(NSString *)defaultName;
|
||||
- (void)setBool:(BOOL)value forUserDefaultsKey:(NSString *)defaultName;
|
||||
- (id)objectForKey:(NSString *)key;
|
||||
- (BOOL)boolForKey:(NSString *)key;
|
||||
@end
|
||||
@@ -0,0 +1,225 @@
|
||||
//
|
||||
// SUHost.m
|
||||
// Sparkle
|
||||
//
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUHost.h"
|
||||
|
||||
#import "SUSystemProfiler.h"
|
||||
#import <sys/mount.h> // For statfs for isRunningOnReadOnlyVolume
|
||||
|
||||
@implementation SUHost
|
||||
|
||||
- (id)initWithBundle:(NSBundle *)aBundle
|
||||
{
|
||||
if (aBundle == nil) aBundle = [NSBundle mainBundle];
|
||||
if ((self = [super init]))
|
||||
{
|
||||
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.");
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[bundle release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self bundlePath]]; }
|
||||
|
||||
- (NSBundle *)bundle
|
||||
{
|
||||
return bundle;
|
||||
}
|
||||
|
||||
- (NSString *)bundlePath
|
||||
{
|
||||
return [bundle bundlePath];
|
||||
}
|
||||
|
||||
- (NSString *)name
|
||||
{
|
||||
NSString *name = [bundle objectForInfoDictionaryKey:@"CFBundleDisplayName"];
|
||||
if (name) return name;
|
||||
|
||||
name = [self objectForInfoDictionaryKey:@"CFBundleName"];
|
||||
if (name) return name;
|
||||
|
||||
return [[[NSFileManager defaultManager] displayNameAtPath:[bundle bundlePath]] stringByDeletingPathExtension];
|
||||
}
|
||||
|
||||
- (NSString *)version
|
||||
{
|
||||
return [bundle objectForInfoDictionaryKey:@"CFBundleVersion"];
|
||||
}
|
||||
|
||||
- (NSString *)displayVersion
|
||||
{
|
||||
NSString *shortVersionString = [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
|
||||
if (shortVersionString)
|
||||
return shortVersionString;
|
||||
else
|
||||
return [self version]; // Fall back on the normal version string.
|
||||
}
|
||||
|
||||
- (NSImage *)icon
|
||||
{
|
||||
// Cache the application icon.
|
||||
NSString *iconPath = [bundle pathForResource:[bundle objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType:@"icns"];
|
||||
// According to the OS X docs, "CFBundleIconFile - This key identifies the file containing
|
||||
// the icon for the bundle. The filename you specify does not need to include the .icns
|
||||
// extension, although it may."
|
||||
//
|
||||
// However, if it *does* include the '.icns' the above method fails (tested on OS X 10.3.9) so we'll also try:
|
||||
if (!iconPath)
|
||||
iconPath = [bundle pathForResource:[bundle objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType: nil];
|
||||
NSImage *icon = [[[NSImage alloc] initWithContentsOfFile:iconPath] autorelease];
|
||||
// Use a default icon if none is defined.
|
||||
if (!icon) { icon = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericApplicationIcon)]; }
|
||||
return icon;
|
||||
}
|
||||
|
||||
- (BOOL)isRunningOnReadOnlyVolume
|
||||
{
|
||||
struct statfs statfs_info;
|
||||
statfs([[bundle bundlePath] fileSystemRepresentation], &statfs_info);
|
||||
return (statfs_info.f_flags & MNT_RDONLY);
|
||||
}
|
||||
|
||||
- (BOOL)isBackgroundApplication
|
||||
{
|
||||
ProcessSerialNumber PSN;
|
||||
GetCurrentProcess(&PSN);
|
||||
NSDictionary * processInfo = (NSDictionary *)ProcessInformationCopyDictionary(&PSN, kProcessDictionaryIncludeAllInformationMask);
|
||||
BOOL isElement = [[processInfo objectForKey:@"LSUIElement"] boolValue];
|
||||
if (processInfo)
|
||||
CFRelease(processInfo);
|
||||
return isElement;
|
||||
}
|
||||
|
||||
- (NSString *)publicDSAKey
|
||||
{
|
||||
// Maybe the key is just a string in the Info.plist.
|
||||
NSString *key = [bundle objectForInfoDictionaryKey:SUPublicDSAKeyKey];
|
||||
if (key) { return key; }
|
||||
|
||||
// More likely, we've got a reference to a Resources file by filename:
|
||||
NSString *keyFilename = [self objectForInfoDictionaryKey:SUPublicDSAKeyFileKey];
|
||||
if (!keyFilename) { return nil; }
|
||||
return [NSString stringWithContentsOfFile:[bundle pathForResource:keyFilename ofType:nil]];
|
||||
}
|
||||
|
||||
- (NSArray *)systemProfile
|
||||
{
|
||||
return [[SUSystemProfiler sharedSystemProfiler] systemProfileArrayForHost:self];
|
||||
}
|
||||
|
||||
- (id)objectForInfoDictionaryKey:(NSString *)key
|
||||
{
|
||||
return [bundle objectForInfoDictionaryKey:key];
|
||||
}
|
||||
|
||||
- (BOOL)boolForInfoDictionaryKey:(NSString *)key
|
||||
{
|
||||
return [[self objectForInfoDictionaryKey:key] boolValue];
|
||||
}
|
||||
|
||||
- (id)objectForUserDefaultsKey:(NSString *)defaultName
|
||||
{
|
||||
// Under Tiger, CFPreferencesCopyAppValue doesn't get values from NSRegistratioDomain, 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])
|
||||
return [[NSUserDefaults standardUserDefaults] objectForKey:defaultName];
|
||||
|
||||
CFPropertyListRef obj = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)[bundle bundleIdentifier]);
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED > 1050
|
||||
return [NSMakeCollectable(obj) autorelease];
|
||||
#else
|
||||
return [(id)obj autorelease];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (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])
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:value forKey:defaultName];
|
||||
}
|
||||
else
|
||||
{
|
||||
CFPreferencesSetValue((CFStringRef)defaultName, value, (CFStringRef)[bundle bundleIdentifier], kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
CFPreferencesSynchronize((CFStringRef)[bundle bundleIdentifier], kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)boolForUserDefaultsKey:(NSString *)defaultName
|
||||
{
|
||||
if (bundle == [NSBundle mainBundle])
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:defaultName];
|
||||
|
||||
BOOL value;
|
||||
CFPropertyListRef plr = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)[bundle bundleIdentifier]);
|
||||
if (plr == NULL)
|
||||
value = NO;
|
||||
else
|
||||
{
|
||||
value = (BOOL)CFBooleanGetValue((CFBooleanRef)plr);
|
||||
CFRelease(plr);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
- (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])
|
||||
{
|
||||
[[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);
|
||||
}
|
||||
}
|
||||
|
||||
- (id)objectForKey:(NSString *)key {
|
||||
return [self objectForUserDefaultsKey:key] ?: [self objectForInfoDictionaryKey:key];
|
||||
}
|
||||
|
||||
- (BOOL)boolForKey:(NSString *)key {
|
||||
return [self objectForUserDefaultsKey:key] ? [self boolForUserDefaultsKey:key] : [self boolForInfoDictionaryKey:key];
|
||||
}
|
||||
|
||||
+ (NSString *)systemVersionString
|
||||
{
|
||||
// This returns a version string of the form X.Y.Z
|
||||
// There may be a better way to deal with the problem that gestaltSystemVersionMajor
|
||||
// et al. are not defined in 10.3, but this is probably good enough.
|
||||
NSString* verStr = nil;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
SInt32 major, minor, bugfix;
|
||||
OSErr err1 = Gestalt(gestaltSystemVersionMajor, &major);
|
||||
OSErr err2 = Gestalt(gestaltSystemVersionMinor, &minor);
|
||||
OSErr err3 = Gestalt(gestaltSystemVersionBugFix, &bugfix);
|
||||
if (!err1 && !err2 && !err3)
|
||||
{
|
||||
verStr = [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix];
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
NSString *versionPlistPath = @"/System/Library/CoreServices/SystemVersion.plist";
|
||||
verStr = [[[NSDictionary dictionaryWithContentsOfFile:versionPlistPath] objectForKey:@"ProductVersion"] retain];
|
||||
}
|
||||
return verStr;
|
||||
}
|
||||
|
||||
@end
|
||||
+6
-4
@@ -10,15 +10,17 @@
|
||||
#define SUINSTALLER_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
|
||||
@class SUHost;
|
||||
@interface SUInstaller : NSObject { }
|
||||
+ (void)installFromUpdateFolder:(NSString *)updateFolder overHostBundle:(NSBundle *)hostBundle delegate:delegate synchronously:(BOOL)synchronously;
|
||||
+ (void)_finishInstallationWithResult:(BOOL)result hostBundle:(NSBundle *)hostBundle error:(NSError *)error delegate:delegate;
|
||||
+ (void)installFromUpdateFolder:(NSString *)updateFolder overHost:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator;
|
||||
+ (void)_finishInstallationWithResult:(BOOL)result host:(SUHost *)host error:(NSError *)error delegate:delegate;
|
||||
@end
|
||||
|
||||
@interface NSObject (SUInstallerDelegateInformalProtocol)
|
||||
- (void)installerFinishedForHostBundle:(NSBundle *)hostBundle;
|
||||
- (void)installerForHostBundle:(NSBundle *)hostBundle failedWithError:(NSError *)error;
|
||||
- (void)installerFinishedForHost:(SUHost *)host;
|
||||
- (void)installerForHost:(SUHost *)host failedWithError:(NSError *)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
+34
-18
@@ -10,16 +10,32 @@
|
||||
#import "SUPlainInstaller.h"
|
||||
#import "SUPackageInstaller.h"
|
||||
|
||||
NSString *SUInstallerPathKey = @"SUInstallerPath";
|
||||
NSString *SUInstallerHostBundleKey = @"SUInstallerHostBundle";
|
||||
NSString *SUInstallerDelegateKey = @"SUInstallerDelegate";
|
||||
|
||||
@implementation SUInstaller
|
||||
|
||||
+ (void)installFromUpdateFolder:(NSString *)updateFolder overHostBundle:(NSBundle *)hostBundle delegate:delegate synchronously:(BOOL)synchronously
|
||||
+ (BOOL)_isAliasFolderAtPath:(NSString *)path
|
||||
{
|
||||
FSRef fileRef;
|
||||
OSStatus err = noErr;
|
||||
Boolean aliasFileFlag, folderFlag;
|
||||
NSURL *fileURL = [NSURL fileURLWithPath:path];
|
||||
|
||||
if (FALSE == CFURLGetFSRef((CFURLRef)fileURL, &fileRef))
|
||||
err = coreFoundationUnknownErr;
|
||||
|
||||
if (noErr == err)
|
||||
err = FSIsAliasFile(&fileRef, &aliasFileFlag, &folderFlag);
|
||||
|
||||
if (noErr == err)
|
||||
return (BOOL)(aliasFileFlag && folderFlag);
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
+ (void)installFromUpdateFolder:(NSString *)updateFolder overHost:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator
|
||||
{
|
||||
// Search subdirectories for the application
|
||||
NSString *currentFile, *newAppDownloadPath = nil, *bundleFileName = [[hostBundle bundlePath] lastPathComponent], *alternateBundleFileName = [[hostBundle name] stringByAppendingPathExtension:[[hostBundle bundlePath] pathExtension]];
|
||||
NSString *currentFile, *newAppDownloadPath = nil, *bundleFileName = [[host bundlePath] lastPathComponent], *alternateBundleFileName = [[host name] stringByAppendingPathExtension:[[host bundlePath] pathExtension]];
|
||||
BOOL isPackage = NO;
|
||||
NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:updateFolder];
|
||||
while ((currentFile = [dirEnum nextObject]))
|
||||
@@ -41,8 +57,8 @@ NSString *SUInstallerDelegateKey = @"SUInstallerDelegate";
|
||||
}
|
||||
|
||||
// Some DMGs have symlinks into /Applications! That's no good! And there's no point in looking in bundles.
|
||||
if ([[NSFileManager defaultManager] isAliasFolderAtPath:currentPath] ||
|
||||
[[currentFile pathExtension] isEqualToString:[[hostBundle bundlePath] pathExtension]] ||
|
||||
if ([self _isAliasFolderAtPath:currentPath] ||
|
||||
[[currentFile pathExtension] isEqualToString:[[host bundlePath] pathExtension]] ||
|
||||
[[currentFile pathExtension] isEqualToString:@"pkg"] ||
|
||||
[[currentFile pathExtension] isEqualToString:@"mpkg"])
|
||||
{
|
||||
@@ -52,34 +68,34 @@ NSString *SUInstallerDelegateKey = @"SUInstallerDelegate";
|
||||
|
||||
if (newAppDownloadPath == nil)
|
||||
{
|
||||
[self _finishInstallationWithResult:NO hostBundle:hostBundle error:[NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingUpdateError userInfo:[NSDictionary dictionaryWithObject:@"Couldn't find an appropriate update in the downloaded package." forKey:NSLocalizedDescriptionKey]] delegate:delegate];
|
||||
[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];
|
||||
}
|
||||
else
|
||||
{
|
||||
[(isPackage ? [SUPackageInstaller class] : [SUPlainInstaller class]) performInstallationWithPath:newAppDownloadPath hostBundle:hostBundle delegate:delegate synchronously:synchronously];
|
||||
[(isPackage ? [SUPackageInstaller class] : [SUPlainInstaller class]) performInstallationWithPath:newAppDownloadPath host:host delegate:delegate synchronously:synchronously versionComparator:comparator];
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)_mdimportBundle:(NSBundle *)bundle
|
||||
+ (void)_mdimportHost:(SUHost *)host
|
||||
{
|
||||
NSTask *mdimport = [[[NSTask alloc] init] autorelease];
|
||||
[mdimport setLaunchPath:@"/usr/bin/mdimport"];
|
||||
[mdimport setArguments:[NSArray arrayWithObject:[bundle bundlePath]]];
|
||||
[mdimport setArguments:[NSArray arrayWithObject:[host bundlePath]]];
|
||||
[mdimport launch];
|
||||
}
|
||||
|
||||
+ (void)_finishInstallationWithResult:(BOOL)result hostBundle:(NSBundle *)hostBundle error:(NSError *)error delegate:delegate
|
||||
+ (void)_finishInstallationWithResult:(BOOL)result host:(SUHost *)host error:(NSError *)error delegate:delegate
|
||||
{
|
||||
if (result == YES)
|
||||
{
|
||||
[self _mdimportBundle:hostBundle];
|
||||
if ([delegate respondsToSelector:@selector(installerFinishedForHostBundle:)])
|
||||
[delegate installerFinishedForHostBundle:hostBundle];
|
||||
[self _mdimportHost:host];
|
||||
if ([delegate respondsToSelector:@selector(installerFinishedForHost:)])
|
||||
[delegate installerFinishedForHost:host];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(installerForHostBundle:failedWithError:)])
|
||||
[delegate installerForHostBundle:hostBundle failedWithError:error];
|
||||
if ([delegate respondsToSelector:@selector(installerForHost:failedWithError:)])
|
||||
[delegate installerForHost:host failedWithError:error];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#import "SUPlainInstaller.h"
|
||||
|
||||
@interface SUPackageInstaller : SUPlainInstaller { }
|
||||
+ (void)installPath:(NSString *)path overHostBundle:(NSBundle *)bundle delegate:delegate;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
@implementation SUPackageInstaller
|
||||
|
||||
+ (void)installPath:(NSString *)path overHostBundle:(NSBundle *)bundle delegate:delegate
|
||||
+ (void)performInstallationWithPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator;
|
||||
{
|
||||
NSError *error = nil;
|
||||
BOOL result = YES;
|
||||
@@ -26,7 +26,7 @@
|
||||
NSTask *installer = [NSTask launchedTaskWithLaunchPath:installerPath arguments:[NSArray arrayWithObjects:path, nil]];
|
||||
[installer waitUntilExit];
|
||||
// Known bug: if the installation fails or is canceled, Sparkle goes ahead and restarts, thinking everything is fine.
|
||||
[self _finishInstallationWithResult:result hostBundle:bundle error:error delegate:delegate];
|
||||
[self _finishInstallationWithResult:result host:host error:error delegate:delegate];
|
||||
}
|
||||
|
||||
@end
|
||||
+10
-7
@@ -11,17 +11,21 @@
|
||||
|
||||
@implementation SUPipedUnarchiver
|
||||
|
||||
+ (SEL)_selectorConformingToTypeOfURL:(NSURL *)URL
|
||||
+ (SEL)_selectorConformingToTypeOfPath:(NSString *)path
|
||||
{
|
||||
static NSDictionary *typeSelectorDictionary;
|
||||
if (!typeSelectorDictionary)
|
||||
typeSelectorDictionary = [[NSDictionary dictionaryWithObjectsAndKeys:@"_extractZIP", @"public.zip-archive", @"_extractTGZ", @"org.gnu.gnu-zip-tar-archive", @"_extractTBZ", @"org.bzip.bzip2-tar-archive", @"_extractTAR", @"public.tar-archive", nil] retain];
|
||||
typeSelectorDictionary = [[NSDictionary dictionaryWithObjectsAndKeys:@"_extractZIP", @".zip", @"_extractTAR", @".tar",
|
||||
@"_extractTGZ", @".tar.gz", @"_extractTGZ", @".tgz",
|
||||
@"_extractTBZ", @".tar.bz2", @"_extractTBZ", @".tbz", nil] retain];
|
||||
|
||||
NSString *lastPathComponent = [path lastPathComponent];
|
||||
NSEnumerator *typeEnumerator = [typeSelectorDictionary keyEnumerator];
|
||||
id currentType;
|
||||
while ((currentType = [typeEnumerator nextObject]))
|
||||
{
|
||||
if ([URL conformsToType:currentType])
|
||||
if ([currentType length] > [lastPathComponent length]) continue;
|
||||
if ([[lastPathComponent substringFromIndex:[lastPathComponent length] - [currentType length]] isEqualToString:currentType])
|
||||
return NSSelectorFromString([typeSelectorDictionary objectForKey:currentType]);
|
||||
}
|
||||
return NULL;
|
||||
@@ -29,19 +33,18 @@
|
||||
|
||||
- (void)start
|
||||
{
|
||||
[NSThread detachNewThreadSelector:[[self class] _selectorConformingToTypeOfURL:archiveURL] toTarget:self withObject:nil];
|
||||
[NSThread detachNewThreadSelector:[[self class] _selectorConformingToTypeOfPath:archivePath] toTarget:self withObject:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)_canUnarchiveURL:(NSURL *)URL
|
||||
+ (BOOL)_canUnarchivePath:(NSString *)path
|
||||
{
|
||||
return ([self _selectorConformingToTypeOfURL:URL] != nil);
|
||||
return ([self _selectorConformingToTypeOfPath:path] != nil);
|
||||
}
|
||||
|
||||
// This method abstracts the types that use a command line tool piping data from stdin.
|
||||
- (void)_extractArchivePipingDataToCommand:(NSString *)command
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString *archivePath = [archiveURL path];
|
||||
FILE *fp = NULL, *cmdFP = NULL;
|
||||
|
||||
// Get the file size.
|
||||
|
||||
+3
-1
@@ -10,9 +10,11 @@
|
||||
#define SUPLAININSTALLER_H
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "SUInstaller.h"
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
|
||||
@interface SUPlainInstaller : SUInstaller { }
|
||||
+ (void)performInstallationWithPath:(NSString *)path hostBundle:(NSBundle *)hostBundle delegate:delegate synchronously:(BOOL)synchronously;
|
||||
+ (void)performInstallationWithPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator;
|
||||
@end
|
||||
|
||||
#endif
|
||||
+22
-9
@@ -7,32 +7,45 @@
|
||||
//
|
||||
|
||||
#import "SUPlainInstaller.h"
|
||||
#import "SUPlainInstallerInternals.h"
|
||||
|
||||
extern NSString *SUInstallerPathKey;
|
||||
extern NSString *SUInstallerHostBundleKey;
|
||||
extern NSString *SUInstallerDelegateKey;
|
||||
NSString *SUInstallerPathKey = @"SUInstallerPath";
|
||||
NSString *SUInstallerHostKey = @"SUInstallerHost";
|
||||
NSString *SUInstallerDelegateKey = @"SUInstallerDelegate";
|
||||
NSString *SUInstallerVersionComparatorKey = @"SUInstallerVersionComparator";
|
||||
|
||||
@implementation SUPlainInstaller
|
||||
|
||||
+ (void)installPath:(NSString *)path overHostBundle:(NSBundle *)bundle delegate:delegate
|
||||
+ (void)installPath:(NSString *)path overHost:(SUHost *)bundle delegate:delegate versionComparator:(id <SUVersionComparison>)comparator
|
||||
{
|
||||
NSError *error;
|
||||
BOOL result = [[NSFileManager defaultManager] copyPathWithAuthentication:path overPath:[bundle bundlePath] error:&error];
|
||||
[self _finishInstallationWithResult:result hostBundle:bundle error:error delegate:delegate];
|
||||
BOOL result = YES;
|
||||
|
||||
// Prevent malicious downgrades:
|
||||
if ([comparator compareVersion:[bundle 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.", [bundle version], [[NSBundle bundleWithPath:path] objectForInfoDictionaryKey:@"CFBundleVersion"]];
|
||||
result = NO;
|
||||
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUDowngradeError userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]];
|
||||
}
|
||||
|
||||
if (result)
|
||||
result = [self copyPathWithAuthentication:path overPath:[bundle bundlePath] error:&error];
|
||||
[self _finishInstallationWithResult:result host:bundle error:error delegate:delegate];
|
||||
}
|
||||
|
||||
+ (void)_performInstallationWithInfo:(NSDictionary *)info
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
[self installPath:[info objectForKey:SUInstallerPathKey] overHostBundle:[info objectForKey:SUInstallerHostBundleKey] delegate:[info objectForKey:SUInstallerDelegateKey]];
|
||||
[self installPath:[info objectForKey:SUInstallerPathKey] overHost:[info objectForKey:SUInstallerHostKey] delegate:[info objectForKey:SUInstallerDelegateKey] versionComparator:[info objectForKey:SUInstallerVersionComparatorKey]];
|
||||
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
+ (void)performInstallationWithPath:(NSString *)path hostBundle:(NSBundle *)hostBundle delegate:delegate synchronously:(BOOL)synchronously;
|
||||
+ (void)performInstallationWithPath:(NSString *)path host:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator
|
||||
{
|
||||
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:path, SUInstallerPathKey, hostBundle, SUInstallerHostBundleKey, delegate, SUInstallerDelegateKey, nil];
|
||||
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:path, SUInstallerPathKey, host, SUInstallerHostKey, delegate, SUInstallerDelegateKey, comparator, SUInstallerVersionComparatorKey, nil];
|
||||
if (synchronously)
|
||||
[self _performInstallationWithInfo:info];
|
||||
else
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// SUPlainInstallerInternals.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/9/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUPLAININSTALLERINTERNALS_H
|
||||
#define SUPLAININSTALLERINTERNALS_H
|
||||
|
||||
#import "SUPlainInstaller.h"
|
||||
|
||||
@interface SUPlainInstaller (Internals)
|
||||
+ (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,15 +1,13 @@
|
||||
//
|
||||
// NSFileManager+Authentication.m
|
||||
// SUPlainInstallerInternals.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/9/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
// This code based on generous contribution from Allan Odgaard. Thanks, Allan!
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "NSFileManager+Authentication.h"
|
||||
#import "SUPlainInstallerInternals.h"
|
||||
|
||||
#import <Security/Security.h>
|
||||
#import <sys/stat.h>
|
||||
@@ -17,7 +15,30 @@
|
||||
#import <dirent.h>
|
||||
#import <unistd.h>
|
||||
|
||||
#import "NSFileManager+ExtendedAttributes.h"
|
||||
@interface SUPlainInstaller (MMExtendedAttributes)
|
||||
// Removes the directory tree rooted at |root| from the file quarantine.
|
||||
// The quarantine was introduced on Mac OS X 10.5 and is described at:
|
||||
//
|
||||
// http://developer.apple.com/releasenotes/Carbon/RN-LaunchServices/index.html
|
||||
//#apple_ref/doc/uid/TP40001369-DontLinkElementID_2
|
||||
//
|
||||
// If |root| is not a directory, then it alone is removed from the quarantine.
|
||||
// Symbolic links, including |root| if it is a symbolic link, will not be
|
||||
// traversed.
|
||||
//
|
||||
// Ordinarily, the quarantine is managed by calling LSSetItemAttribute
|
||||
// to set the kLSItemQuarantineProperties attribute to a dictionary specifying
|
||||
// the quarantine properties to be applied. However, it does not appear to be
|
||||
// possible to remove an item from the quarantine directly through any public
|
||||
// Launch Services calls. Instead, this method takes advantage of the fact
|
||||
// that the quarantine is implemented in part by setting an extended attribute,
|
||||
// "com.apple.quarantine", on affected files. Removing this attribute is
|
||||
// sufficient to remove files from the quarantine.
|
||||
+ (void)releaseFromQuarantine:(NSString*)root;
|
||||
@end
|
||||
|
||||
// Authorization code based on generous contribution from Allan Odgaard. Thanks, Allan!
|
||||
|
||||
static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authorization, const char* executablePath, AuthorizationFlags options, const char* const* arguments)
|
||||
{
|
||||
sig_t oldSigChildHandler = signal(SIGCHLD, SIG_DFL);
|
||||
@@ -37,9 +58,9 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@implementation NSFileManager (SUAuthenticationAdditions)
|
||||
@implementation SUPlainInstaller (Internals)
|
||||
|
||||
- (BOOL)currentUserOwnsPath:(NSString *)oPath
|
||||
+ (BOOL)currentUserOwnsPath:(NSString *)oPath
|
||||
{
|
||||
const char *path = [oPath fileSystemRepresentation];
|
||||
uid_t uid = getuid();
|
||||
@@ -74,7 +95,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
return res;
|
||||
}
|
||||
|
||||
- (NSString *)_temporaryCopyNameForPath:(NSString *)path
|
||||
+ (NSString *)_temporaryCopyNameForPath:(NSString *)path
|
||||
{
|
||||
// Let's try to read the version number so the filename will be more meaningful.
|
||||
NSString *postFix;
|
||||
@@ -98,7 +119,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
return tempDir;
|
||||
}
|
||||
|
||||
- (BOOL)_copyPathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst error:(NSError **)error
|
||||
+ (BOOL)_copyPathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst error:(NSError **)error
|
||||
{
|
||||
NSString *tmp = [self _temporaryCopyNameForPath:dst];
|
||||
const char* srcPath = [src fileSystemRepresentation];
|
||||
@@ -199,7 +220,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
return res;
|
||||
}
|
||||
|
||||
- (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error
|
||||
+ (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error
|
||||
{
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:dst])
|
||||
{
|
||||
@@ -247,3 +268,72 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
#include <sys/xattr.h>
|
||||
|
||||
@implementation SUPlainInstaller (MMExtendedAttributes)
|
||||
|
||||
+ (int)removeXAttr:(const char*)name
|
||||
fromFile:(NSString*)file
|
||||
options:(int)options
|
||||
{
|
||||
typedef int (*removexattr_type)(const char*, const char*, int);
|
||||
// Reference removexattr directly, it's in the SDK.
|
||||
static removexattr_type removexattr_func = removexattr;
|
||||
|
||||
// Make sure that the symbol is present. This checks the deployment
|
||||
// target instead of the SDK so that it's able to catch dlsym failures
|
||||
// as well as the null symbol that would result from building with the
|
||||
// 10.4 SDK and a lower deployment target, and running on 10.3.
|
||||
if (!removexattr_func) {
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char* path = NULL;
|
||||
@try {
|
||||
path = [file fileSystemRepresentation];
|
||||
}
|
||||
@catch (id exception) {
|
||||
// -[NSString fileSystemRepresentation] throws an exception if it's
|
||||
// unable to convert the string to something suitable. Map that to
|
||||
// EDOM, "argument out of domain", which sort of conveys that there
|
||||
// was a conversion failure.
|
||||
errno = EDOM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return removexattr_func(path, name, options);
|
||||
}
|
||||
|
||||
+ (void)releaseFromQuarantine:(NSString*)root
|
||||
{
|
||||
const char* quarantineAttribute = "com.apple.quarantine";
|
||||
const int removeXAttrOptions = XATTR_NOFOLLOW;
|
||||
|
||||
[self removeXAttr:quarantineAttribute
|
||||
fromFile:root
|
||||
options:removeXAttrOptions];
|
||||
|
||||
// Only recurse if it's actually a directory. Don't recurse into a
|
||||
// root-level symbolic link.
|
||||
NSDictionary* rootAttributes =
|
||||
[[NSFileManager defaultManager] fileAttributesAtPath:root traverseLink:NO];
|
||||
NSString* rootType = [rootAttributes objectForKey:NSFileType];
|
||||
|
||||
if (rootType == NSFileTypeDirectory) {
|
||||
// The NSDirectoryEnumerator will avoid recursing into any contained
|
||||
// symbolic links, so no further type checks are needed.
|
||||
NSDirectoryEnumerator* directoryEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:root];
|
||||
NSString* file = nil;
|
||||
while ((file = [directoryEnumerator nextObject])) {
|
||||
[self removeXAttr:quarantineAttribute
|
||||
fromFile:[root stringByAppendingPathComponent:file]
|
||||
options:removeXAttrOptions];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -7,19 +7,23 @@
|
||||
//
|
||||
|
||||
#import "SUProbingUpdateDriver.h"
|
||||
|
||||
#import "SUUpdater.h"
|
||||
|
||||
@implementation SUProbingUpdateDriver
|
||||
|
||||
// Stop as soon as we have an answer! The superclasses will already have taken care of notifying the delegate.
|
||||
// Stop as soon as we have an answer! Since the superclass implementations are not called, we are responsible for notifying the delegate.
|
||||
|
||||
- (void)didFindValidUpdate
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
|
||||
[[updater delegate] updater:updater didFindValidUpdate:updateItem];
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)])
|
||||
[[updater delegate] updaterDidNotFindUpdate:updater];
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
|
||||
Generated
+9
-1
@@ -4,6 +4,14 @@
|
||||
<dict>
|
||||
<key>IBClasses</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>SUWindowController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSWindowController</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSApplication</string>
|
||||
@@ -39,7 +47,7 @@
|
||||
<string>NSProgressIndicator</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSWindowController</string>
|
||||
<string>SUWindowController</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IBVersion</key>
|
||||
|
||||
Generated
+3
-3
@@ -3,9 +3,9 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>629</string>
|
||||
<string>670</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../Sparkle.xcodeproj</string>
|
||||
<string>Sparkle.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
@@ -13,7 +13,7 @@
|
||||
<integer>6</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9C31</string>
|
||||
<string>10A96</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
|
||||
Generated
BIN
Binary file not shown.
@@ -11,15 +11,16 @@
|
||||
|
||||
#import "SUWindowController.h"
|
||||
|
||||
@class SUHost;
|
||||
@interface SUStatusController : SUWindowController {
|
||||
double progressValue, maxProgressValue;
|
||||
NSString *title, *statusText, *buttonTitle;
|
||||
IBOutlet NSButton *actionButton;
|
||||
IBOutlet NSProgressIndicator* progressBar;
|
||||
NSBundle *hostBundle;
|
||||
SUHost *host;
|
||||
}
|
||||
|
||||
- (id)initWithHostBundle:(NSBundle *)hostBundle;
|
||||
- (id)initWithHost:(SUHost *)host;
|
||||
|
||||
// Pass 0 for the max progress value to get an indeterminate progress bar.
|
||||
// Pass nil for the status text to not show it.
|
||||
|
||||
+15
-7
@@ -11,12 +11,12 @@
|
||||
|
||||
@implementation SUStatusController
|
||||
|
||||
- (id)initWithHostBundle:(NSBundle *)hb
|
||||
- (id)initWithHost:(SUHost *)aHost
|
||||
{
|
||||
self = [super initWithHostBundle:hb windowNibName:@"SUStatus"];
|
||||
self = [super initWithHost:aHost windowNibName:@"SUStatus"];
|
||||
if (self)
|
||||
{
|
||||
hostBundle = [hb retain];
|
||||
host = [aHost retain];
|
||||
[self setShouldCascadeWindows:NO];
|
||||
}
|
||||
return self;
|
||||
@@ -24,13 +24,15 @@
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[hostBundle release];
|
||||
[host release];
|
||||
[title release];
|
||||
[statusText release];
|
||||
[buttonTitle release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; }
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[[self window] center];
|
||||
@@ -40,12 +42,12 @@
|
||||
|
||||
- (NSString *)windowTitle
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"Updating %@", nil), [hostBundle name]];
|
||||
return [NSString stringWithFormat:SULocalizedString(@"Updating %@", nil), [host name]];
|
||||
}
|
||||
|
||||
- (NSImage *)applicationIcon
|
||||
{
|
||||
return [hostBundle icon];
|
||||
return [host icon];
|
||||
}
|
||||
|
||||
- (void)beginActionWithTitle:(NSString *)aTitle maxProgressValue:(double)aMaxProgressValue statusText:(NSString *)aStatusText
|
||||
@@ -82,6 +84,11 @@
|
||||
[actionButton setKeyEquivalent:isDefault ? @"\r" : @""];
|
||||
}
|
||||
|
||||
- (BOOL)progressBarShouldAnimate
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)setButtonEnabled:(BOOL)enabled
|
||||
{
|
||||
[actionButton setEnabled:enabled];
|
||||
@@ -104,9 +111,10 @@
|
||||
|
||||
- (void)setMaxProgressValue:(double)value
|
||||
{
|
||||
if (value < 0) value = 0;
|
||||
maxProgressValue = value;
|
||||
[self setProgressValue:0];
|
||||
[progressBar setIndeterminate:(value == 0)];
|
||||
[progressBar startAnimation:self];
|
||||
}
|
||||
|
||||
- (void)setStatusText:(NSString *)aStatusText
|
||||
|
||||
+2
-1
@@ -9,9 +9,10 @@
|
||||
#ifndef SUSYSTEMPROFILER_H
|
||||
#define SUSYSTEMPROFILER_H
|
||||
|
||||
@class SUHost;
|
||||
@interface SUSystemProfiler : NSObject {}
|
||||
+ (SUSystemProfiler *)sharedSystemProfiler;
|
||||
- (NSMutableArray *)systemProfileArrayForHostBundle:(NSBundle *)hostBundle;
|
||||
- (NSMutableArray *)systemProfileArrayForHost:(SUHost *)host;
|
||||
@end
|
||||
|
||||
#endif
|
||||
+20
-8
@@ -7,9 +7,9 @@
|
||||
// Adapted from Sparkle+, by Tom Harrington.
|
||||
//
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "SUSystemProfiler.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
#import <sys/sysctl.h>
|
||||
|
||||
@implementation SUSystemProfiler
|
||||
@@ -27,19 +27,19 @@
|
||||
return [[[NSDictionary alloc] initWithContentsOfFile:path] autorelease];
|
||||
}
|
||||
|
||||
- (NSMutableArray *)systemProfileArrayForHostBundle:(NSBundle *)hostBundle
|
||||
- (NSMutableArray *)systemProfileArrayForHost:(SUHost *)host
|
||||
{
|
||||
NSDictionary *modelTranslation = [self modelTranslationTable];
|
||||
|
||||
// Gather profile information and append it to the URL.
|
||||
NSMutableArray *profileArray = [NSMutableArray array];
|
||||
NSArray *profileDictKeys = [NSArray arrayWithObjects:@"key", @"visibleKey", @"value", @"visibleValue", nil];
|
||||
NSArray *profileDictKeys = [NSArray arrayWithObjects:@"key", @"displayKey", @"value", @"displayValue", nil];
|
||||
int error = 0 ;
|
||||
int value = 0 ;
|
||||
unsigned long length = sizeof(value) ;
|
||||
|
||||
// OS version
|
||||
NSString *currentSystemVersion = [NSWorkspace systemVersionString];
|
||||
NSString *currentSystemVersion = [SUHost systemVersionString];
|
||||
if (currentSystemVersion != nil)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"osVersion",@"OS Version",currentSystemVersion,currentSystemVersion,nil] forKeys:profileDictKeys]];
|
||||
|
||||
@@ -56,12 +56,24 @@
|
||||
}
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cputype",@"CPU Type", [NSNumber numberWithInt:value], visibleCPUType,nil] forKeys:profileDictKeys]];
|
||||
}
|
||||
error = sysctlbyname("hw.cpu64bit_capable", &value, &length, NULL, 0);
|
||||
if(error != 0)
|
||||
error = sysctlbyname("hw.optional.x86_64", &value, &length, NULL, 0); //x86 specific
|
||||
if(error != 0)
|
||||
error = sysctlbyname("hw.optional.64bitops", &value, &length, NULL, 0); //PPC specific
|
||||
|
||||
BOOL is64bit = NO;
|
||||
|
||||
if (error == 0) {
|
||||
is64bit = value == 1;
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpu64bit", @"CPU is 64-Bit?", [NSNumber numberWithBool:is64bit], is64bit ? @"Yes" : @"No", nil] forKeys:profileDictKeys]];
|
||||
}
|
||||
error = sysctlbyname("hw.cpusubtype", &value, &length, NULL, 0);
|
||||
if (error == 0) {
|
||||
NSString *visibleCPUSubType;
|
||||
if (cpuType == 7) {
|
||||
// Intel
|
||||
visibleCPUSubType = @"Intel"; // If anyone knows how to tell a Core Duo from a Core Solo, please email tph@atomicbird.com
|
||||
visibleCPUSubType = is64bit ? @"Intel Core 2" : @"Intel Core"; // If anyone knows how to tell a Core Duo from a Core Solo, please email tph@atomicbird.com
|
||||
} else if (cpuType == 18) {
|
||||
// PowerPC
|
||||
switch(value) {
|
||||
@@ -103,10 +115,10 @@
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"lang",@"Preferred Language", [languages objectAtIndex:0], [languages objectAtIndex:0],nil] forKeys:profileDictKeys]];
|
||||
|
||||
// Application sending the request
|
||||
NSString *appName = [hostBundle name];
|
||||
NSString *appName = [host name];
|
||||
if (appName)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"appName",@"Application Name", appName, appName,nil] forKeys:profileDictKeys]];
|
||||
NSString *appVersion = [hostBundle version];
|
||||
NSString *appVersion = [host version];
|
||||
if (appVersion)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"appVersion",@"Application Version", appVersion, appVersion,nil] forKeys:profileDictKeys]];
|
||||
|
||||
@@ -116,7 +128,7 @@
|
||||
SInt32 gestaltInfo;
|
||||
err = Gestalt(gestaltProcClkSpeedMHz,&gestaltInfo);
|
||||
if (err == noErr)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpuFreqMHz",@"CPU Speed (MHz)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithInt:gestaltInfo],nil] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpuFreqMHz",@"CPU Speed (GHz)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithDouble:gestaltInfo/1000.0],nil] forKeys:profileDictKeys]];
|
||||
|
||||
// amount of RAM
|
||||
err = Gestalt(gestaltPhysicalRAMSizeInMegabytes,&gestaltInfo);
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
SUUpdateAlert *updateAlert;
|
||||
}
|
||||
|
||||
- (void)showModalAlert:(NSAlert *)alert;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
+55
-21
@@ -7,18 +7,29 @@
|
||||
//
|
||||
|
||||
#import "SUUIBasedUpdateDriver.h"
|
||||
#import "Sparkle.h"
|
||||
#import "NSNumber+Units.h"
|
||||
|
||||
#import "SUUpdateAlert.h"
|
||||
#import "SUHost.h"
|
||||
#import "SUStatusController.h"
|
||||
|
||||
@implementation SUUIBasedUpdateDriver
|
||||
|
||||
- (void)didFindValidUpdate
|
||||
{
|
||||
updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem hostBundle:hostBundle];
|
||||
updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem host:host];
|
||||
[updateAlert setDelegate:self];
|
||||
|
||||
// If the app is a menubar app or the like, we need to focus it first:
|
||||
if ([[hostBundle objectForInfoDictionaryKey:@"LSUIElement"] doubleValue]) { [NSApp activateIgnoringOtherApps:YES]; }
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
|
||||
[[updater delegate] updater:updater didFindValidUpdate:updateItem];
|
||||
|
||||
// If the app is a menubar app or the like, we need to focus it first and alter the
|
||||
// update prompt to behave like a normal window. Otherwise if the window were hidden
|
||||
// there may be no way for the application to be activated to make it visible again.
|
||||
if ([host isBackgroundApplication])
|
||||
{
|
||||
[[updateAlert window] setHidesOnDeactivate:NO];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
// Only show the update alert if the app is active; otherwise, we'll wait until it is.
|
||||
if ([NSApp isActive])
|
||||
@@ -29,11 +40,10 @@
|
||||
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(didNotFindUpdateToHostBundle:)])
|
||||
[delegate didNotFindUpdateToHostBundle:hostBundle];
|
||||
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), [hostBundle name], [hostBundle displayVersion]];
|
||||
[alert setIcon:[hostBundle icon]];
|
||||
[alert runModal];
|
||||
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];
|
||||
}
|
||||
|
||||
@@ -46,21 +56,19 @@
|
||||
- (void)updateAlert:(SUUpdateAlert *)alert finishedWithChoice:(SUUpdateAlertChoice)choice
|
||||
{
|
||||
[updateAlert release]; updateAlert = nil;
|
||||
if ([delegate respondsToSelector:@selector(userChoseAction:forUpdate:toHostBundle:)])
|
||||
[delegate userChoseAction:choice forUpdate:updateItem toHostBundle:hostBundle];
|
||||
[[SUUserDefaults standardUserDefaults] setObject:nil forKey:SUSkippedVersionKey];
|
||||
[host setObject:nil forUserDefaultsKey:SUSkippedVersionKey];
|
||||
switch (choice)
|
||||
{
|
||||
case SUInstallUpdateChoice:
|
||||
statusController = [[SUStatusController alloc] initWithHostBundle:hostBundle];
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Downloading update\u2026", nil) maxProgressValue:0 statusText:nil];
|
||||
statusController = [[SUStatusController alloc] initWithHost:host];
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Downloading update...", @"Take care not to overflow the status window.") maxProgressValue:0 statusText:nil];
|
||||
[statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelDownload:) isDefault:NO];
|
||||
[statusController showWindow:self];
|
||||
[self downloadUpdate];
|
||||
break;
|
||||
|
||||
case SUSkipThisVersionChoice:
|
||||
[[SUUserDefaults standardUserDefaults] setObject:[updateItem versionString] forKey:SUSkippedVersionKey];
|
||||
[host setObject:[updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey];
|
||||
case SURemindMeLaterChoice:
|
||||
[self abortUpdate];
|
||||
break;
|
||||
@@ -72,10 +80,27 @@
|
||||
[statusController setMaxProgressValue:[response expectedContentLength]];
|
||||
}
|
||||
|
||||
- (NSString *)_humanReadableSizeFromDouble:(double)value
|
||||
{
|
||||
if (value < 1024)
|
||||
return [NSString stringWithFormat:@"%.0lf %@", value, SULocalizedString(@"B", @"the unit for bytes")];
|
||||
|
||||
if (value < 1024 * 1024)
|
||||
return [NSString stringWithFormat:@"%.0lf %@", value / 1024.0, SULocalizedString(@"KB", @"the unit for kilobytes")];
|
||||
|
||||
if (value < 1024 * 1024 * 1024)
|
||||
return [NSString stringWithFormat:@"%.1lf %@", value / 1024.0 / 1024.0, SULocalizedString(@"MB", @"the unit for megabytes")];
|
||||
|
||||
return [NSString stringWithFormat:@"%.2lf %@", value / 1024.0 / 1024.0 / 1024.0, SULocalizedString(@"GB", @"the unit for gigabytes")];
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)download didReceiveDataOfLength:(NSUInteger)length
|
||||
{
|
||||
[statusController setProgressValue:[statusController progressValue] + length];
|
||||
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ of %@", nil), [NSNumber humanReadableSizeFromDouble:[statusController progressValue]], [NSNumber humanReadableSizeFromDouble:[statusController maxProgressValue]]]];
|
||||
if ([statusController maxProgressValue] > 0)
|
||||
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ of %@", nil), [self _humanReadableSizeFromDouble:[statusController progressValue]], [self _humanReadableSizeFromDouble:[statusController maxProgressValue]]]];
|
||||
else
|
||||
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ downloaded", nil), [self _humanReadableSizeFromDouble:[statusController progressValue]]]];
|
||||
}
|
||||
|
||||
- (IBAction)cancelDownload:sender
|
||||
@@ -88,7 +113,7 @@
|
||||
- (void)extractUpdate
|
||||
{
|
||||
// Now we have to extract the downloaded archive.
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Extracting update\u2026", nil) maxProgressValue:0 statusText:nil];
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Extracting update...", @"Take care not to overflow the status window.") maxProgressValue:0 statusText:nil];
|
||||
[statusController setButtonEnabled:NO];
|
||||
[super extractUpdate];
|
||||
}
|
||||
@@ -114,7 +139,7 @@
|
||||
|
||||
- (void)installUpdate
|
||||
{
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Installing update\u2026", nil) maxProgressValue:0 statusText:nil];
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"Take care not to overflow the status window.") maxProgressValue:0 statusText:nil];
|
||||
[statusController setButtonEnabled:NO];
|
||||
[super installUpdate];
|
||||
}
|
||||
@@ -122,8 +147,7 @@
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:SULocalizedString(@"Update Error!", nil) defaultButton:SULocalizedString(@"Cancel Update", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:[error localizedDescription]];
|
||||
[alert setIcon:[hostBundle icon]];
|
||||
[alert runModal];
|
||||
[self showModalAlert:alert];
|
||||
[super abortUpdateWithError:error];
|
||||
}
|
||||
|
||||
@@ -137,4 +161,14 @@
|
||||
[super abortUpdate];
|
||||
}
|
||||
|
||||
- (void)showModalAlert:(NSAlert *)alert
|
||||
{
|
||||
// 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];
|
||||
}
|
||||
|
||||
@end
|
||||
+2
-2
@@ -11,10 +11,10 @@
|
||||
|
||||
@interface SUUnarchiver : NSObject {
|
||||
id delegate;
|
||||
NSURL *archiveURL;
|
||||
NSString *archivePath;
|
||||
}
|
||||
|
||||
+ (SUUnarchiver *)unarchiverForURL:(NSURL *)URL;
|
||||
+ (SUUnarchiver *)unarchiverForPath:(NSString *)path;
|
||||
- (void)setDelegate:delegate;
|
||||
|
||||
- (void)start;
|
||||
|
||||
+5
-3
@@ -15,18 +15,20 @@
|
||||
|
||||
extern NSMutableArray *__unarchiverImplementations;
|
||||
|
||||
+ (SUUnarchiver *)unarchiverForURL:(NSURL *)URL
|
||||
+ (SUUnarchiver *)unarchiverForPath:(NSString *)path
|
||||
{
|
||||
NSEnumerator *implementationEnumerator = [[self _unarchiverImplementations] objectEnumerator];
|
||||
id current;
|
||||
while ((current = [implementationEnumerator nextObject]))
|
||||
{
|
||||
if ([current _canUnarchiveURL:URL])
|
||||
return [[[current alloc] _initWithURL:URL] autorelease];
|
||||
if ([current _canUnarchivePath:path])
|
||||
return [[[current alloc] _initWithPath:path] autorelease];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], archivePath]; }
|
||||
|
||||
- (void)setDelegate:del
|
||||
{
|
||||
delegate = del;
|
||||
|
||||
@@ -15,16 +15,12 @@
|
||||
@interface SUUnarchiver (Private)
|
||||
+ (void)_registerImplementation:(Class)implementation;
|
||||
+ (NSArray *)_unarchiverImplementations;
|
||||
+ (BOOL)_canUnarchiveURL:(NSURL *)URL;
|
||||
- _initWithURL:(NSURL *)URL;
|
||||
+ (BOOL)_canUnarchivePath:(NSString *)path;
|
||||
- _initWithPath:(NSString *)path;
|
||||
|
||||
- (void)_notifyDelegateOfExtractedLength:(long)length;
|
||||
- (void)_notifyDelegateOfSuccess;
|
||||
- (void)_notifyDelegateOfFailure;
|
||||
@end
|
||||
|
||||
@interface NSURL (SUTypeDetection)
|
||||
- (BOOL)conformsToType:(NSString *)type;
|
||||
@end
|
||||
|
||||
#endif
|
||||
+4
-21
@@ -10,20 +10,20 @@
|
||||
|
||||
@implementation SUUnarchiver (Private)
|
||||
|
||||
- _initWithURL:(NSURL *)URL
|
||||
- _initWithPath:(NSString *)path
|
||||
{
|
||||
if ((self = [super init]))
|
||||
archiveURL = [URL copy];
|
||||
archivePath = [path copy];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[archiveURL release];
|
||||
[archivePath release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
+ (BOOL)_canUnarchiveURL:(NSURL *)URL
|
||||
+ (BOOL)_canUnarchivePath:(NSString *)path
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
@@ -61,20 +61,3 @@ static NSMutableArray *__unarchiverImplementations;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSURL (SUTypeDetection)
|
||||
- (NSString *)__UTI
|
||||
{
|
||||
FSRef fsRefToItem;
|
||||
FSPathMakeRef((UInt8 *)[[self path] fileSystemRepresentation], &fsRefToItem, NULL );
|
||||
|
||||
NSString *UTI = nil;
|
||||
LSCopyItemAttribute(&fsRefToItem, kLSRolesAll, kLSItemContentType, (CFTypeRef *)(&UTI));
|
||||
return [UTI autorelease];
|
||||
}
|
||||
|
||||
- (BOOL)conformsToType:(NSString *)type
|
||||
{
|
||||
return UTTypeConformsTo((CFStringRef)[self __UTI], (CFStringRef)type);
|
||||
}
|
||||
@end
|
||||
+3
-3
@@ -18,10 +18,10 @@ typedef enum
|
||||
SUSkipThisVersionChoice
|
||||
} SUUpdateAlertChoice;
|
||||
|
||||
@class WebView, SUAppcastItem;
|
||||
@class WebView, SUAppcastItem, SUHost;
|
||||
@interface SUUpdateAlert : SUWindowController {
|
||||
SUAppcastItem *updateItem;
|
||||
NSBundle *hostBundle;
|
||||
SUHost *host;
|
||||
id delegate;
|
||||
|
||||
IBOutlet WebView *releaseNotesView;
|
||||
@@ -30,7 +30,7 @@ typedef enum
|
||||
BOOL webViewFinishedLoading;
|
||||
}
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle;
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)host;
|
||||
- (void)setDelegate:delegate;
|
||||
|
||||
- (IBAction)installUpdate:sender;
|
||||
|
||||
+35
-17
@@ -6,29 +6,31 @@
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "SUUpdateAlert.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
@implementation SUUpdateAlert
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost
|
||||
{
|
||||
self = [super initWithHostBundle:hb windowNibName:@"SUUpdateAlert"];
|
||||
self = [super initWithHost:host windowNibName:@"SUUpdateAlert"];
|
||||
if (self)
|
||||
{
|
||||
hostBundle = [hb retain];
|
||||
host = [aHost retain];
|
||||
updateItem = [item retain];
|
||||
[self setShouldCascadeWindows:NO];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; }
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[updateItem release];
|
||||
[hostBundle release];
|
||||
[host release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -59,8 +61,11 @@
|
||||
|
||||
- (void)displayReleaseNotes
|
||||
{
|
||||
[[WebPreferences standardPreferences] setStandardFontFamily:[[NSFont systemFontOfSize:8] familyName]];
|
||||
[releaseNotesView setPreferences:[WebPreferences standardPreferences]];
|
||||
// Set the default font, but avoid polluting the standard preferences.
|
||||
WebPreferences *preferences = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:[WebPreferences standardPreferences]]];
|
||||
[preferences setStandardFontFamily:[[NSFont systemFontOfSize:8] familyName]];
|
||||
[preferences setDefaultFontSize:(int)[NSFont systemFontSizeForControlSize:NSSmallControlSize]];
|
||||
[releaseNotesView setPreferences:preferences];
|
||||
[releaseNotesView setFrameLoadDelegate:self];
|
||||
[releaseNotesView setPolicyDelegate:self];
|
||||
|
||||
@@ -75,17 +80,24 @@
|
||||
// If there's a release notes URL, load it; otherwise, just stick the contents of the description into the web view.
|
||||
if ([updateItem releaseNotesURL])
|
||||
{
|
||||
[[releaseNotesView mainFrame] loadRequest:[NSURLRequest requestWithURL:[updateItem releaseNotesURL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30]];
|
||||
if ([[updateItem releaseNotesURL] isFileURL])
|
||||
{
|
||||
[[releaseNotesView mainFrame] loadHTMLString:@"Release notes with file:// URLs are not supported for security reasons—Javascript would be able to read files on your file system." baseURL:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[releaseNotesView mainFrame] loadRequest:[NSURLRequest requestWithURL:[updateItem releaseNotesURL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[[releaseNotesView mainFrame] loadHTMLString:[updateItem description] baseURL:nil];
|
||||
[[releaseNotesView mainFrame] loadHTMLString:[updateItem itemDescription] baseURL:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)showsReleaseNotes
|
||||
{
|
||||
NSNumber *shouldShowReleaseNotes = [hostBundle objectForInfoDictionaryKey:SUShowReleaseNotesKey];
|
||||
NSNumber *shouldShowReleaseNotes = [host objectForInfoDictionaryKey:SUShowReleaseNotesKey];
|
||||
if (shouldShowReleaseNotes == nil)
|
||||
return YES; // defaults to YES
|
||||
else
|
||||
@@ -94,11 +106,9 @@
|
||||
|
||||
- (BOOL)allowsAutomaticUpdates
|
||||
{
|
||||
if (![[hostBundle objectForInfoDictionaryKey:SUExpectsDSASignatureKey] boolValue])
|
||||
return NO; // Automatic updating requires DSA-signed updates
|
||||
if (![hostBundle objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey])
|
||||
if (![host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey])
|
||||
return YES; // defaults to YES
|
||||
return [[hostBundle objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] boolValue];
|
||||
return [host boolForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
@@ -140,17 +150,25 @@
|
||||
|
||||
- (NSImage *)applicationIcon
|
||||
{
|
||||
return [hostBundle icon];
|
||||
return [host icon];
|
||||
}
|
||||
|
||||
- (NSString *)titleText
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"A new version of %@ is available!", nil), [hostBundle name]];
|
||||
return [NSString stringWithFormat:SULocalizedString(@"A new version of %@ is available!", nil), [host name]];
|
||||
}
|
||||
|
||||
- (NSString *)descriptionText
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available\u2014you have %@. Would you like to download it now?", nil), [hostBundle name], [updateItem displayVersionString], [hostBundle displayVersion]];
|
||||
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])
|
||||
{
|
||||
updateItemVersion = [updateItemVersion stringByAppendingFormat:@" (%@)", [updateItem versionString]];
|
||||
hostVersion = [hostVersion stringByAppendingFormat:@" (%@)", [host version]];
|
||||
}
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available--you have %@. Would you like to download it now?", nil), [host name], updateItemVersion, hostVersion];
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)sender didFinishLoadForFrame:frame
|
||||
|
||||
+10
-4
@@ -11,17 +11,23 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
extern NSString *SUUpdateDriverFinishedNotification;
|
||||
|
||||
@class SUHost, SUUpdater;
|
||||
@interface SUUpdateDriver : NSObject
|
||||
{
|
||||
SUHost *host;
|
||||
SUUpdater *updater;
|
||||
NSURL *appcastURL;
|
||||
|
||||
BOOL finished;
|
||||
id delegate;
|
||||
}
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb;
|
||||
|
||||
- initWithUpdater:(SUUpdater *)updater;
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
|
||||
- (void)abortUpdate;
|
||||
- (BOOL)finished;
|
||||
|
||||
- delegate;
|
||||
- (void)setDelegate:delegate;
|
||||
@end
|
||||
|
||||
#endif
|
||||
+22
-4
@@ -8,19 +8,37 @@
|
||||
|
||||
#import "SUUpdateDriver.h"
|
||||
|
||||
NSString *SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
|
||||
|
||||
@implementation SUUpdateDriver
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb
|
||||
- initWithUpdater:(SUUpdater *)anUpdater
|
||||
{
|
||||
[NSException raise:@"SUAbstractDriverError" format:@"Don't use SUUpdateDriver directly; use a subclass."];
|
||||
if ((self = [super init]))
|
||||
updater = anUpdater;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; }
|
||||
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)h
|
||||
{
|
||||
appcastURL = [URL copy];
|
||||
host = [h retain];
|
||||
}
|
||||
|
||||
- (void)abortUpdate
|
||||
{
|
||||
[self setValue:[NSNumber numberWithBool:YES] forKey:@"finished"];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdateDriverFinishedNotification object:self];
|
||||
}
|
||||
|
||||
- (BOOL)finished { return finished; }
|
||||
- delegate { return delegate; }
|
||||
- (void)setDelegate:del { delegate = del; }
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[host release];
|
||||
[appcastURL release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -9,22 +9,24 @@
|
||||
#ifndef SUUPDATEPERMISSIONPROMPT_H
|
||||
#define SUUPDATEPERMISSIONPROMPT_H
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "SUWindowController.h"
|
||||
|
||||
typedef enum {
|
||||
SUAutomaticallyCheck,
|
||||
SUDoNotAutomaticallyCheck
|
||||
} SUPermissionPromptResult;
|
||||
|
||||
@class SUHost;
|
||||
@interface SUUpdatePermissionPrompt : SUWindowController {
|
||||
NSBundle *hostBundle;
|
||||
SUHost *host;
|
||||
NSArray *systemProfileInformationArray;
|
||||
id delegate;
|
||||
IBOutlet NSTextField *descriptionTextField;
|
||||
IBOutlet NSView *moreInfoView;
|
||||
IBOutlet NSButton *moreInfoButton;
|
||||
BOOL isShowingMoreInfo, shouldSendProfile;
|
||||
}
|
||||
+ (void)promptWithHostBundle:(NSBundle *)hb delegate:(id)d;
|
||||
+ (void)promptWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id)d;
|
||||
- (IBAction)toggleMoreInfo:(id)sender;
|
||||
- (IBAction)finishPrompt:(id)sender;
|
||||
@end
|
||||
|
||||
+21
-16
@@ -8,34 +8,43 @@
|
||||
|
||||
#import "SUUpdatePermissionPrompt.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
|
||||
@implementation SUUpdatePermissionPrompt
|
||||
|
||||
- (BOOL)shouldAskAboutProfile
|
||||
{
|
||||
return [[hostBundle objectForInfoDictionaryKey:SUEnableSystemProfilingKey] boolValue];
|
||||
return [[host objectForInfoDictionaryKey:SUEnableSystemProfilingKey] boolValue];
|
||||
}
|
||||
|
||||
- (id)initWithHostBundle:(NSBundle *)hb delegate:(id)d
|
||||
- (id)initWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id)d
|
||||
{
|
||||
self = [super initWithHostBundle:hb windowNibName:@"SUUpdatePermissionPrompt"];
|
||||
self = [super initWithHost:aHost windowNibName:@"SUUpdatePermissionPrompt"];
|
||||
if (self)
|
||||
{
|
||||
hostBundle = [hb retain];
|
||||
delegate = [d retain];
|
||||
host = [aHost retain];
|
||||
delegate = d;
|
||||
isShowingMoreInfo = NO;
|
||||
shouldSendProfile = [self shouldAskAboutProfile];
|
||||
systemProfileInformationArray = [profile retain];
|
||||
[self setShouldCascadeWindows:NO];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (void)promptWithHostBundle:(NSBundle *)hb delegate:(id)d
|
||||
+ (void)promptWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id)d
|
||||
{
|
||||
id prompt = [[[self class] alloc] initWithHostBundle:hb delegate:d];
|
||||
// If this is a background application we need to focus it in order to bring the prompt
|
||||
// to the user's attention. Otherwise the prompt would be hidden behind other applications and
|
||||
// the user would not know why the application was paused.
|
||||
if ([aHost isBackgroundApplication]) { [NSApp activateIgnoringOtherApps:YES]; }
|
||||
|
||||
id prompt = [[[self class] alloc] initWithHost:aHost systemProfile:profile delegate:d];
|
||||
[NSApp runModalForWindow:[prompt window]];
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [host bundlePath]]; }
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
if (![self shouldAskAboutProfile])
|
||||
@@ -48,23 +57,19 @@
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[hostBundle release];
|
||||
[host release];
|
||||
[systemProfileInformationArray release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSImage *)icon
|
||||
{
|
||||
return [hostBundle icon];
|
||||
return [host icon];
|
||||
}
|
||||
|
||||
- (NSString *)promptDescription
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu.", nil), [hostBundle name]];
|
||||
}
|
||||
|
||||
- (NSArray *)systemProfileInformationArray
|
||||
{
|
||||
return [[SUSystemProfiler sharedSystemProfiler] systemProfileArrayForHostBundle:hostBundle];
|
||||
return [NSString stringWithFormat:SULocalizedString(@"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu.", nil), [host name]];
|
||||
}
|
||||
|
||||
- (IBAction)toggleMoreInfo:(id)sender
|
||||
@@ -116,7 +121,7 @@
|
||||
{
|
||||
if (![delegate respondsToSelector:@selector(updatePermissionPromptFinishedWithResult:)])
|
||||
[NSException raise:@"SUInvalidDelegate" format:@"SUUpdatePermissionPrompt's delegate (%@) doesn't respond to updatePermissionPromptFinishedWithResult:!", delegate];
|
||||
[[SUUserDefaults standardUserDefaults] setBool:shouldSendProfile forKey:SUSendProfileInfoKey];
|
||||
[host setBool:shouldSendProfile forUserDefaultsKey:SUSendProfileInfoKey];
|
||||
[delegate updatePermissionPromptFinishedWithResult:([sender tag] == 1 ? SUAutomaticallyCheck : SUDoNotAutomaticallyCheck)];
|
||||
[[self window] close];
|
||||
[NSApp stopModal];
|
||||
|
||||
+50
-26
@@ -9,72 +9,96 @@
|
||||
#ifndef SUUPDATER_H
|
||||
#define SUUPDATER_H
|
||||
|
||||
#import "SUUpdateAlert.h"
|
||||
#import <Sparkle/SUVersionComparisonProtocol.h>
|
||||
|
||||
@class SUUpdateDriver, SUAppcastItem, SUAppcast;
|
||||
@class SUUpdateDriver, SUAppcastItem, SUHost, SUAppcast;
|
||||
@interface SUUpdater : NSObject {
|
||||
NSTimer *checkTimer;
|
||||
SUUpdateDriver *driver;
|
||||
|
||||
NSBundle *hostBundle;
|
||||
SUHost *host;
|
||||
IBOutlet id delegate;
|
||||
}
|
||||
|
||||
+ (SUUpdater *)sharedUpdater;
|
||||
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
|
||||
- (NSBundle *)hostBundle;
|
||||
|
||||
- (void)setDelegate:(id)delegate;
|
||||
- delegate;
|
||||
|
||||
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
|
||||
- (BOOL)automaticallyChecksForUpdates;
|
||||
|
||||
- (void)setUpdateCheckInterval:(NSTimeInterval)interval;
|
||||
- (NSTimeInterval)updateCheckInterval;
|
||||
|
||||
- (void)setFeedURL:(NSURL *)feedURL;
|
||||
- (NSURL *)feedURL;
|
||||
|
||||
- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile;
|
||||
- (BOOL)sendsSystemProfile;
|
||||
|
||||
- (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyDownloadsUpdates;
|
||||
- (BOOL)automaticallyDownloadsUpdates;
|
||||
|
||||
// This IBAction is meant for a main menu item. Hook up any menu item to this action,
|
||||
// and Sparkle will check for updates and report back its findings verbosely.
|
||||
- (IBAction)checkForUpdates:sender;
|
||||
|
||||
// This forces an update to begin with a particular driver (see SU*UpdateDriver.h)
|
||||
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)driver;
|
||||
// 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;
|
||||
|
||||
// For non-.app updates:
|
||||
// Call this when your bundle is loaded to tell Sparkle what to update.
|
||||
- (void)setHostBundle:(NSBundle *)hostBundle;
|
||||
// Date of last update check. Returns null if no check has been performed.
|
||||
- (NSDate*)lastUpdateCheckDate;
|
||||
|
||||
// Call this to appropriately reschedule or cancel the update checking timer if preferences for time interval or automatic checks change.
|
||||
// If you're using a .app, this'll be picked up automatically via NSUserDefaultsController, but for non-.apps, there's no way to observe changes.
|
||||
- (void)updatePreferencesChanged;
|
||||
// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though,
|
||||
// (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI.
|
||||
- (void)checkForUpdateInformation;
|
||||
|
||||
// Call this to appropriately schedule or cancel the update checking timer according to the preferences for time interval and automatic checks. This call does not change the date of the next check, but only the internal NSTimer.
|
||||
- (void)resetUpdateCycle;
|
||||
|
||||
- (BOOL)updateInProgress;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (SUUpdaterDelegateInformalProtocol)
|
||||
// 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 the following keys:
|
||||
- (NSArray *)feedParametersForHostBundle:(NSBundle *)bundle sendingSystemProfile:(BOOL)sendingProfile;
|
||||
// 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;
|
||||
|
||||
// Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
|
||||
- (BOOL)shouldPromptForPermissionToCheckForUpdatesToHostBundle:(NSBundle *)bundle;
|
||||
- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)bundle;
|
||||
|
||||
// Implement this if you want to do some special handling with the appcast once it finishes loading.
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)appcast forHostBundle:(NSBundle *)bundle;
|
||||
- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast;
|
||||
|
||||
// If you're using special logic or extensions in your appcast, implement this to use your own logic for finding
|
||||
// a valid update, if any, in the given appcast.
|
||||
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forHostBundle:(NSBundle *)bundle;
|
||||
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)bundle;
|
||||
|
||||
// Sent when a valid update is found by the update driver.
|
||||
- (void)didFindValidUpdate:(SUAppcastItem *)update toHostBundle:(NSBundle *)bundle;
|
||||
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update;
|
||||
|
||||
// Sent when a valid update is not found.
|
||||
- (void)didNotFindUpdateToHostBundle:(NSBundle *)hb;
|
||||
|
||||
// Sent when the user makes a choice in the update alert dialog (install now / remind me later / skip this version).
|
||||
- (void)userChoseAction:(SUUpdateAlertChoice)action forUpdate:(SUAppcastItem *)update toHostBundle:(NSBundle *)bundle;
|
||||
- (void)updaterDidNotFindUpdate:(SUUpdater *)update;
|
||||
|
||||
// Sent immediately before installing the specified update.
|
||||
- (void)updateWillInstall:(SUAppcastItem *)update toHostBundle:(NSBundle *)bundle;
|
||||
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
|
||||
|
||||
// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
|
||||
- (BOOL)shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update toHostBundle:(NSBundle *)hostBundle untilInvoking:(NSInvocation *)invocation;
|
||||
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
|
||||
|
||||
// Called immediately before relaunching.
|
||||
- (void)updaterWillRelaunchApplication;
|
||||
- (void)updaterWillRelaunchApplication:(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 comparator will be used.
|
||||
- (id <SUVersionComparison>)versionComparatorForUpdater:(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;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
+270
-138
@@ -6,109 +6,163 @@
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "SUUpdater.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
#import "SUUpdatePermissionPrompt.h"
|
||||
|
||||
#import "SUAutomaticUpdateDriver.h"
|
||||
#import "SUProbingUpdateDriver.h"
|
||||
#import "SUUserInitiatedUpdateDriver.h"
|
||||
#import "SUScheduledUpdateDriver.h"
|
||||
|
||||
@interface SUUpdater (Private)
|
||||
- (NSArray *)feedParameters;
|
||||
- (BOOL)automaticallyUpdates;
|
||||
- (BOOL)shouldScheduleUpdateCheck;
|
||||
- initForBundle:(NSBundle *)bundle;
|
||||
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)updateDriver;
|
||||
- (BOOL)automaticallyDownloadsUpdates;
|
||||
- (void)scheduleNextUpdateCheck;
|
||||
- (NSTimeInterval)checkInterval;
|
||||
- (void)registerAsObserver;
|
||||
- (void)unregisterAsObserver;
|
||||
- (void)updateDriverDidFinish:(NSNotification *)note;
|
||||
- initForBundle:(NSBundle *)bundle;
|
||||
- (NSURL *)parameterizedFeedURL;
|
||||
@end
|
||||
|
||||
@implementation SUUpdater
|
||||
|
||||
#pragma mark Initialization
|
||||
|
||||
static SUUpdater *sharedUpdater = nil;
|
||||
static NSMutableDictionary *sharedUpdaters = nil;
|
||||
static NSString *SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaultsObservationContext";
|
||||
|
||||
// SUUpdater's a singleton now! And I'm enforcing it!
|
||||
// This will probably break the world if you try to write a Sparkle-enabled plugin for a Sparkle-enabled app.
|
||||
+ (SUUpdater *)sharedUpdater
|
||||
{
|
||||
if (sharedUpdater == nil)
|
||||
sharedUpdater = [[[self class] alloc] init];
|
||||
return sharedUpdater;
|
||||
return [self updaterForBundle:[NSBundle mainBundle]];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
// SUUpdater has a singleton for each bundle. We use the fact that NSBundle instances are also singletons, so we can use them as keys. If you don't trust that you can also use the identifier as key
|
||||
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle
|
||||
{
|
||||
if (bundle == nil) bundle = [NSBundle mainBundle];
|
||||
id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]];
|
||||
if (updater == nil)
|
||||
updater = [[[self class] alloc] initForBundle:bundle];
|
||||
return updater;
|
||||
}
|
||||
|
||||
// This is the designated initializer for SUUpdater, important for subclasses
|
||||
- initForBundle:(NSBundle *)bundle
|
||||
{
|
||||
self = [super init];
|
||||
if (sharedUpdater)
|
||||
if (bundle == nil) bundle = [NSBundle mainBundle];
|
||||
id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]];
|
||||
if (updater)
|
||||
{
|
||||
[self release];
|
||||
self = sharedUpdater;
|
||||
self = [updater retain];
|
||||
}
|
||||
else if (self != nil)
|
||||
else if (self)
|
||||
{
|
||||
sharedUpdater = self;
|
||||
[self setHostBundle:[NSBundle mainBundle]];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidFinishLaunching:) name:NSApplicationDidFinishLaunchingNotification object:NSApp];
|
||||
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:[@"values." stringByAppendingString:SUScheduledCheckIntervalKey] options:0 context:NULL];
|
||||
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:[@"values." stringByAppendingString:SUEnableAutomaticChecksKey] options:0 context:NULL];
|
||||
if (sharedUpdaters == nil)
|
||||
sharedUpdaters = [[NSMutableDictionary alloc] init];
|
||||
[sharedUpdaters setObject:self forKey:[NSValue valueWithNonretainedObject:bundle]];
|
||||
host = [[SUHost alloc] initWithBundle:bundle];
|
||||
[self registerAsObserver];
|
||||
}
|
||||
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]]; }
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)note
|
||||
{
|
||||
// If the user has been asked about automatic checks and said no, get out of here.
|
||||
if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKey] &&
|
||||
[[SUUserDefaults standardUserDefaults] boolForKey:SUEnableAutomaticChecksKey] == NO) { return; }
|
||||
|
||||
// Does the delegate want to take care of the logic for when we should ask permission to update?
|
||||
if ([delegate respondsToSelector:@selector(shouldPromptForPermissionToCheckForUpdatesToHostBundle)])
|
||||
{
|
||||
if ([delegate shouldPromptForPermissionToCheckForUpdatesToHostBundle:hostBundle])
|
||||
[SUUpdatePermissionPrompt promptWithHostBundle:hostBundle delegate:self];
|
||||
}
|
||||
// Has he been asked already? And don't ask if the host has a default value set in its Info.plist.
|
||||
else if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKey] == nil &&
|
||||
[hostBundle objectForInfoDictionaryKey:SUEnableAutomaticChecksKey] == nil)
|
||||
{
|
||||
if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKeyOld])
|
||||
[[SUUserDefaults standardUserDefaults] setBool:[[SUUserDefaults standardUserDefaults] boolForKey:SUEnableAutomaticChecksKeyOld] forKey:SUEnableAutomaticChecksKey];
|
||||
// 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 ([[SUUserDefaults standardUserDefaults] boolForKey:SUHasLaunchedBeforeKey] == NO)
|
||||
[[SUUserDefaults standardUserDefaults] setBool:YES forKey:SUHasLaunchedBeforeKey];
|
||||
else
|
||||
[SUUpdatePermissionPrompt promptWithHostBundle:hostBundle delegate:self];
|
||||
BOOL shouldPrompt = NO;
|
||||
|
||||
// If the user has been asked about automatic checks, don't bother prompting
|
||||
if ([host objectForUserDefaultsKey:SUEnableAutomaticChecksKey])
|
||||
{
|
||||
shouldPrompt = NO;
|
||||
}
|
||||
// Does the delegate want to take care of the logic for when we should ask permission to update?
|
||||
else if ([delegate respondsToSelector:@selector(updaterShouldPromptForPermissionToCheckForUpdates:)])
|
||||
{
|
||||
shouldPrompt = [delegate updaterShouldPromptForPermissionToCheckForUpdates:self];
|
||||
}
|
||||
// Has he been asked already? And don't ask if the host has a default value set in its Info.plist.
|
||||
else if ([host objectForKey:SUEnableAutomaticChecksKey] == nil)
|
||||
{
|
||||
if ([host objectForUserDefaultsKey:SUEnableAutomaticChecksKeyOld])
|
||||
[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];
|
||||
else
|
||||
shouldPrompt = YES;
|
||||
}
|
||||
|
||||
if (shouldPrompt)
|
||||
{
|
||||
NSArray *profileInfo = [host systemProfile];
|
||||
if ([delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)])
|
||||
profileInfo = [profileInfo arrayByAddingObjectsFromArray:[delegate feedParametersForUpdater:self sendingSystemProfile:[self sendsSystemProfile]]];
|
||||
[SUUpdatePermissionPrompt promptWithHost:host systemProfile:profileInfo delegate:self];
|
||||
// We start the update checks and register as observer for changes after the prompt finishes
|
||||
}
|
||||
|
||||
// We check if the user's said they want updates, or they haven't said anything, and the default is set to checking.
|
||||
[self scheduleNextUpdateCheck];
|
||||
else
|
||||
{
|
||||
// We check if the user's said they want updates, or they haven't said anything, and the default is set to checking.
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updatePermissionPromptFinishedWithResult:(SUPermissionPromptResult)result
|
||||
{
|
||||
BOOL automaticallyCheck = (result == SUAutomaticallyCheck);
|
||||
[[SUUserDefaults standardUserDefaults] setBool:automaticallyCheck forKey:SUEnableAutomaticChecksKey];
|
||||
[self scheduleNextUpdateCheck];
|
||||
[self setAutomaticallyChecksForUpdates:(result == SUAutomaticallyCheck)];
|
||||
// Schedule checks, but make sure we ignore the delayed call from KVO
|
||||
[self resetUpdateCycle];
|
||||
}
|
||||
|
||||
- (void)updateDriverDidFinish:(NSNotification *)note
|
||||
{
|
||||
if ([note object] == driver && [driver finished])
|
||||
{
|
||||
[driver release]; driver = nil;
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSDate *)lastUpdateCheckDate
|
||||
{
|
||||
return [host objectForUserDefaultsKey:SULastCheckTimeKey];
|
||||
}
|
||||
|
||||
- (void)scheduleNextUpdateCheck
|
||||
{
|
||||
@synchronized (checkTimer)
|
||||
if (checkTimer)
|
||||
{
|
||||
if (checkTimer)
|
||||
{
|
||||
[checkTimer invalidate];
|
||||
checkTimer = nil;
|
||||
}
|
||||
[checkTimer invalidate];
|
||||
checkTimer = nil;
|
||||
}
|
||||
if (![self shouldScheduleUpdateCheck]) return;
|
||||
if (![self automaticallyChecksForUpdates]) return;
|
||||
|
||||
// How long has it been since last we checked for an update?
|
||||
NSDate *lastCheckDate = [[SUUserDefaults standardUserDefaults] objectForKey:SULastCheckTimeKey];
|
||||
NSDate *lastCheckDate = [self lastUpdateCheckDate];
|
||||
if (!lastCheckDate) { lastCheckDate = [NSDate distantPast]; }
|
||||
NSTimeInterval intervalSinceCheck = [[NSDate date] timeIntervalSinceDate:lastCheckDate];
|
||||
|
||||
// Now we want to figure out how long until we check again.
|
||||
NSTimeInterval delayUntilCheck;
|
||||
if (intervalSinceCheck < [self checkInterval])
|
||||
delayUntilCheck = ([self checkInterval] - intervalSinceCheck); // It hasn't been long enough.
|
||||
NSTimeInterval delayUntilCheck, updateCheckInterval = [self updateCheckInterval];
|
||||
if (updateCheckInterval < SU_MIN_CHECK_INTERVAL)
|
||||
updateCheckInterval = SU_MIN_CHECK_INTERVAL;
|
||||
if (intervalSinceCheck < updateCheckInterval)
|
||||
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];
|
||||
@@ -116,117 +170,200 @@ static SUUpdater *sharedUpdater = nil;
|
||||
|
||||
- (void)checkForUpdatesInBackground
|
||||
{
|
||||
[self checkForUpdatesWithDriver:[[[([self automaticallyUpdates] ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class]) alloc] init] autorelease]];
|
||||
[self checkForUpdatesWithDriver:[[[([self automaticallyDownloadsUpdates] ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class]) alloc] initWithUpdater:self] autorelease]];
|
||||
}
|
||||
|
||||
- (IBAction)checkForUpdates:sender
|
||||
{
|
||||
[self checkForUpdatesWithDriver:[[[SUUserInitiatedUpdateDriver alloc] init] autorelease]];
|
||||
[self checkForUpdatesWithDriver:[[[SUUserInitiatedUpdateDriver alloc] initWithUpdater:self] autorelease]];
|
||||
}
|
||||
|
||||
- (void)checkForUpdateInformation
|
||||
{
|
||||
[self checkForUpdatesWithDriver:[[[SUProbingUpdateDriver alloc] initWithUpdater:self] autorelease]];
|
||||
}
|
||||
|
||||
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)d
|
||||
{
|
||||
if ([self updateInProgress]) { return; }
|
||||
@synchronized (checkTimer) { if (checkTimer) { [checkTimer invalidate]; checkTimer = nil; } }
|
||||
|
||||
// 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 = [[SUUserDefaults standardUserDefaults] objectForKey:SUFeedURLKey];
|
||||
if (!appcastString)
|
||||
appcastString = [hostBundle objectForInfoDictionaryKey:SUFeedURLKey];
|
||||
if (!appcastString)
|
||||
[NSException raise:@"SUNoFeedURL" format:@"You must specify the URL of the appcast as the SUFeedURLKey in either the Info.plist or the user defaults!"];
|
||||
NSCharacterSet* quoteSet = [NSCharacterSet characterSetWithCharactersInString: @"\"\'"]; // Some feed publishers add quotes; strip 'em.
|
||||
NSURL *feedURL = [[NSURL URLWithString:[appcastString stringByTrimmingCharactersInSet:quoteSet]] URLWithParameters:[self feedParameters]];
|
||||
if (checkTimer) { [checkTimer invalidate]; checkTimer = nil; }
|
||||
|
||||
[self willChangeValueForKey:@"lastUpdateCheckDate"];
|
||||
[host setObject:[NSDate date] forUserDefaultsKey:SULastCheckTimeKey];
|
||||
[self didChangeValueForKey:@"lastUpdateCheckDate"];
|
||||
|
||||
driver = [d retain];
|
||||
if ([driver delegate] == nil) { [driver setDelegate:delegate]; }
|
||||
[driver addObserver:self forKeyPath:@"finished" options:0 context:NULL];
|
||||
[driver checkForUpdatesAtURL:feedURL hostBundle:hostBundle];
|
||||
[driver checkForUpdatesAtURL:[self parameterizedFeedURL] host:host];
|
||||
}
|
||||
|
||||
- (void)registerAsObserver
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidFinishLaunching:) name:NSApplicationDidFinishLaunchingNotification object:NSApp];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateDriverDidFinish:) name:SUUpdateDriverFinishedNotification object:nil];
|
||||
// No sense observing the shared NSUserDefaultsController when we're not updating the main bundle.
|
||||
if ([host bundle] != [NSBundle mainBundle]) return;
|
||||
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:[@"values." stringByAppendingString:SUScheduledCheckIntervalKey] options:0 context:SUUpdaterDefaultsObservationContext];
|
||||
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:[@"values." stringByAppendingString:SUEnableAutomaticChecksKey] options:0 context:SUUpdaterDefaultsObservationContext];
|
||||
}
|
||||
|
||||
- (void)unregisterAsObserver
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
// Removing self as a KVO observer if no observer was registered leads to an NSException. But we don't care.
|
||||
@try
|
||||
{
|
||||
[[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKeyPath:[@"values." stringByAppendingString:SUScheduledCheckIntervalKey]];
|
||||
[[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKeyPath:[@"values." stringByAppendingString:SUEnableAutomaticChecksKey]];
|
||||
}
|
||||
@catch (NSException *e) { }
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
{
|
||||
if (object == driver && [keyPath isEqualToString:@"finished"])
|
||||
{
|
||||
[driver removeObserver:self forKeyPath:@"finished"];
|
||||
[driver release]; driver = nil;
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
else if (object == [NSUserDefaultsController sharedUserDefaultsController] && ([keyPath hasSuffix:SUScheduledCheckIntervalKey] || [keyPath hasSuffix:SUEnableAutomaticChecksKey]))
|
||||
{
|
||||
[self updatePreferencesChanged];
|
||||
}
|
||||
else
|
||||
{
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
if (context == SUUpdaterDefaultsObservationContext)
|
||||
{
|
||||
// Allow a small delay, because perhaps the user or developer wants to change both preferences. This allows the developer to interpret a zero check interval as a sign to disable automatic checking.
|
||||
// Or we may get this from the developer and from our own KVO observation, this will effectively coalesce them.
|
||||
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetUpdateCycle) object:nil];
|
||||
[self performSelector:@selector(resetUpdateCycle) withObject:nil afterDelay:1];
|
||||
}
|
||||
else
|
||||
{
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updatePreferencesChanged
|
||||
- (void)resetUpdateCycle
|
||||
{
|
||||
[self scheduleNextUpdateCheck];
|
||||
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetUpdateCycle) object:nil];
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
|
||||
- (BOOL)shouldScheduleUpdateCheck
|
||||
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyCheckForUpdates
|
||||
{
|
||||
// Breaking this down for readability:
|
||||
// If the user says he wants automatic update checks, let's do it.
|
||||
if ([[SUUserDefaults standardUserDefaults] boolForKey:SUEnableAutomaticChecksKey] == YES)
|
||||
return YES;
|
||||
// If the user hasn't said anything, but the developer says we should do it, let's do it.
|
||||
if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKey] == nil &&
|
||||
[[hostBundle objectForInfoDictionaryKey:SUEnableAutomaticChecksKey] boolValue] == YES)
|
||||
return YES;
|
||||
return NO; // Otherwise, don't bother.
|
||||
[host setBool:automaticallyCheckForUpdates forUserDefaultsKey:SUEnableAutomaticChecksKey];
|
||||
// Hack to support backwards compatibility with older Sparkle versions, which supported
|
||||
// disabling updates by setting the check interval to 0.
|
||||
if (automaticallyCheckForUpdates && [self updateCheckInterval] == 0)
|
||||
[self setUpdateCheckInterval:SU_DEFAULT_CHECK_INTERVAL];
|
||||
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetUpdateCycle) object:nil];
|
||||
// Provide a small delay in case multiple preferences are being updated simultaneously.
|
||||
[self performSelector:@selector(resetUpdateCycle) withObject:nil afterDelay:1];
|
||||
}
|
||||
|
||||
- (BOOL)automaticallyUpdates
|
||||
- (BOOL)automaticallyChecksForUpdates
|
||||
{
|
||||
// Don't automatically update when the check interval is 0, to be compatible with 1.1 settings.
|
||||
if ([self updateCheckInterval] == 0)
|
||||
return NO;
|
||||
return [host boolForKey:SUEnableAutomaticChecksKey];
|
||||
}
|
||||
|
||||
- (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyUpdates
|
||||
{
|
||||
[host setBool:automaticallyUpdates forUserDefaultsKey:SUAutomaticallyUpdateKey];
|
||||
}
|
||||
|
||||
- (BOOL)automaticallyDownloadsUpdates
|
||||
{
|
||||
// If the SUAllowsAutomaticUpdatesKey exists and is set to NO, return NO.
|
||||
if ([hostBundle objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] &&
|
||||
[[hostBundle objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] boolValue] == NO)
|
||||
if ([host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] && [host boolForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] == NO)
|
||||
return NO;
|
||||
|
||||
// If we're not using DSA signatures, we aren't going to trust any updates automatically.
|
||||
if ([[hostBundle objectForInfoDictionaryKey:SUExpectsDSASignatureKey] boolValue] != YES)
|
||||
return NO;
|
||||
|
||||
// If there's no setting, or it's set to no, we're not automatically updating.
|
||||
if ([[SUUserDefaults standardUserDefaults] boolForKey:SUAutomaticallyUpdateKey] != YES)
|
||||
return NO;
|
||||
|
||||
return YES; // Otherwise, we're good to go.
|
||||
// Otherwise, automatically downloading updates is allowed. Does the user want it?
|
||||
return [host boolForUserDefaultsKey:SUAutomaticallyUpdateKey];
|
||||
}
|
||||
|
||||
- (NSArray *)feedParameters
|
||||
- (void)setFeedURL:(NSURL *)feedURL
|
||||
{
|
||||
BOOL sendingSystemProfile = ([[SUUserDefaults standardUserDefaults] boolForKey:SUSendProfileInfoKey] == YES);
|
||||
[host setObject:[feedURL absoluteString] forUserDefaultsKey:SUFeedURLKey];
|
||||
}
|
||||
|
||||
- (NSURL *)feedURL
|
||||
{
|
||||
// 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 (!appcastString) // Can't find an appcast string!
|
||||
[NSException raise:@"SUNoFeedURL" format:@"You must specify the URL of the appcast as the SUFeedURLKey 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]];
|
||||
}
|
||||
|
||||
- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile
|
||||
{
|
||||
[host setBool:sendsSystemProfile forUserDefaultsKey:SUSendProfileInfoKey];
|
||||
}
|
||||
|
||||
- (BOOL)sendsSystemProfile
|
||||
{
|
||||
return [host boolForUserDefaultsKey:SUSendProfileInfoKey];
|
||||
}
|
||||
|
||||
- (NSURL *)parameterizedFeedURL
|
||||
{
|
||||
NSURL *baseFeedURL = [self feedURL];
|
||||
|
||||
// Determine all the parameters we're attaching to the base feed URL.
|
||||
BOOL sendingSystemProfile = [self sendsSystemProfile];
|
||||
|
||||
// Let's only send the system profiling information once per week at most, so we normalize daily-checkers vs. biweekly-checkers and the such.
|
||||
NSDate *lastSubmitDate = [host objectForUserDefaultsKey:SULastProfileSubmitDateKey];
|
||||
if(!lastSubmitDate)
|
||||
lastSubmitDate = [NSDate distantPast];
|
||||
const NSTimeInterval oneWeek = 60 * 60 * 24 * 7;
|
||||
sendingSystemProfile &= (-[lastSubmitDate timeIntervalSinceNow] >= oneWeek);
|
||||
|
||||
NSArray *parameters = [NSArray array];
|
||||
if ([delegate respondsToSelector:@selector(feedParametersForHostBundle:sendingSystemProfile:)])
|
||||
parameters = [parameters arrayByAddingObjectsFromArray:[delegate feedParametersForHostBundle:hostBundle sendingSystemProfile:sendingSystemProfile]];
|
||||
if ([delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)])
|
||||
parameters = [parameters arrayByAddingObjectsFromArray:[delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile]];
|
||||
if (sendingSystemProfile)
|
||||
parameters = [parameters arrayByAddingObjectsFromArray:[hostBundle systemProfile]];
|
||||
return parameters;
|
||||
{
|
||||
parameters = [parameters arrayByAddingObjectsFromArray:[host systemProfile]];
|
||||
[host setObject:[NSDate date] forUserDefaultsKey:SULastProfileSubmitDateKey];
|
||||
}
|
||||
if (parameters == nil || [parameters count] == 0) { return baseFeedURL; }
|
||||
|
||||
// Build up the parameterized URL.
|
||||
NSMutableArray *parameterStrings = [NSMutableArray array];
|
||||
NSEnumerator *profileInfoEnumerator = [parameters objectEnumerator];
|
||||
NSDictionary *currentProfileInfo;
|
||||
while ((currentProfileInfo = [profileInfoEnumerator nextObject]))
|
||||
[parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", [currentProfileInfo objectForKey:@"key"], [currentProfileInfo objectForKey:@"value"]]];
|
||||
|
||||
NSString *separatorCharacter = @"?";
|
||||
if ([baseFeedURL query])
|
||||
separatorCharacter = @"&"; // In case the URL is already http://foo.org/baz.xml?bat=4
|
||||
NSString *appcastStringWithProfile = [NSString stringWithFormat:@"%@%@%@", [baseFeedURL absoluteString], separatorCharacter, [parameterStrings componentsJoinedByString:@"&"]];
|
||||
|
||||
// Clean it up so it's a valid URL
|
||||
return [NSURL URLWithString:[appcastStringWithProfile stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
|
||||
- (NSTimeInterval)checkInterval
|
||||
- (void)setUpdateCheckInterval:(NSTimeInterval)updateCheckInterval
|
||||
{
|
||||
NSTimeInterval checkInterval = 0;
|
||||
// Find the stored check interval. User defaults override Info.plist.
|
||||
if ([[SUUserDefaults standardUserDefaults] objectForKey:SUScheduledCheckIntervalKey])
|
||||
checkInterval = [[[SUUserDefaults standardUserDefaults] objectForKey:SUScheduledCheckIntervalKey] doubleValue];
|
||||
else if ([hostBundle objectForInfoDictionaryKey:SUScheduledCheckIntervalKey])
|
||||
checkInterval = [[hostBundle objectForInfoDictionaryKey:SUScheduledCheckIntervalKey] doubleValue];
|
||||
[host setObject:[NSNumber numberWithDouble:updateCheckInterval] forUserDefaultsKey:SUScheduledCheckIntervalKey];
|
||||
if (updateCheckInterval == 0) // For compatibility with 1.1's settings.
|
||||
[self setAutomaticallyChecksForUpdates:NO];
|
||||
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetUpdateCycle) object:nil];
|
||||
|
||||
if (checkInterval < SU_MIN_CHECK_INTERVAL) // This can also mean one that isn't set.
|
||||
checkInterval = SU_DEFAULT_CHECK_INTERVAL;
|
||||
return checkInterval;
|
||||
// Provide a small delay in case multiple preferences are being updated simultaneously.
|
||||
[self performSelector:@selector(resetUpdateCycle) withObject:nil afterDelay:1];
|
||||
}
|
||||
|
||||
- (NSTimeInterval)updateCheckInterval
|
||||
{
|
||||
// Find the stored check interval. User defaults override Info.plist.
|
||||
NSNumber *intervalValue = [host objectForKey:SUScheduledCheckIntervalKey];
|
||||
if (intervalValue)
|
||||
return [intervalValue doubleValue];
|
||||
else
|
||||
return SU_DEFAULT_CHECK_INTERVAL;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[hostBundle release];
|
||||
[delegate release];
|
||||
[self unregisterAsObserver];
|
||||
[host release];
|
||||
if (checkTimer) { [checkTimer invalidate]; }
|
||||
[super dealloc];
|
||||
}
|
||||
@@ -243,17 +380,12 @@ static SUUpdater *sharedUpdater = nil;
|
||||
delegate = aDelegate;
|
||||
}
|
||||
|
||||
- (void)setHostBundle:(NSBundle *)hb
|
||||
{
|
||||
if (hostBundle == hb) return;
|
||||
[hostBundle release];
|
||||
hostBundle = [hb retain];
|
||||
[[SUUserDefaults standardUserDefaults] setIdentifier:[hostBundle bundleIdentifier]];
|
||||
}
|
||||
|
||||
- (BOOL)updateInProgress
|
||||
{
|
||||
return driver && ([driver finished] == NO);
|
||||
}
|
||||
|
||||
- delegate { return delegate; }
|
||||
- (NSBundle *)hostBundle { return [host bundle]; }
|
||||
|
||||
@end
|
||||
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// SUUserDefaults.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 12/21/07.
|
||||
// Copyright 2007 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUUSERDEFAULTS_H
|
||||
#define SUUSERDEFAULTS_H
|
||||
|
||||
/*!
|
||||
@class
|
||||
@abstract A substitute for NSUserDefaults that will work with arbitrary bundle identifiers.
|
||||
@discussion Make sure you call -setIdentifier: before using SUUserDefaults. The other methods in this class work just like those in NSUserDefaults.
|
||||
*/
|
||||
|
||||
@interface SUUserDefaults : NSObject {
|
||||
NSString *identifier;
|
||||
}
|
||||
|
||||
/*!
|
||||
@method
|
||||
@abstract Returns a singleton instance of the user defaults class.
|
||||
*/
|
||||
+ (SUUserDefaults *)standardUserDefaults;
|
||||
|
||||
/*!
|
||||
@method
|
||||
@abstract Sets which bundle identifier to use when setting and retrieving defaults.
|
||||
@discussion It is imperative that you set the identifier through this method before trying to set or retrieve defaults.
|
||||
*/
|
||||
- (void)setIdentifier:(NSString *)identifier;
|
||||
|
||||
- (id)objectForKey:(NSString *)defaultName;
|
||||
- (void)setObject:(id)value forKey:(NSString *)defaultName;
|
||||
- (BOOL)boolForKey:(NSString *)defaultName;
|
||||
- (void)setBool:(BOOL)value forKey:(NSString *)defaultName;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,97 +0,0 @@
|
||||
//
|
||||
// SUUserDefaults.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 12/21/07.
|
||||
// Copyright 2007 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "SUUserDefaults.h"
|
||||
|
||||
@implementation SUUserDefaults
|
||||
|
||||
+ (SUUserDefaults *)standardUserDefaults
|
||||
{
|
||||
static SUUserDefaults *standardUserDefaults = nil;
|
||||
if (standardUserDefaults == nil)
|
||||
standardUserDefaults = [[SUUserDefaults alloc] init];
|
||||
return standardUserDefaults;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[identifier release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)setIdentifier:(NSString *)anIdentifier
|
||||
{
|
||||
if (identifier != anIdentifier)
|
||||
{
|
||||
[identifier release];
|
||||
identifier = [anIdentifier copy];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)verifyIdentifier
|
||||
{
|
||||
if (identifier == nil)
|
||||
[NSException raise:@"SUUserDefaultsMissingIdentifier" format:@"You must set the SUUserDefaults identifier before using it."];
|
||||
}
|
||||
|
||||
- (id)objectForKey:(NSString *)defaultName
|
||||
{
|
||||
[self verifyIdentifier];
|
||||
CFPropertyListRef obj = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)identifier);
|
||||
// Under Tiger, CFPreferencesCopyAppValue doesn't get values from NSRegistratioDomain, 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, and no value
|
||||
// is found elsewhere.
|
||||
if (obj == NULL && [identifier isEqualToString:[[NSBundle mainBundle] bundleIdentifier]])
|
||||
obj = [[NSUserDefaults standardUserDefaults] objectForKey:defaultName];
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > 1050
|
||||
return [NSMakeCollectable(obj) autorelease];
|
||||
#else
|
||||
return [(id)obj autorelease];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)setObject:(id)value forKey:(NSString *)defaultName;
|
||||
{
|
||||
[self verifyIdentifier];
|
||||
CFPreferencesSetValue((CFStringRef)defaultName, value, (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
CFPreferencesSynchronize((CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
// If anything's bound to this through an NSUserDefaultsController, it won't know that anything's changed.
|
||||
// We can't get an NSUserDefaults object for anything other than the standard one for the app, so this won't work for bundles.
|
||||
// But it's the best we can do: this will make NSUserDefaultsControllers know about the changes that have been made.
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
- (BOOL)boolForKey:(NSString *)defaultName
|
||||
{
|
||||
BOOL value;
|
||||
[self verifyIdentifier];
|
||||
CFPropertyListRef plr = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)identifier);
|
||||
if (plr == NULL)
|
||||
value = NO;
|
||||
else {
|
||||
value = (BOOL)CFBooleanGetValue((CFBooleanRef)plr);
|
||||
CFRelease(plr);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
- (void)setBool:(BOOL)value forKey:(NSString *)defaultName
|
||||
{
|
||||
[self verifyIdentifier];
|
||||
CFPreferencesSetValue((CFStringRef)defaultName, (CFBooleanRef)[NSNumber numberWithBool:value], (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
CFPreferencesSynchronize((CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
// If anything's bound to this through an NSUserDefaultsController, it won't know that anything's changed.
|
||||
// We can't get an NSUserDefaults object for anything other than the standard one for the app, so this won't work for bundles.
|
||||
// But it's the best we can do: this will make NSUserDefaultsControllers know about the changes that have been made.
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -7,18 +7,27 @@
|
||||
//
|
||||
|
||||
#import "SUUserInitiatedUpdateDriver.h"
|
||||
#import "Sparkle.h"
|
||||
|
||||
#import "SUStatusController.h"
|
||||
#import "SUHost.h"
|
||||
|
||||
@implementation SUUserInitiatedUpdateDriver
|
||||
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
|
||||
{
|
||||
[super checkForUpdatesAtURL:appcastURL hostBundle:hb];
|
||||
checkingController = [[SUStatusController alloc] initWithHostBundle:hb];
|
||||
[checkingController window]; // Force the checking controller to load its window.
|
||||
[checkingController beginActionWithTitle:SULocalizedString(@"Checking for updates\u2026", nil) maxProgressValue:0 statusText:nil];
|
||||
checkingController = [[SUStatusController alloc] initWithHost:aHost];
|
||||
[[checkingController window] center]; // Force the checking controller to load its window.
|
||||
[checkingController beginActionWithTitle:SULocalizedString(@"Checking for updates...", nil) maxProgressValue:0 statusText:nil];
|
||||
[checkingController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelCheckForUpdates:) isDefault:NO];
|
||||
[checkingController showWindow:self];
|
||||
[super checkForUpdatesAtURL:URL host:aHost];
|
||||
|
||||
// For background applications, obtain focus.
|
||||
// Useful if the update check is requested from another app like System Preferences.
|
||||
if ([aHost isBackgroundApplication])
|
||||
{
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)closeCheckingWindow
|
||||
@@ -48,6 +57,18 @@
|
||||
[super appcastDidFinishLoading:ac];
|
||||
}
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
[self closeCheckingWindow];
|
||||
[super abortUpdateWithError:error];
|
||||
}
|
||||
|
||||
- (void)abortUpdate
|
||||
{
|
||||
[self closeCheckingWindow];
|
||||
[super abortUpdate];
|
||||
}
|
||||
|
||||
- (void)appcast:(SUAppcast *)ac failedToLoadWithError:(NSError *)error
|
||||
{
|
||||
if (isCanceled)
|
||||
@@ -55,7 +76,6 @@
|
||||
[self abortUpdate];
|
||||
return;
|
||||
}
|
||||
[self closeCheckingWindow];
|
||||
[super appcast:ac failedToLoadWithError:error];
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class SUHost;
|
||||
@interface SUWindowController : NSWindowController { }
|
||||
// We use this instead of plain old NSWindowController initWithWindowNibName so that we'll be able to find the right path when running in a bundle loaded from another app.
|
||||
- (id)initWithHostBundle:(NSBundle *)hb windowNibName:(NSString *)nibName;
|
||||
- (id)initWithHost:(SUHost *)host windowNibName:(NSString *)nibName;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -10,12 +10,12 @@
|
||||
|
||||
@implementation SUWindowController
|
||||
|
||||
- (id)initWithHostBundle:(NSBundle *)hb windowNibName:(NSString *)nibName
|
||||
- (id)initWithHost:(SUHost *)host windowNibName:(NSString *)nibName
|
||||
{
|
||||
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:nibName ofType:@"nib"];
|
||||
if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations.
|
||||
{
|
||||
NSString *frameworkPath = [[hb sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"];
|
||||
NSString *frameworkPath = [[host sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"];
|
||||
NSBundle *framework = [NSBundle bundleWithPath:frameworkPath];
|
||||
path = [framework pathForResource:nibName ofType:@"nib"];
|
||||
}
|
||||
|
||||
+4
-4
@@ -11,7 +11,7 @@
|
||||
http://you.com/app/2.0.html
|
||||
</sparkle:releaseNotesLink>
|
||||
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
|
||||
<enclosure url="http://you.com/app/Your Great App 2.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream"/>
|
||||
<enclosure url="http://you.com/app/Your Great App 2.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
|
||||
</item>
|
||||
|
||||
<item>
|
||||
@@ -20,17 +20,17 @@
|
||||
http://you.com/app/1.5.html
|
||||
</sparkle:releaseNotesLink>
|
||||
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
|
||||
<enclosure url="http://you.com/app/Your Great App 1.5.zip" sparkle:version="1.5" length="1472893" type="application/octet-stream"/>
|
||||
<enclosure url="http://you.com/app/Your Great App 1.5.zip" sparkle:version="1.5" length="1472893" type="application/octet-stream" sparkle:dsaSignature="234818feCa1JyW30nbkBwainOzrN6EQuAh" />
|
||||
</item>
|
||||
|
||||
<!-- Now here's an example of a version with a weird internal version number (like an SVN revision) but a human-readable external one. This version also has a DSA signature. Note that normally, if any item has a DSA signature, all of them need to. -->
|
||||
<!-- Now here's an example of a version with a weird internal version number (like an SVN revision) but a human-readable external one. -->
|
||||
<item>
|
||||
<title>Version 1.4 (5 bugs fixed; 2 new features)</title>
|
||||
<sparkle:releaseNotesLink>
|
||||
http://you.com/app/1.4.html
|
||||
</sparkle:releaseNotesLink>
|
||||
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
|
||||
<enclosure url="http://you.com/app/Your Great App 1.4.zip" sparkle:version="241" sparkle:shortVersionString="1.4" sparkle:dsaSignature="MC0CFBfeCa1JyW30nbkBwainOzrN6EQuAh=" length="1472349" type="application/octet-stream"/>
|
||||
<enclosure url="http://you.com/app/Your Great App 1.4.zip" sparkle:version="241" sparkle:shortVersionString="1.4" sparkle:dsaSignature="MC0CFBfeCa1JyW30nbkBwainOzrN6EQuAh=" length="1472349" type="application/octet-stream" />
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -6,59 +6,16 @@
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
//
|
||||
// Prefix header for all source files of the 'Sparkle' target in the 'Sparkle' project.
|
||||
//
|
||||
|
||||
#ifndef SPARKLE_H
|
||||
#define SPARKLE_H
|
||||
|
||||
#define SULocalizedString(key,comment) NSLocalizedStringFromTableInBundle(key, @"Sparkle", [NSBundle bundleForClass:[self class]], comment)
|
||||
#define SUAbstractFail() NSAssert2(nil, @"Can't call %@ on an instance of %@; this is an abstract method!", __PRETTY_FUNCTION__, [self class]);
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUConstants.h"
|
||||
#endif
|
||||
|
||||
|
||||
// This list should include the shared headers. It doesn't matter if some of them aren't shared (unless
|
||||
// there are name-space collisions) so we can list all of them to start with:
|
||||
|
||||
#import "NSBundle+SUAdditions.h"
|
||||
#import "NSFileManager+Aliases.h"
|
||||
#import "NSFileManager+Authentication.h"
|
||||
#import "NSFileManager+Verification.h"
|
||||
#import "NSString+extras.h"
|
||||
#import "NSURL+Parameters.h"
|
||||
#import "NSWorkspace_RBAdditions.h"
|
||||
#import "NSWorkspace+SystemVersion.h"
|
||||
#import <Sparkle/SUUpdater.h>
|
||||
|
||||
#import "NTSynchronousTask.h"
|
||||
|
||||
#import "RSS.h"
|
||||
|
||||
#import "SUAppcast.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SUAutomaticUpdateAlert.h"
|
||||
#import "SUAutomaticUpdateDriver.h"
|
||||
#import "SUBasicUpdateDriver.h"
|
||||
#import "SUConstants.h"
|
||||
#import "SUInstaller.h"
|
||||
#import "SUProbingUpdateDriver.h"
|
||||
#import "SUScheduledUpdateDriver.h"
|
||||
#import "SUStandardVersionComparator.h"
|
||||
#import "SUStatusController.h"
|
||||
#import "SUSystemProfiler.h"
|
||||
#import "SUUIBasedUpdateDriver.h"
|
||||
#import "SUUnarchiver.h"
|
||||
#import "SUUpdateAlert.h"
|
||||
#import "SUUpdateDriver.h"
|
||||
#import "SUUpdater.h"
|
||||
#import "SUUpdatePermissionPrompt.h"
|
||||
#import "SUUserInitiatedUpdateDriver.h"
|
||||
#import "SUUserDefaults.h"
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "SUWindowController.h"
|
||||
#import <Sparkle/SUAppcast.h>
|
||||
#import <Sparkle/SUAppcastItem.h>
|
||||
#import <Sparkle/SUVersionComparisonProtocol.h>
|
||||
|
||||
#endif
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Sparkle.pch
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 7/23/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#define SPARKLE_BUNDLE [NSBundle bundleWithIdentifier:@"org.andymatuschak.Sparkle"]
|
||||
#define SULocalizedString(key,comment) NSLocalizedStringFromTableInBundle(key, @"Sparkle", SPARKLE_BUNDLE, comment)
|
||||
#define SUAbstractFail() NSAssert2(nil, @"Can't call %@ on an instance of %@; this is an abstract method!", __PRETTY_FUNCTION__, [self class]);
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUConstants.h"
|
||||
#endif
|
||||
+151
-144
@@ -7,75 +7,60 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
610134730DD250470049ACDF /* SUUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134710DD250470049ACDF /* SUUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
610134730DD250470049ACDF /* SUUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134710DD250470049ACDF /* SUUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
|
||||
610134740DD250470049ACDF /* SUUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 610134720DD250470049ACDF /* SUUpdateDriver.m */; };
|
||||
610134770DD252E60049ACDF /* NSWorkspace+SystemVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134750DD252E60049ACDF /* NSWorkspace+SystemVersion.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
610134780DD252E60049ACDF /* NSWorkspace+SystemVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 610134760DD252E60049ACDF /* NSWorkspace+SystemVersion.m */; };
|
||||
6101347B0DD2541A0049ACDF /* SUProbingUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134790DD2541A0049ACDF /* SUProbingUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6101347B0DD2541A0049ACDF /* SUProbingUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 610134790DD2541A0049ACDF /* SUProbingUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
|
||||
6101347C0DD2541A0049ACDF /* SUProbingUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6101347A0DD2541A0049ACDF /* SUProbingUpdateDriver.m */; };
|
||||
6102FE460E077FCE00F85D09 /* SUPipedUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6102FE4A0E07803800F85D09 /* SUDiskImageUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6102FE460E077FCE00F85D09 /* SUPipedUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */; settings = {ATTRIBUTES = (); }; };
|
||||
6102FE4A0E07803800F85D09 /* SUDiskImageUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */; settings = {ATTRIBUTES = (); }; };
|
||||
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 = (Public, ); }; };
|
||||
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 */; };
|
||||
61072EB30DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */; };
|
||||
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 */; };
|
||||
611779590D1111C900749C97 /* NSWorkspace_RBAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 611779570D1111C400749C97 /* NSWorkspace_RBAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6117795A0D1111C900749C97 /* NSWorkspace_RBAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 611779560D1111C400749C97 /* NSWorkspace_RBAdditions.m */; };
|
||||
61177A1F0D1112E900749C97 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6117796E0D1112E000749C97 /* IOKit.framework */; };
|
||||
61180BCA0D64138900B4E0D1 /* SUWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 61180BC80D64138900B4E0D1 /* SUWindowController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61180BCA0D64138900B4E0D1 /* SUWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 61180BC80D64138900B4E0D1 /* SUWindowController.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61180BCB0D64138900B4E0D1 /* SUWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61180BC90D64138900B4E0D1 /* SUWindowController.m */; };
|
||||
6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */; settings = {ATTRIBUTES = (); }; };
|
||||
6120721309CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */; };
|
||||
61227A080DB5480900AB99EA /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; };
|
||||
61227A160DB548B800AB99EA /* SUVersionComparisonTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */; };
|
||||
61299A2F09CA2DAB00B7442F /* NSFileManager+Verification.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A2D09CA2DAB00B7442F /* NSFileManager+Verification.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61299A3009CA2DAB00B7442F /* NSFileManager+Verification.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A2E09CA2DAB00B7442F /* NSFileManager+Verification.m */; };
|
||||
61299A4A09CA2DD000B7442F /* NSFileManager+Authentication.h in Headers */ = {isa = PBXBuildFile; fileRef = 6129984309C9E2DA00B7442F /* NSFileManager+Authentication.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61299A5C09CA6D4500B7442F /* SUConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A5B09CA6D4500B7442F /* SUConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61299A3009CA2DAB00B7442F /* SUDSAVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */; };
|
||||
61299A4A09CA2DD000B7442F /* SUPlainInstallerInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 6129984309C9E2DA00B7442F /* SUPlainInstallerInternals.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61299A5C09CA6D4500B7442F /* SUConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A5B09CA6D4500B7442F /* SUConstants.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61299A6009CA6EB100B7442F /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; };
|
||||
61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A8B09CA790200B7442F /* SUUnarchiver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A8B09CA790200B7442F /* SUUnarchiver.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61299A8E09CA790200B7442F /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A8C09CA790200B7442F /* SUUnarchiver.m */; };
|
||||
61299B3609CB04E000B7442F /* Sparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299B3509CB04E000B7442F /* Sparkle.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
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 */; };
|
||||
615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */ = {isa = PBXBuildFile; fileRef = 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */; };
|
||||
6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61699BCC0DDB92BD005878A4 /* SUVersionComparisonTest.h in Headers */ = {isa = PBXBuildFile; fileRef = 61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6171D9070D57B81800BFE886 /* NSFileManager+Aliases.h in Headers */ = {isa = PBXBuildFile; fileRef = 6171D9050D57B81800BFE886 /* NSFileManager+Aliases.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6171D9080D57B81800BFE886 /* NSFileManager+Aliases.m in Sources */ = {isa = PBXBuildFile; fileRef = 6171D9060D57B81800BFE886 /* NSFileManager+Aliases.m */; };
|
||||
618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61699BCC0DDB92BD005878A4 /* SUVersionComparisonTest.h in Headers */ = {isa = PBXBuildFile; fileRef = 61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */; settings = {ATTRIBUTES = (); }; };
|
||||
618E9CFD0E7328F1004646D8 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 618E9CFC0E7328F1004646D8 /* dsa_pub.pem */; };
|
||||
618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (); }; };
|
||||
618FA5020DAE88B40026945C /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; };
|
||||
618FA5050DAE8AB80026945C /* SUPlainInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
618FA5050DAE8AB80026945C /* SUPlainInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */; settings = {ATTRIBUTES = (); }; };
|
||||
618FA5060DAE8AB80026945C /* SUPlainInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5040DAE8AB80026945C /* SUPlainInstaller.m */; };
|
||||
618FA5220DAE8E8A0026945C /* SUPackageInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
618FA5220DAE8E8A0026945C /* SUPackageInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */; settings = {ATTRIBUTES = (); }; };
|
||||
618FA5230DAE8E8A0026945C /* SUPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */; };
|
||||
6196CFF909C72148000DC222 /* SUStatusController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6196CFE309C71ADE000DC222 /* SUStatusController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6196CFF909C72148000DC222 /* SUStatusController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6196CFE309C71ADE000DC222 /* SUStatusController.h */; settings = {ATTRIBUTES = (); }; };
|
||||
6196CFFA09C72149000DC222 /* SUStatusController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6196CFE409C71ADE000DC222 /* SUStatusController.m */; };
|
||||
61A225930D1C3ADD00430CCD /* NSBundle+SUAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A225910D1C3ADD00430CCD /* NSBundle+SUAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61A225940D1C3ADD00430CCD /* NSBundle+SUAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225920D1C3ADD00430CCD /* NSBundle+SUAdditions.m */; };
|
||||
61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A2259C0D1C495D00430CCD /* SUVersionComparisonProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61A225A40D1C4AC000430CCD /* SUStandardVersionComparator.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A225A20D1C4AC000430CCD /* SUStandardVersionComparator.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61A225A40D1C4AC000430CCD /* SUStandardVersionComparator.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A225A20D1C4AC000430CCD /* SUStandardVersionComparator.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61A225A50D1C4AC000430CCD /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; };
|
||||
61A2262B0D1C58FD00430CCD /* SUUserDefaults.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A226290D1C58FD00430CCD /* SUUserDefaults.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61A2262C0D1C58FD00430CCD /* SUUserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A2262A0D1C58FD00430CCD /* SUUserDefaults.m */; };
|
||||
61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A2279A0D1CEE7600430CCD /* SUSystemProfiler.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A2279A0D1CEE7600430CCD /* SUSystemProfiler.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61A2279D0D1CEE7600430CCD /* SUSystemProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A2279B0D1CEE7600430CCD /* SUSystemProfiler.m */; };
|
||||
61A354550DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A354530DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
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 */; };
|
||||
61B5F8E909C4CE3C00B25A18 /* NSString+extras.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B5F8DF09C4CE3C00B25A18 /* NSString+extras.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61B5F8EA09C4CE3C00B25A18 /* NSString+extras.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E009C4CE3C00B25A18 /* NSString+extras.m */; };
|
||||
61B5F8EB09C4CE3C00B25A18 /* RSS.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B5F8E109C4CE3C00B25A18 /* RSS.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61B5F8EC09C4CE3C00B25A18 /* RSS.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E209C4CE3C00B25A18 /* RSS.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 /* NSFileManager+Authentication.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E509C4CE3C00B25A18 /* NSFileManager+Authentication.m */; };
|
||||
61B5F8EF09C4CE3C00B25A18 /* SUPlainInstallerInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */; };
|
||||
61B5F8F709C4CEB300B25A18 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; };
|
||||
61B5F90F09C4CF3A00B25A18 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; };
|
||||
61B5F92E09C4CFD800B25A18 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61B5F92A09C4CFD800B25A18 /* InfoPlist.strings */; };
|
||||
@@ -87,24 +72,23 @@
|
||||
61B5FC6F09C51F4900B25A18 /* SUAppcastItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5FC5409C5182000B25A18 /* SUAppcastItem.m */; };
|
||||
61B5FC7009C51F4A00B25A18 /* SUAppcastItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B5FC5309C5182000B25A18 /* SUAppcastItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61B5FCDE09C52A9F00B25A18 /* SUUpdateAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5FCA109C5228F00B25A18 /* SUUpdateAlert.m */; };
|
||||
61B5FCDF09C52A9F00B25A18 /* SUUpdateAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B5FCA009C5228F00B25A18 /* SUUpdateAlert.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61B93A3C0DD02D7000DCD2F8 /* SUUIBasedUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93A390DD02D6400DCD2F8 /* SUUIBasedUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61B5FCDF09C52A9F00B25A18 /* SUUpdateAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B5FCA009C5228F00B25A18 /* SUUpdateAlert.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61B93A3C0DD02D7000DCD2F8 /* SUUIBasedUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93A390DD02D6400DCD2F8 /* SUUIBasedUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61B93A3D0DD02D7000DCD2F8 /* SUUIBasedUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93A3A0DD02D6400DCD2F8 /* SUUIBasedUpdateDriver.m */; };
|
||||
61B93AA20DD0E2D300DCD2F8 /* NSURL+Parameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93AA00DD0E2D300DCD2F8 /* NSURL+Parameters.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61B93AA30DD0E2D300DCD2F8 /* NSURL+Parameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93AA10DD0E2D300DCD2F8 /* NSURL+Parameters.m */; };
|
||||
61B93B270DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93B250DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61B93B270DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93B250DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61B93B280DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93B260DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m */; };
|
||||
61B93C090DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93C070DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61B93C090DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93C070DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
|
||||
61B93C0A0DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93C080DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m */; };
|
||||
61BBDF820A49220C00378739 /* Sparkle.icns in Resources */ = {isa = PBXBuildFile; fileRef = 61BBDF810A49220C00378739 /* Sparkle.icns */; };
|
||||
61C1F2780DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 61C1F2760DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61C1F2790DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C1F2770DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m */; };
|
||||
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 */; };
|
||||
61EF67590E25C5B400F754E0 /* SUHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 61EF67580E25C5B400F754E0 /* SUHost.h */; };
|
||||
61F83F720DBFE140006FDD30 /* SUBasicUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */; };
|
||||
61F83F740DBFE141006FDD30 /* SUBasicUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
784590C10DE0429F00D0D64B /* NSNumber+Units.h in Headers */ = {isa = PBXBuildFile; fileRef = 784590BF0DE0429F00D0D64B /* NSNumber+Units.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
784590C20DE0429F00D0D64B /* NSNumber+Units.m in Sources */ = {isa = PBXBuildFile; fileRef = 784590C00DE0429F00D0D64B /* NSNumber+Units.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 */; };
|
||||
@@ -115,13 +99,6 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
612279ED0DB547FE00AB99EA /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
|
||||
remoteInfo = Sparkle;
|
||||
};
|
||||
61227AB90DB5C4BB00AB99EA /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
@@ -136,6 +113,13 @@
|
||||
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
|
||||
remoteInfo = Sparkle;
|
||||
};
|
||||
61FA528C0E2D9EB200EF58AD /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
|
||||
remoteInfo = Sparkle;
|
||||
};
|
||||
DAAEFD4F0DA572460051E0D0 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
@@ -163,8 +147,6 @@
|
||||
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
610134710DD250470049ACDF /* SUUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdateDriver.h; sourceTree = "<group>"; };
|
||||
610134720DD250470049ACDF /* SUUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdateDriver.m; sourceTree = "<group>"; };
|
||||
610134750DD252E60049ACDF /* NSWorkspace+SystemVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSWorkspace+SystemVersion.h"; sourceTree = "<group>"; };
|
||||
610134760DD252E60049ACDF /* NSWorkspace+SystemVersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSWorkspace+SystemVersion.m"; sourceTree = "<group>"; };
|
||||
610134790DD2541A0049ACDF /* SUProbingUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUProbingUpdateDriver.h; sourceTree = "<group>"; };
|
||||
6101347A0DD2541A0049ACDF /* SUProbingUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUProbingUpdateDriver.m; sourceTree = "<group>"; };
|
||||
6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPipedUnarchiver.h; sourceTree = "<group>"; };
|
||||
@@ -176,8 +158,6 @@
|
||||
610D5A740A1670A4004AAD9C /* SUStatus.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = SUStatus.nib; sourceTree = "<group>"; };
|
||||
610EC1BF0CF3914D00AE239E /* NTSynchronousTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NTSynchronousTask.m; sourceTree = "<group>"; };
|
||||
610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NTSynchronousTask.h; sourceTree = "<group>"; };
|
||||
611779560D1111C400749C97 /* NSWorkspace_RBAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSWorkspace_RBAdditions.m; sourceTree = "<group>"; };
|
||||
611779570D1111C400749C97 /* NSWorkspace_RBAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSWorkspace_RBAdditions.h; sourceTree = "<group>"; };
|
||||
6117796E0D1112E000749C97 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
|
||||
61180BC80D64138900B4E0D1 /* SUWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUWindowController.h; sourceTree = "<group>"; };
|
||||
61180BC90D64138900B4E0D1 /* SUWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUWindowController.m; sourceTree = "<group>"; };
|
||||
@@ -187,9 +167,9 @@
|
||||
612279DA0DB5470200AB99EA /* Sparkle Unit Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Sparkle Unit Tests-Info.plist"; path = "Tests/Sparkle Unit Tests-Info.plist"; sourceTree = "<group>"; };
|
||||
61227A140DB548B800AB99EA /* SUVersionComparisonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUVersionComparisonTest.h; path = Tests/SUVersionComparisonTest.h; sourceTree = "<group>"; };
|
||||
61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUVersionComparisonTest.m; path = Tests/SUVersionComparisonTest.m; sourceTree = "<group>"; };
|
||||
6129984309C9E2DA00B7442F /* NSFileManager+Authentication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Authentication.h"; sourceTree = "<group>"; };
|
||||
61299A2D09CA2DAB00B7442F /* NSFileManager+Verification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Verification.h"; sourceTree = "<group>"; };
|
||||
61299A2E09CA2DAB00B7442F /* NSFileManager+Verification.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+Verification.m"; sourceTree = "<group>"; };
|
||||
6129984309C9E2DA00B7442F /* SUPlainInstallerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPlainInstallerInternals.h; sourceTree = "<group>"; };
|
||||
61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUDSAVerifier.h; sourceTree = "<group>"; };
|
||||
61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUDSAVerifier.m; sourceTree = "<group>"; };
|
||||
61299A5B09CA6D4500B7442F /* SUConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUConstants.h; sourceTree = "<group>"; };
|
||||
61299A5F09CA6EB100B7442F /* SUConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUConstants.m; sourceTree = "<group>"; };
|
||||
61299A8B09CA790200B7442F /* SUUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiver.h; sourceTree = "<group>"; };
|
||||
@@ -200,23 +180,30 @@
|
||||
612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermissionPrompt.m; sourceTree = "<group>"; };
|
||||
613242130CD06CEF00106AA4 /* relaunch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = relaunch.m; sourceTree = "<group>"; };
|
||||
615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SUModelTranslation.plist; sourceTree = "<group>"; };
|
||||
6171D9050D57B81800BFE886 /* NSFileManager+Aliases.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+Aliases.h"; sourceTree = "<group>"; };
|
||||
6171D9060D57B81800BFE886 /* NSFileManager+Aliases.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+Aliases.m"; sourceTree = "<group>"; };
|
||||
618915700E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/SUUpdatePermissionPrompt.nib; sourceTree = "<group>"; };
|
||||
618915710E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/SUUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
618915720E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/SUAutomaticUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
618915730E35937600B5E981 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
618E9CFC0E7328F1004646D8 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = "Test Application/dsa_pub.pem"; sourceTree = "<group>"; };
|
||||
618FA4FF0DAE88B40026945C /* SUInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstaller.h; sourceTree = "<group>"; };
|
||||
618FA5000DAE88B40026945C /* SUInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstaller.m; sourceTree = "<group>"; };
|
||||
618FA5030DAE8AB80026945C /* SUPlainInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPlainInstaller.h; sourceTree = "<group>"; };
|
||||
618FA5040DAE8AB80026945C /* SUPlainInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPlainInstaller.m; sourceTree = "<group>"; };
|
||||
618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPackageInstaller.h; sourceTree = "<group>"; };
|
||||
618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPackageInstaller.m; sourceTree = "<group>"; };
|
||||
6195D48F0E404AD600D41A50 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ru; path = ru.lproj/SUUpdatePermissionPrompt.nib; sourceTree = "<group>"; };
|
||||
6195D4900E404AD600D41A50 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ru; path = ru.lproj/SUUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
6195D4910E404AD600D41A50 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ru; path = ru.lproj/SUAutomaticUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
6195D4920E404AD700D41A50 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
6196CFE309C71ADE000DC222 /* SUStatusController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStatusController.h; sourceTree = "<group>"; };
|
||||
6196CFE409C71ADE000DC222 /* SUStatusController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUStatusController.m; sourceTree = "<group>"; };
|
||||
61A225910D1C3ADD00430CCD /* NSBundle+SUAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+SUAdditions.h"; sourceTree = "<group>"; };
|
||||
61A225920D1C3ADD00430CCD /* NSBundle+SUAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+SUAdditions.m"; sourceTree = "<group>"; };
|
||||
619B17200E1E9D0800E72754 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
619B17210E1E9D0800E72754 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/SUAutomaticUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
619B17220E1E9D0800E72754 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/SUUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
619B17230E1E9D0800E72754 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = de; path = de.lproj/SUUpdatePermissionPrompt.nib; sourceTree = "<group>"; };
|
||||
61A2259C0D1C495D00430CCD /* SUVersionComparisonProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUVersionComparisonProtocol.h; sourceTree = "<group>"; };
|
||||
61A225A20D1C4AC000430CCD /* SUStandardVersionComparator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStandardVersionComparator.h; sourceTree = "<group>"; };
|
||||
61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUStandardVersionComparator.m; sourceTree = "<group>"; };
|
||||
61A226290D1C58FD00430CCD /* SUUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUserDefaults.h; sourceTree = "<group>"; };
|
||||
61A2262A0D1C58FD00430CCD /* SUUserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUserDefaults.m; sourceTree = "<group>"; };
|
||||
61A2279A0D1CEE7600430CCD /* SUSystemProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUSystemProfiler.h; sourceTree = "<group>"; };
|
||||
61A2279B0D1CEE7600430CCD /* SUSystemProfiler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUSystemProfiler.m; sourceTree = "<group>"; };
|
||||
61A354530DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUserInitiatedUpdateDriver.h; sourceTree = "<group>"; };
|
||||
@@ -227,13 +214,9 @@
|
||||
61AAE84F0A321AF700D8810D /* es */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8590A321B0400D8810D /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8710A321F7700D8810D /* nl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61B5F8DF09C4CE3C00B25A18 /* NSString+extras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "NSString+extras.h"; sourceTree = "<group>"; };
|
||||
61B5F8E009C4CE3C00B25A18 /* NSString+extras.m */ = {isa = PBXFileReference; fileEncoding = 30; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; path = "NSString+extras.m"; sourceTree = "<group>"; };
|
||||
61B5F8E109C4CE3C00B25A18 /* RSS.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RSS.h; sourceTree = "<group>"; };
|
||||
61B5F8E209C4CE3C00B25A18 /* RSS.m */ = {isa = PBXFileReference; fileEncoding = 30; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; path = RSS.m; sourceTree = "<group>"; };
|
||||
61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SUUpdater.h; sourceTree = "<group>"; };
|
||||
61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUUpdater.m; sourceTree = "<group>"; };
|
||||
61B5F8E509C4CE3C00B25A18 /* NSFileManager+Authentication.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+Authentication.m"; sourceTree = "<group>"; };
|
||||
61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUPlainInstallerInternals.m; sourceTree = "<group>"; };
|
||||
61B5F8F609C4CEB300B25A18 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
|
||||
61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Sparkle Test App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
61B5F90409C4CEE200B25A18 /* Test Application-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Test Application-Info.plist"; path = "Test Application/Test Application-Info.plist"; sourceTree = "<group>"; };
|
||||
@@ -249,16 +232,16 @@
|
||||
61B5FCA109C5228F00B25A18 /* SUUpdateAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdateAlert.m; sourceTree = "<group>"; };
|
||||
61B93A390DD02D6400DCD2F8 /* SUUIBasedUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUIBasedUpdateDriver.h; sourceTree = "<group>"; };
|
||||
61B93A3A0DD02D6400DCD2F8 /* SUUIBasedUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUIBasedUpdateDriver.m; sourceTree = "<group>"; };
|
||||
61B93AA00DD0E2D300DCD2F8 /* NSURL+Parameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+Parameters.h"; sourceTree = "<group>"; };
|
||||
61B93AA10DD0E2D300DCD2F8 /* NSURL+Parameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+Parameters.m"; sourceTree = "<group>"; };
|
||||
61B93B250DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAutomaticUpdateDriver.h; sourceTree = "<group>"; };
|
||||
61B93B260DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAutomaticUpdateDriver.m; sourceTree = "<group>"; };
|
||||
61B93C070DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUScheduledUpdateDriver.h; sourceTree = "<group>"; };
|
||||
61B93C080DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUScheduledUpdateDriver.m; sourceTree = "<group>"; };
|
||||
61BBDF810A49220C00378739 /* Sparkle.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Sparkle.icns; sourceTree = "<group>"; };
|
||||
61C1F2760DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+ExtendedAttributes.h"; sourceTree = "<group>"; };
|
||||
61C1F2770DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+ExtendedAttributes.m"; sourceTree = "<group>"; };
|
||||
61C268090E2DB5D000175E6C /* License.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = License.txt; sourceTree = "<group>"; };
|
||||
61C46F350D9C54F300B06326 /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = en; path = en.lproj/SUUpdatePermissionPrompt.nib; sourceTree = "<group>"; };
|
||||
61CFB3280E385186007A1735 /* Sparkle.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sparkle.pch; sourceTree = "<group>"; };
|
||||
61EF67550E25B58D00F754E0 /* SUHost.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUHost.m; sourceTree = "<group>"; };
|
||||
61EF67580E25C5B400F754E0 /* SUHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUHost.h; sourceTree = "<group>"; };
|
||||
61F3651A0E18987B007ECA02 /* es */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = es; path = es.lproj/SUUpdatePermissionPrompt.nib; sourceTree = "<group>"; };
|
||||
61F3652A0E189883007ECA02 /* es */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = es; path = es.lproj/SUUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
61F3652B0E189883007ECA02 /* es */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = es; path = es.lproj/SUAutomaticUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
@@ -268,10 +251,12 @@
|
||||
61F365330E1898A3007ECA02 /* nl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = nl; path = nl.lproj/SUUpdatePermissionPrompt.nib; sourceTree = "<group>"; };
|
||||
61F365340E1898A3007ECA02 /* nl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = nl; path = nl.lproj/SUUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
61F365350E1898A3007ECA02 /* nl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = nl; path = nl.lproj/SUAutomaticUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
61F614540E24A12D009F47E7 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61F614550E24A12D009F47E7 /* it */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = it; path = it.lproj/SUAutomaticUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
61F614560E24A12D009F47E7 /* it */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = it; path = it.lproj/SUUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
61F614570E24A12D009F47E7 /* it */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = it; path = it.lproj/SUUpdatePermissionPrompt.nib; sourceTree = "<group>"; };
|
||||
61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBasicUpdateDriver.h; sourceTree = "<group>"; };
|
||||
61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBasicUpdateDriver.m; sourceTree = "<group>"; };
|
||||
784590BF0DE0429F00D0D64B /* NSNumber+Units.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNumber+Units.h"; sourceTree = "<group>"; };
|
||||
784590C00DE0429F00D0D64B /* NSNumber+Units.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNumber+Units.m"; sourceTree = "<group>"; };
|
||||
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8DC2EF5B0486A6940098B216 /* Sparkle.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Sparkle.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DAAEFC960DA571DF0051E0D0 /* relaunch */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = relaunch; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -294,7 +279,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
61227A080DB5480900AB99EA /* Sparkle.framework in Frameworks */,
|
||||
61FA52880E2D9EA400EF58AD /* Sparkle.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -346,7 +331,7 @@
|
||||
0867D691FE84028FC02AAC07 /* Sparkle */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
61F83F6E0DBFE07A006FDD30 /* Update Drivers */,
|
||||
61F83F6E0DBFE07A006FDD30 /* Update Control */,
|
||||
61299B3909CB055000B7442F /* Appcast Support */,
|
||||
618FA6DB0DB485440026945C /* Installation */,
|
||||
6101354A0DD25B7F0049ACDF /* Unarchiving */,
|
||||
@@ -379,6 +364,7 @@
|
||||
children = (
|
||||
8DC2EF5A0486A6940098B216 /* Info.plist */,
|
||||
615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */,
|
||||
61C268090E2DB5D000175E6C /* License.txt */,
|
||||
61AAE8220A321A7F00D8810D /* Sparkle.strings */,
|
||||
61C46F330D9C54F300B06326 /* SUUpdatePermissionPrompt.nib */,
|
||||
61AAE8240A321A7F00D8810D /* SUAutomaticUpdateAlert.nib */,
|
||||
@@ -409,14 +395,6 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
613242130CD06CEF00106AA4 /* relaunch.m */,
|
||||
6129984309C9E2DA00B7442F /* NSFileManager+Authentication.h */,
|
||||
61B5F8E509C4CE3C00B25A18 /* NSFileManager+Authentication.m */,
|
||||
61299A2D09CA2DAB00B7442F /* NSFileManager+Verification.h */,
|
||||
61299A2E09CA2DAB00B7442F /* NSFileManager+Verification.m */,
|
||||
6171D9050D57B81800BFE886 /* NSFileManager+Aliases.h */,
|
||||
6171D9060D57B81800BFE886 /* NSFileManager+Aliases.m */,
|
||||
61C1F2760DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h */,
|
||||
61C1F2770DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m */,
|
||||
);
|
||||
name = Support;
|
||||
sourceTree = "<group>";
|
||||
@@ -443,12 +421,6 @@
|
||||
61A2259C0D1C495D00430CCD /* SUVersionComparisonProtocol.h */,
|
||||
61A225A20D1C4AC000430CCD /* SUStandardVersionComparator.h */,
|
||||
61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */,
|
||||
61B5F8E109C4CE3C00B25A18 /* RSS.h */,
|
||||
61B5F8E209C4CE3C00B25A18 /* RSS.m */,
|
||||
61B5F8DF09C4CE3C00B25A18 /* NSString+extras.h */,
|
||||
61B5F8E009C4CE3C00B25A18 /* NSString+extras.m */,
|
||||
61B93AA00DD0E2D300DCD2F8 /* NSURL+Parameters.h */,
|
||||
61B93AA10DD0E2D300DCD2F8 /* NSURL+Parameters.m */,
|
||||
);
|
||||
name = "Appcast Support";
|
||||
sourceTree = "<group>";
|
||||
@@ -477,6 +449,8 @@
|
||||
618FA5000DAE88B40026945C /* SUInstaller.m */,
|
||||
618FA5030DAE8AB80026945C /* SUPlainInstaller.h */,
|
||||
618FA5040DAE8AB80026945C /* SUPlainInstaller.m */,
|
||||
6129984309C9E2DA00B7442F /* SUPlainInstallerInternals.h */,
|
||||
61B5F8E509C4CE3C00B25A18 /* SUPlainInstallerInternals.m */,
|
||||
618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */,
|
||||
618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */,
|
||||
6101355D0DD25BB70049ACDF /* Support */,
|
||||
@@ -487,19 +461,12 @@
|
||||
61B5F8F309C4CE5900B25A18 /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
61A225910D1C3ADD00430CCD /* NSBundle+SUAdditions.h */,
|
||||
61A225920D1C3ADD00430CCD /* NSBundle+SUAdditions.m */,
|
||||
784590BF0DE0429F00D0D64B /* NSNumber+Units.h */,
|
||||
784590C00DE0429F00D0D64B /* NSNumber+Units.m */,
|
||||
611779570D1111C400749C97 /* NSWorkspace_RBAdditions.h */,
|
||||
611779560D1111C400749C97 /* NSWorkspace_RBAdditions.m */,
|
||||
610134750DD252E60049ACDF /* NSWorkspace+SystemVersion.h */,
|
||||
610134760DD252E60049ACDF /* NSWorkspace+SystemVersion.m */,
|
||||
61EF67580E25C5B400F754E0 /* SUHost.h */,
|
||||
61EF67550E25B58D00F754E0 /* SUHost.m */,
|
||||
61299B3509CB04E000B7442F /* Sparkle.h */,
|
||||
61CFB3280E385186007A1735 /* Sparkle.pch */,
|
||||
61299A5B09CA6D4500B7442F /* SUConstants.h */,
|
||||
61299A5F09CA6EB100B7442F /* SUConstants.m */,
|
||||
61A226290D1C58FD00430CCD /* SUUserDefaults.h */,
|
||||
61A2262A0D1C58FD00430CCD /* SUUserDefaults.m */,
|
||||
);
|
||||
includeInIndex = 1;
|
||||
name = "Other Sources";
|
||||
@@ -513,15 +480,23 @@
|
||||
61B5F92C09C4CFD800B25A18 /* MainMenu.nib */,
|
||||
61B5F92409C4CFC900B25A18 /* main.m */,
|
||||
61B5F90409C4CEE200B25A18 /* Test Application-Info.plist */,
|
||||
618E9CFC0E7328F1004646D8 /* dsa_pub.pem */,
|
||||
);
|
||||
name = "Test Application Sources";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
61F83F6E0DBFE07A006FDD30 /* Update Drivers */ = {
|
||||
61CFB2C10E384958007A1735 /* Support */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */,
|
||||
61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */,
|
||||
);
|
||||
name = Support;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
61CFB2C20E38496B007A1735 /* Drivers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */,
|
||||
61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */,
|
||||
610134710DD250470049ACDF /* SUUpdateDriver.h */,
|
||||
610134720DD250470049ACDF /* SUUpdateDriver.m */,
|
||||
61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */,
|
||||
@@ -537,7 +512,18 @@
|
||||
61A354530DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h */,
|
||||
61A354540DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.m */,
|
||||
);
|
||||
name = "Update Drivers";
|
||||
name = Drivers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
61F83F6E0DBFE07A006FDD30 /* Update Control */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */,
|
||||
61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */,
|
||||
61CFB2C20E38496B007A1735 /* Drivers */,
|
||||
61CFB2C10E384958007A1735 /* Support */,
|
||||
);
|
||||
name = "Update Control";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
FA1941C40D94A6EA00DD942E /* Configurations */ = {
|
||||
@@ -567,47 +553,39 @@
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
61B5F8E909C4CE3C00B25A18 /* NSString+extras.h in Headers */,
|
||||
61B5F8EB09C4CE3C00B25A18 /* RSS.h in Headers */,
|
||||
61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */,
|
||||
61B5FC0D09C4FC8200B25A18 /* SUAppcast.h in Headers */,
|
||||
61B5FC7009C51F4A00B25A18 /* SUAppcastItem.h in Headers */,
|
||||
61B5FCDF09C52A9F00B25A18 /* SUUpdateAlert.h in Headers */,
|
||||
6196CFF909C72148000DC222 /* SUStatusController.h in Headers */,
|
||||
61299A2F09CA2DAB00B7442F /* NSFileManager+Verification.h in Headers */,
|
||||
61299A4A09CA2DD000B7442F /* NSFileManager+Authentication.h in Headers */,
|
||||
61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */,
|
||||
61299A4A09CA2DD000B7442F /* SUPlainInstallerInternals.h in Headers */,
|
||||
61299A5C09CA6D4500B7442F /* SUConstants.h in Headers */,
|
||||
61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */,
|
||||
61299B3609CB04E000B7442F /* Sparkle.h in Headers */,
|
||||
6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */,
|
||||
611779590D1111C900749C97 /* NSWorkspace_RBAdditions.h in Headers */,
|
||||
61A225930D1C3ADD00430CCD /* NSBundle+SUAdditions.h in Headers */,
|
||||
61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */,
|
||||
61A225A40D1C4AC000430CCD /* SUStandardVersionComparator.h in Headers */,
|
||||
61A2262B0D1C58FD00430CCD /* SUUserDefaults.h in Headers */,
|
||||
61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */,
|
||||
6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */,
|
||||
612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */,
|
||||
6171D9070D57B81800BFE886 /* NSFileManager+Aliases.h in Headers */,
|
||||
61180BCA0D64138900B4E0D1 /* SUWindowController.h in Headers */,
|
||||
61C1F2780DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.h in Headers */,
|
||||
618FA5010DAE88B40026945C /* SUInstaller.h in Headers */,
|
||||
618FA5050DAE8AB80026945C /* SUPlainInstaller.h in Headers */,
|
||||
618FA5220DAE8E8A0026945C /* SUPackageInstaller.h in Headers */,
|
||||
61F83F740DBFE141006FDD30 /* SUBasicUpdateDriver.h in Headers */,
|
||||
61B93A3C0DD02D7000DCD2F8 /* SUUIBasedUpdateDriver.h in Headers */,
|
||||
61B93AA20DD0E2D300DCD2F8 /* NSURL+Parameters.h in Headers */,
|
||||
61B93B270DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h in Headers */,
|
||||
61B93C090DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h in Headers */,
|
||||
610134730DD250470049ACDF /* SUUpdateDriver.h in Headers */,
|
||||
610134770DD252E60049ACDF /* NSWorkspace+SystemVersion.h in Headers */,
|
||||
6101347B0DD2541A0049ACDF /* SUProbingUpdateDriver.h in Headers */,
|
||||
61699BCC0DDB92BD005878A4 /* SUVersionComparisonTest.h in Headers */,
|
||||
784590C10DE0429F00D0D64B /* NSNumber+Units.h in Headers */,
|
||||
61A354550DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h in Headers */,
|
||||
6102FE460E077FCE00F85D09 /* SUPipedUnarchiver.h in Headers */,
|
||||
6102FE4A0E07803800F85D09 /* SUDiskImageUnarchiver.h in Headers */,
|
||||
6102FE5B0E08C7EC00F85D09 /* SUUnarchiver_Private.h in Headers */,
|
||||
61EF67590E25C5B400F754E0 /* SUHost.h in Headers */,
|
||||
61CFB3290E385186007A1735 /* Sparkle.pch in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -626,7 +604,7 @@
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
612279EE0DB547FE00AB99EA /* PBXTargetDependency */,
|
||||
61FA528D0E2D9EB200EF58AD /* PBXTargetDependency */,
|
||||
);
|
||||
name = "Sparkle Unit Tests";
|
||||
productName = "Sparkle Unit Tests";
|
||||
@@ -662,6 +640,7 @@
|
||||
8DC2EF540486A6940098B216 /* Sources */,
|
||||
8DC2EF560486A6940098B216 /* Frameworks */,
|
||||
6131B1910DDCDE32005215F0 /* Run Script: Set Bzr Version Info */,
|
||||
6195D4B40E40505A00D41A50 /* Run Script: Link fr_CA to fr */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -730,6 +709,7 @@
|
||||
th,
|
||||
tr,
|
||||
zh_CN,
|
||||
fr_ca,
|
||||
);
|
||||
mainGroup = 0867D691FE84028FC02AAC07 /* Sparkle */;
|
||||
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
|
||||
@@ -759,7 +739,7 @@
|
||||
61B5F92E09C4CFD800B25A18 /* InfoPlist.strings in Resources */,
|
||||
61B5F92F09C4CFD800B25A18 /* MainMenu.nib in Resources */,
|
||||
61BBDF820A49220C00378739 /* Sparkle.icns in Resources */,
|
||||
61072EB30DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig in Resources */,
|
||||
618E9CFD0E7328F1004646D8 /* dsa_pub.pem in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -767,6 +747,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
61C2680A0E2DB5D000175E6C /* License.txt in Resources */,
|
||||
DAAEFD510DA572550051E0D0 /* relaunch in Resources */,
|
||||
610D5A750A1670A4004AAD9C /* SUStatus.nib in Resources */,
|
||||
61AAE8280A321A7F00D8810D /* Sparkle.strings in Resources */,
|
||||
@@ -806,9 +787,23 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = "/usr/bin/env ruby";
|
||||
shellScript = "# Xcode auto-versioning script for Subversion\n# by Axel Andersson, modified by Daniel Jalkut to add\n# \"--revision HEAD\" to the svn info line, which allows\n# the latest revision to always be used.\n\nif ENV[\"BUILT_PRODUCTS_DIR\"].nil?\n\tSTDERR.print \"#{$0}: Must be run from Xcode!\"\n\texit(1)\nend\n\n# Get the current Bzr revision number and use it to set the CFBundleVersion value\nENV[\"PATH\"] = \"/bin:/sw/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/opt/local/bin\"\nrev = `/usr/bin/env bzr revno`\nexit(0)\ninfo = \"#{ENV[\"BUILT_PRODUCTS_DIR\"]}/#{ENV[\"WRAPPER_NAME\"]}/Resources/Info.plist\"\nversion = rev[/[\\d.]+/]\n\nif version.nil?\n\tSTDERR.print \"#{$0}: Can't find a Bazaar revision!\"\n\texit(0)\nend\n\ninfo_contents = File.read(info)\nif info_contents.nil?\n\tSTDERR.print \"#{$0}: Can't read in the Info.plist file!\"\n\texit(1)\nend\n\ninfo_contents.sub!(/([\\t ]+<key>CFBundleVersion<\\/key>\\n[\\t ]+<string>).*?(<\\/string>)/, '\\1' + version + '\\2')\nSTDERR.print info_contents\nf = File.open(info, \"w\")\nf.write(info_contents)\nf.close";
|
||||
shellScript = "# Xcode auto-versioning script for Subversion\n# by Axel Andersson, modified by Daniel Jalkut to add\n# \"--revision HEAD\" to the svn info line, which allows\n# the latest revision to always be used.\n\nif ENV[\"BUILT_PRODUCTS_DIR\"].nil?\n\tSTDERR.print \"#{$0}: Must be run from Xcode!\"\n\texit(1)\nend\n\n# Get the current Bzr revision number and use it to set the CFBundleVersion value\nENV[\"PATH\"] = \"/bin:/sw/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/opt/local/bin\"\nexit(0) if `type bzr` == \"\"\nrev = `/usr/bin/env bzr revno`\ninfo = \"#{ENV[\"BUILT_PRODUCTS_DIR\"]}/#{ENV[\"WRAPPER_NAME\"]}/Resources/Info.plist\"\nversion = rev[/[\\d.]+/]\n\nif version.nil?\n\tSTDERR.print \"#{$0}: Can't find a Bazaar revision!\"\n\texit(0)\nend\n\ninfo_contents = File.read(info)\nif info_contents.nil?\n\tSTDERR.print \"#{$0}: Can't read in the Info.plist file!\"\n\texit(1)\nend\n\ninfo_contents.sub!(/([\\t ]+<key>CFBundleVersion<\\/key>\\n[\\t ]+<string>).*?(<\\/string>)/, '\\1' + version + '\\2')\nSTDERR.print info_contents\nf = File.open(info, \"w\")\nf.write(info_contents)\nf.close";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
6195D4B40E40505A00D41A50 /* Run Script: Link fr_CA to fr */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Run Script: Link fr_CA to fr";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = "/usr/bin/env ruby";
|
||||
shellScript = "resources = \"#{ENV[\"BUILT_PRODUCTS_DIR\"]}/#{ENV[\"WRAPPER_NAME\"]}/Resources\"\n`ln -s \"#{resources}/fr.lproj\" \"#{resources}/fr_CA.lproj\"`";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@@ -832,44 +827,35 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
61B5F8EA09C4CE3C00B25A18 /* NSString+extras.m in Sources */,
|
||||
61B5F8EC09C4CE3C00B25A18 /* RSS.m in Sources */,
|
||||
61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */,
|
||||
61B5F8EF09C4CE3C00B25A18 /* NSFileManager+Authentication.m in Sources */,
|
||||
61B5F8EF09C4CE3C00B25A18 /* SUPlainInstallerInternals.m in Sources */,
|
||||
61B5FBB709C4FAFF00B25A18 /* SUAppcast.m in Sources */,
|
||||
61B5FC6F09C51F4900B25A18 /* SUAppcastItem.m in Sources */,
|
||||
61B5FCDE09C52A9F00B25A18 /* SUUpdateAlert.m in Sources */,
|
||||
6196CFFA09C72149000DC222 /* SUStatusController.m in Sources */,
|
||||
61299A3009CA2DAB00B7442F /* NSFileManager+Verification.m in Sources */,
|
||||
61299A3009CA2DAB00B7442F /* SUDSAVerifier.m in Sources */,
|
||||
61299A6009CA6EB100B7442F /* SUConstants.m in Sources */,
|
||||
61299A8E09CA790200B7442F /* SUUnarchiver.m in Sources */,
|
||||
6120721309CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m in Sources */,
|
||||
610EC1E00CF3A5FE00AE239E /* NTSynchronousTask.m in Sources */,
|
||||
6117795A0D1111C900749C97 /* NSWorkspace_RBAdditions.m in Sources */,
|
||||
61A225940D1C3ADD00430CCD /* NSBundle+SUAdditions.m in Sources */,
|
||||
61A225A50D1C4AC000430CCD /* SUStandardVersionComparator.m in Sources */,
|
||||
61A2262C0D1C58FD00430CCD /* SUUserDefaults.m in Sources */,
|
||||
61A2279D0D1CEE7600430CCD /* SUSystemProfiler.m in Sources */,
|
||||
612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */,
|
||||
6171D9080D57B81800BFE886 /* NSFileManager+Aliases.m in Sources */,
|
||||
61180BCB0D64138900B4E0D1 /* SUWindowController.m in Sources */,
|
||||
61C1F2790DA066C2007ACE13 /* NSFileManager+ExtendedAttributes.m in Sources */,
|
||||
618FA5020DAE88B40026945C /* SUInstaller.m in Sources */,
|
||||
618FA5060DAE8AB80026945C /* SUPlainInstaller.m in Sources */,
|
||||
618FA5230DAE8E8A0026945C /* SUPackageInstaller.m in Sources */,
|
||||
61F83F720DBFE140006FDD30 /* SUBasicUpdateDriver.m in Sources */,
|
||||
61B93A3D0DD02D7000DCD2F8 /* SUUIBasedUpdateDriver.m in Sources */,
|
||||
61B93AA30DD0E2D300DCD2F8 /* NSURL+Parameters.m in Sources */,
|
||||
61B93B280DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m in Sources */,
|
||||
61B93C0A0DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m in Sources */,
|
||||
610134740DD250470049ACDF /* SUUpdateDriver.m in Sources */,
|
||||
610134780DD252E60049ACDF /* NSWorkspace+SystemVersion.m in Sources */,
|
||||
6101347C0DD2541A0049ACDF /* SUProbingUpdateDriver.m in Sources */,
|
||||
784590C20DE0429F00D0D64B /* NSNumber+Units.m in Sources */,
|
||||
61A354560DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.m in Sources */,
|
||||
6102FE4B0E07803800F85D09 /* SUDiskImageUnarchiver.m in Sources */,
|
||||
6102FE5C0E08C7EC00F85D09 /* SUUnarchiver_Private.m in Sources */,
|
||||
61D85D6D0E10B2ED00F9B4A9 /* SUPipedUnarchiver.m in Sources */,
|
||||
61EF67560E25B58D00F754E0 /* SUHost.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -884,11 +870,6 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
612279EE0DB547FE00AB99EA /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 8DC2EF4F0486A6940098B216 /* Sparkle */;
|
||||
targetProxy = 612279ED0DB547FE00AB99EA /* PBXContainerItemProxy */;
|
||||
};
|
||||
61227ABA0DB5C4BB00AB99EA /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 612279D80DB5470200AB99EA /* Sparkle Unit Tests */;
|
||||
@@ -899,6 +880,11 @@
|
||||
target = 8DC2EF4F0486A6940098B216 /* Sparkle */;
|
||||
targetProxy = 61B5F91B09C4CF7200B25A18 /* PBXContainerItemProxy */;
|
||||
};
|
||||
61FA528D0E2D9EB200EF58AD /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 8DC2EF4F0486A6940098B216 /* Sparkle */;
|
||||
targetProxy = 61FA528C0E2D9EB200EF58AD /* PBXContainerItemProxy */;
|
||||
};
|
||||
DAAEFD500DA572460051E0D0 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = DAAEFC950DA571DF0051E0D0 /* relaunch tool */;
|
||||
@@ -914,6 +900,10 @@
|
||||
61AAE84F0A321AF700D8810D /* es */,
|
||||
61AAE8590A321B0400D8810D /* fr */,
|
||||
61AAE8710A321F7700D8810D /* nl */,
|
||||
619B17200E1E9D0800E72754 /* de */,
|
||||
61F614540E24A12D009F47E7 /* it */,
|
||||
618915730E35937600B5E981 /* sv */,
|
||||
6195D4920E404AD700D41A50 /* ru */,
|
||||
);
|
||||
name = Sparkle.strings;
|
||||
sourceTree = "<group>";
|
||||
@@ -925,6 +915,10 @@
|
||||
61F3652B0E189883007ECA02 /* es */,
|
||||
61F365300E18988F007ECA02 /* fr */,
|
||||
61F365350E1898A3007ECA02 /* nl */,
|
||||
619B17210E1E9D0800E72754 /* de */,
|
||||
61F614550E24A12D009F47E7 /* it */,
|
||||
618915720E35937600B5E981 /* sv */,
|
||||
6195D4910E404AD600D41A50 /* ru */,
|
||||
);
|
||||
name = SUAutomaticUpdateAlert.nib;
|
||||
sourceTree = "<group>";
|
||||
@@ -936,6 +930,10 @@
|
||||
61F3652A0E189883007ECA02 /* es */,
|
||||
61F3652F0E18988F007ECA02 /* fr */,
|
||||
61F365340E1898A3007ECA02 /* nl */,
|
||||
619B17220E1E9D0800E72754 /* de */,
|
||||
61F614560E24A12D009F47E7 /* it */,
|
||||
618915710E35937600B5E981 /* sv */,
|
||||
6195D4900E404AD600D41A50 /* ru */,
|
||||
);
|
||||
name = SUUpdateAlert.nib;
|
||||
sourceTree = "<group>";
|
||||
@@ -963,6 +961,10 @@
|
||||
61F3651A0E18987B007ECA02 /* es */,
|
||||
61F3652E0E18988F007ECA02 /* fr */,
|
||||
61F365330E1898A3007ECA02 /* nl */,
|
||||
619B17230E1E9D0800E72754 /* de */,
|
||||
61F614570E24A12D009F47E7 /* it */,
|
||||
618915700E35937600B5E981 /* sv */,
|
||||
6195D48F0E404AD600D41A50 /* ru */,
|
||||
);
|
||||
name = SUUpdatePermissionPrompt.nib;
|
||||
sourceTree = "<group>";
|
||||
@@ -981,18 +983,21 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = FA1941D50D94A70100DD942E /* ConfigFrameworkRelease.xcconfig */;
|
||||
buildSettings = {
|
||||
GCC_DEBUGGING_SYMBOLS = full;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1DEB91B208733DA50010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
WARNING_CFLAGS = "-Wundeclared-selector";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB91B308733DA50010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
WARNING_CFLAGS = "-Wundeclared-selector";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -1000,6 +1005,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_VERSION = "";
|
||||
WARNING_CFLAGS = "-Wundeclared-selector";
|
||||
};
|
||||
name = "Release (GC dual-mode; 10.5-only)";
|
||||
};
|
||||
@@ -1057,7 +1063,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(NATIVE_ARCH)";
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
@@ -1078,6 +1084,7 @@
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = "Sparkle Unit Tests";
|
||||
WRAPPER_EXTENSION = octest;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
||||
@@ -25,8 +25,10 @@
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>SUFeedURL</key>
|
||||
<string>http://www.andymatuschfsfjak.org/files/sparkletestcast.xml</string>
|
||||
<string>http://www.andymatuschak.org/files/sparkletestcast.xml</string>
|
||||
<key>SUEnableSystemProfiling</key>
|
||||
<true/>
|
||||
<key>SUPublicDSAKeyFile</key>
|
||||
<string>dsa_pub.pem</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,20 @@
|
||||
-----BEGIN DSA PRIVATE KEY-----
|
||||
MIIDPgIBAAKCAQEA9lmy8fAXdW9b6fBXQ6Us5B2dLZV+cR685tFlhPSKJDpicP1F
|
||||
pNRkGESZwPFJbnxUyVeHWVS9yLeMcKqllhcjd+i1oEFKX7LPXk5+zO745OwVWHIe
|
||||
0DLOIxhJ0mJHm7mH1YVGZYOVVYkPt+0Y/hDbQVK5DycSGAhgDiCZ+Obl+aDSD2xJ
|
||||
RZGnVOpu83dYJ/CoUYCHqWtpN4gW5Bbgm8Uz0/2qiyPjFvJEeI1yE04AZA3sOg1y
|
||||
1S/UrCbqeC3gBIs0xsskwWOW3zCWjvDWgfPrj65At0mVfq/yyGgXJlN71X5sONxR
|
||||
swZSbRn5T2i/BJPZUStWks5Nxq+7T3WmnaPbTwIVAJp+BByoy95V3x8wZg0q66eR
|
||||
ufiJAoIBABbxkX6C9Lt8zeDvvIpk8X4kmHBVIwVJcuICJTVzOAIBZsvFhPnYmUYe
|
||||
v93oPgjtAdYqPrYZlNrExQG1e7B1bhmgaT8hbXL6whxhqRHKlsJsboVHNQs3qAbx
|
||||
sOLvJnwgb3FD4xX4ZZSSRXSIGk62FxcaoLG+mSlirGM/SY4yZDpURSJUX6MHdUZa
|
||||
qHWWGL3b31pz3d9h6SPYv6H4T3ZReVtn+dXYh/41SWkQqEyhAsHGBvqpDwuYJCCI
|
||||
Mwuvwz0U/KcwiydDaFo900MC9S33zEpk/YUxgA9YsiY5+UvWSy5M/yvkKBkvkb+I
|
||||
G6DAMWtApWu0fDcLV6jA9JKXmcAwAIECggEBAPC0OJEnLkOwU1Ehop7o2XJbWDKN
|
||||
giFt44IO3l9gx1fu05HrieDbwAJTkRK7qNEA0yk1iMT2hMHHbwLRNddEsOJuUd7o
|
||||
iyKwqwkmCQ2Q1zYPBR09wag9NEr8xLSTQJCw9CpxTRSH+9hc1DeuwkwAnTEn7JiW
|
||||
WbcxVCRtmtaUlN7+dTozxqGJHpYF6WsqHMeuG7Ixnyf6he8Fz8mjxnrc7/l73gFL
|
||||
Q+IZvUSjzh2zqtqaejtcmlNcT+fGmEFKxpcLB3JP3uu8PN8MbS/R6j191f1ovuM9
|
||||
U4MO3RuT4xJF0OlwyWAnOEik1S1p+tNQciQ/Ipv8Ff3DDBct9YZPPlNGi+ICFHHD
|
||||
tP5yX7hMTJIykGaMuM44KJMM
|
||||
-----END DSA PRIVATE KEY-----
|
||||
@@ -0,0 +1,20 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIDOzCCAi0GByqGSM44BAEwggIgAoIBAQD2WbLx8Bd1b1vp8FdDpSzkHZ0tlX5x
|
||||
Hrzm0WWE9IokOmJw/UWk1GQYRJnA8UlufFTJV4dZVL3It4xwqqWWFyN36LWgQUpf
|
||||
ss9eTn7M7vjk7BVYch7QMs4jGEnSYkebuYfVhUZlg5VViQ+37Rj+ENtBUrkPJxIY
|
||||
CGAOIJn45uX5oNIPbElFkadU6m7zd1gn8KhRgIepa2k3iBbkFuCbxTPT/aqLI+MW
|
||||
8kR4jXITTgBkDew6DXLVL9SsJup4LeAEizTGyyTBY5bfMJaO8NaB8+uPrkC3SZV+
|
||||
r/LIaBcmU3vVfmw43FGzBlJtGflPaL8Ek9lRK1aSzk3Gr7tPdaado9tPAhUAmn4E
|
||||
HKjL3lXfHzBmDSrrp5G5+IkCggEAFvGRfoL0u3zN4O+8imTxfiSYcFUjBUly4gIl
|
||||
NXM4AgFmy8WE+diZRh6/3eg+CO0B1io+thmU2sTFAbV7sHVuGaBpPyFtcvrCHGGp
|
||||
EcqWwmxuhUc1CzeoBvGw4u8mfCBvcUPjFfhllJJFdIgaTrYXFxqgsb6ZKWKsYz9J
|
||||
jjJkOlRFIlRfowd1RlqodZYYvdvfWnPd32HpI9i/ofhPdlF5W2f51diH/jVJaRCo
|
||||
TKECwcYG+qkPC5gkIIgzC6/DPRT8pzCLJ0NoWj3TQwL1LffMSmT9hTGAD1iyJjn5
|
||||
S9ZLLkz/K+QoGS+Rv4gboMAxa0Cla7R8NwtXqMD0kpeZwDAAgQOCAQYAAoIBAQDw
|
||||
tDiRJy5DsFNRIaKe6NlyW1gyjYIhbeOCDt5fYMdX7tOR64ng28ACU5ESu6jRANMp
|
||||
NYjE9oTBx28C0TXXRLDiblHe6IsisKsJJgkNkNc2DwUdPcGoPTRK/MS0k0CQsPQq
|
||||
cU0Uh/vYXNQ3rsJMAJ0xJ+yYllm3MVQkbZrWlJTe/nU6M8ahiR6WBelrKhzHrhuy
|
||||
MZ8n+oXvBc/Jo8Z63O/5e94BS0PiGb1Eo84ds6ramno7XJpTXE/nxphBSsaXCwdy
|
||||
T97rvDzfDG0v0eo9fdX9aL7jPVODDt0bk+MSRdDpcMlgJzhIpNUtafrTUHIkPyKb
|
||||
/BX9wwwXLfWGTz5TRovi
|
||||
-----END PUBLIC KEY-----
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import "SUVersionComparisonTest.h"
|
||||
#import "Sparkle.h"
|
||||
#import "SUStandardVersionComparator.h"
|
||||
|
||||
@implementation SUVersionComparisonTest
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+50
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBClasses</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>SUWindowController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSWindowController</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>doNotInstall</key>
|
||||
<string>id</string>
|
||||
<key>installLater</key>
|
||||
<string>id</string>
|
||||
<key>installNow</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>SUAutomaticUpdateAlert</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>SUWindowController</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>FirstResponder</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSObject</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>667</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../Sparkle.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>6</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Binary file not shown.
Generated
+67
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBClasses</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>SUWindowController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSWindowController</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSApplication</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSResponder</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>installUpdate</key>
|
||||
<string>id</string>
|
||||
<key>remindMeLater</key>
|
||||
<string>id</string>
|
||||
<key>skipThisVersion</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>SUUpdateAlert</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>delegate</key>
|
||||
<string>id</string>
|
||||
<key>description</key>
|
||||
<string>NSTextField</string>
|
||||
<key>releaseNotesView</key>
|
||||
<string>WebView</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>SUWindowController</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>FirstResponder</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSObject</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Generated
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>667</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../Sparkle.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>6</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
Binary file not shown.
Binary file not shown.
+59
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBClasses</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>SUWindowController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSWindowController</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>finishPrompt</key>
|
||||
<string>id</string>
|
||||
<key>toggleMoreInfo</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>SUUpdatePermissionPrompt</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>delegate</key>
|
||||
<string>id</string>
|
||||
<key>descriptionTextField</key>
|
||||
<string>NSTextField</string>
|
||||
<key>moreInfoButton</key>
|
||||
<string>NSButton</string>
|
||||
<key>moreInfoView</key>
|
||||
<string>NSView</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>SUWindowController</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>FirstResponder</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSObject</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>667</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../Sparkle.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>6</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Binary file not shown.
Generated
+3
-3
@@ -3,17 +3,17 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>667</string>
|
||||
<string>670</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../Sparkle.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>89</integer>
|
||||
<integer>18</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9D34</string>
|
||||
<string>10A96</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
|
||||
BIN
Binary file not shown.
Loaded 100 of 167 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user