mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Compare commits
99
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
9e4b74ff24 | ||
|
|
14358a8c37 | ||
|
|
9afa5febc2 | ||
|
|
68c2e6a055 | ||
|
|
e57ec53978 | ||
|
|
d52c34c433 | ||
|
|
a33225411a | ||
|
|
07875309ba | ||
|
|
7d8ada58e9 | ||
|
|
d77ca73f51 | ||
|
|
1c7fb5922c | ||
|
|
1345017c7e | ||
|
|
a55f11d2ad | ||
|
|
41aeded009 | ||
|
|
1d92b825ee | ||
|
|
c51abb4318 | ||
|
|
756b32f258 | ||
|
|
a9662f5bb4 | ||
|
|
3b86dc72c7 | ||
|
|
46f9b4a049 | ||
|
|
959ef54b7e | ||
|
|
a68727119e | ||
|
|
70e09246ee | ||
|
|
f425746f41 | ||
|
|
ad2c82a73c | ||
|
|
d4291d60d4 | ||
|
|
cd4addbcd7 | ||
|
|
764bed3212 | ||
|
|
3daa88daa4 | ||
|
|
eac4134968 | ||
|
|
792bad502d | ||
|
|
1092c7dba7 | ||
|
|
6295c36561 | ||
|
|
a5dcf946ee | ||
|
|
aba39e3429 | ||
|
|
c2c3a6853c | ||
|
|
074646e830 | ||
|
|
7664995dfc | ||
|
|
af245f3e89 | ||
|
|
6da2774f61 | ||
|
|
441a5382b9 | ||
|
|
4b74af2de9 | ||
|
|
6f85473bc1 | ||
|
|
b7898f5ce7 | ||
|
|
fcf4da886e | ||
|
|
47b5d5f231 | ||
|
|
93ea93dd38 | ||
|
|
7576ba7e38 | ||
|
|
1bd6c13593 | ||
|
|
06bda29f7a | ||
|
|
4a26774818 | ||
|
|
269a648d24 | ||
|
|
c2745f5944 | ||
|
|
fbcdba4f01 | ||
|
|
17a5bf2b96 | ||
|
|
61d53375e5 | ||
|
|
6a551229b9 | ||
|
|
c59c4e50ca | ||
|
|
d855e637cf | ||
|
|
0150b3be46 | ||
|
|
47f42e3810 | ||
|
|
156ce34cdc | ||
|
|
d822487889 | ||
|
|
046a2d1493 | ||
|
|
64755d3c63 | ||
|
|
1552d4eb8b | ||
|
|
0f744dd417 |
No files matched your search
@@ -5,4 +5,4 @@ DEBUG_INFORMATION_FORMAT = dwarf
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
|
||||
SPARKLE_EXTRA_DEBUG = -DDEBUG -fstack-protector -D_FORTIFY_SOURCE=2
|
||||
OTHER_CFLAGS = $(SPARKLE_EXTRA_DEBUG)
|
||||
ARCHS = $(NATIVE_ARCH_32_BIT)
|
||||
ARCHS = $(NATIVE_ARCH_ACTUAL)
|
||||
@@ -6,4 +6,4 @@ GCC_GENERATE_DEBUGGING_SYMBOLS = NO
|
||||
DEAD_CODE_STRIPPING = YES
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES
|
||||
ARCHS = ppc ppc64 i386 x86_64
|
||||
ARCHS = ppc i386 x86_64
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleName</key>
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#ifndef NSBUNDLE_PLUS_ADDITIONS_H
|
||||
#define NSBUNDLE_PLUS_ADDITIONS_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSBundle (SUAdditions)
|
||||
/*!
|
||||
@method
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
#import "Sparkle.h"
|
||||
#import "NSBundle+SUAdditions.h"
|
||||
|
||||
#ifndef NSAppKitVersionNumber10_4
|
||||
#define NSAppKitVersionNumber10_4 824
|
||||
#endif
|
||||
|
||||
@implementation NSBundle (SUAdditions)
|
||||
|
||||
- (NSString *)name
|
||||
@@ -49,7 +53,7 @@
|
||||
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)]; }
|
||||
if (!icon) { icon = [NSImage imageNamed:@"NSDefaultApplicationIcon"]; }
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSFileManager (Aliases)
|
||||
@interface NSFileManager (SUAliases)
|
||||
- (BOOL)isAliasFolderAtPath:(NSString *)path;
|
||||
@end
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#import "NSFileManager+Aliases.h"
|
||||
|
||||
|
||||
@implementation NSFileManager (Aliases)
|
||||
@implementation NSFileManager (SUAliases)
|
||||
|
||||
- (BOOL)isAliasFolderAtPath:(NSString *)path
|
||||
{
|
||||
|
||||
@@ -82,7 +82,8 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
if ((bundle = [NSBundle bundleWithPath:path]))
|
||||
{
|
||||
// We'll clean it up a little for safety.
|
||||
NSMutableCharacterSet *validCharacters = [NSMutableCharacterSet alphanumericCharacterSet];
|
||||
// The cast is necessary because of a bug in the headers in pre-10.5 SDKs
|
||||
NSMutableCharacterSet *validCharacters = (id)[NSMutableCharacterSet alphanumericCharacterSet];
|
||||
[validCharacters formUnionWithCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@".-()"]];
|
||||
postFix = [[bundle objectForInfoDictionaryKey:@"CFBundleVersion"] stringByTrimmingCharactersInSet:[validCharacters invertedSet]];
|
||||
}
|
||||
@@ -229,11 +230,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
// Trash the old copy of the app.
|
||||
NSInteger tag = 0;
|
||||
if (![[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[tmpPath stringByDeletingLastPathComponent] destination:@"" files:[NSArray arrayWithObject:[tmpPath lastPathComponent]] tag:&tag])
|
||||
{
|
||||
if (error != NULL)
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to the trash. This is often a sign of a permissions error.", src, dst] forKey:NSLocalizedDescriptionKey]];
|
||||
return NO;
|
||||
}
|
||||
NSLog(@"Sparkle error: couldn't move %@ to the trash. This is often a sign of a permissions error.", tmpPath);
|
||||
|
||||
// If the currently-running application is trusted, the new
|
||||
// version should be trusted as well. Remove it from the
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSFileManager (ExtendedAttributes)
|
||||
@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
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#define XATTR_NOFOLLOW 1
|
||||
#endif // SDK >= 10.4
|
||||
|
||||
@implementation NSFileManager (ExtendedAttributes)
|
||||
@implementation NSFileManager (MMExtendedAttributes)
|
||||
|
||||
- (int)removeXAttr:(const char*)name
|
||||
fromFile:(NSString*)file
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface NSNumber (Units)
|
||||
@interface NSNumber (JWUnits)
|
||||
|
||||
+ (NSString *)humanReadableSizeFromDouble:(double)value;
|
||||
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
#import "NSNumber+Units.h"
|
||||
#import "Sparkle.h"
|
||||
|
||||
@implementation NSNumber (Units)
|
||||
@implementation NSNumber (JWUnits)
|
||||
|
||||
+ (NSString *)humanReadableSizeFromDouble:(double)value
|
||||
{
|
||||
@@ -17,7 +17,7 @@
|
||||
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")];
|
||||
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")];
|
||||
|
||||
@@ -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 (extras)
|
||||
|
||||
- (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 (extras)
|
||||
|
||||
- (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
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSWorkspace (SystemVersion)
|
||||
@interface NSWorkspace (SUSystemVersion)
|
||||
+ (NSString *)systemVersionString;
|
||||
@end
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#import "NSWorkspace+SystemVersion.h"
|
||||
|
||||
|
||||
@implementation NSWorkspace (SystemVersion)
|
||||
@implementation NSWorkspace (SUSystemVersion)
|
||||
+ (NSString *)systemVersionString
|
||||
{
|
||||
// This returns a version string of the form X.Y.Z
|
||||
|
||||
@@ -137,11 +137,8 @@ static NSString* CheckParents(io_object_t thing,NSString* part,NSMutableDictiona
|
||||
NSMutableDictionary* result = nil;
|
||||
struct statfs fs = {};
|
||||
if (!statfs(ccpath,&fs)) {
|
||||
NSString* from = [NSString stringWithUTF8String:fs.f_mntfromname];
|
||||
result = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSString stringWithUTF8String:fs.f_fstypename],NSWorkspace_RBfstypename,
|
||||
[NSString stringWithUTF8String:fs.f_mntonname],NSWorkspace_RBmntonname,
|
||||
nil];
|
||||
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) {
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@
|
||||
NS_HANDLER;
|
||||
NS_ENDHANDLER;
|
||||
|
||||
[pool release];
|
||||
[pool drain];
|
||||
|
||||
// retained above
|
||||
[result autorelease];
|
||||
|
||||
@@ -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,722 +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];
|
||||
}
|
||||
|
||||
- (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: @"%@...", 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: @"%@...", 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
|
||||
@@ -14,6 +14,7 @@
|
||||
NSArray *items;
|
||||
NSString *userAgentString;
|
||||
id delegate;
|
||||
NSMutableData *incrementalData;
|
||||
}
|
||||
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url;
|
||||
|
||||
+120
-24
@@ -28,40 +28,133 @@
|
||||
|
||||
- (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:
|
||||
items = [NSMutableArray array];
|
||||
id enumerator = [[feed newsItems] objectEnumerator], current;
|
||||
@try
|
||||
{
|
||||
while ((current = [enumerator nextObject]))
|
||||
{
|
||||
[(NSMutableArray *)items addObject:[[[SUAppcastItem alloc] initWithDictionary:current] autorelease]];
|
||||
[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)
|
||||
{
|
||||
|
||||
NSEnumerator *nodeEnum = [xmlItems objectEnumerator];
|
||||
NSXMLNode *node;
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
||||
|
||||
while (failed == NO && (node = [nodeEnum nextObject]))
|
||||
{
|
||||
// walk the children in reverse
|
||||
node = [[node children] lastObject];
|
||||
while (nil != node)
|
||||
{
|
||||
|
||||
NSString *name = [node 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
|
||||
{
|
||||
// add all other values as strings
|
||||
[dict setObject:[[node stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] forKey:name];
|
||||
}
|
||||
|
||||
// previous sibling; returns nil when exhausted
|
||||
node = [node previousSibling];
|
||||
}
|
||||
SUAppcastItem *anItem = [[SUAppcastItem alloc] initWithDictionary:dict];
|
||||
if (anItem)
|
||||
{
|
||||
[appcastItems addObject:anItem];
|
||||
[anItem release];
|
||||
}
|
||||
else
|
||||
{
|
||||
failed = YES;
|
||||
}
|
||||
[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]]];
|
||||
return;
|
||||
}
|
||||
items = [[NSArray arrayWithArray:items] retain]; // Make the items list immutable.
|
||||
|
||||
[document release];
|
||||
|
||||
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)])
|
||||
[delegate performSelectorOnMainThread:@selector(appcastDidFinishLoading:) withObject:self waitUntilDone:NO];
|
||||
|
||||
CFRelease(feed);
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
- (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:)])
|
||||
@@ -72,8 +165,11 @@
|
||||
|
||||
- (void)setUserAgentString:(NSString *)uas
|
||||
{
|
||||
[userAgentString release];
|
||||
userAgentString = [uas copy];
|
||||
if (uas != userAgentString)
|
||||
{
|
||||
[userAgentString release];
|
||||
userAgentString = [uas copy];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setDelegate:del
|
||||
|
||||
+43
-28
@@ -17,6 +17,7 @@
|
||||
|
||||
- (void)setTitle:(NSString *)aTitle
|
||||
{
|
||||
if (title == aTitle) return;
|
||||
[title release];
|
||||
title = [aTitle copy];
|
||||
}
|
||||
@@ -26,6 +27,7 @@
|
||||
|
||||
- (void)setDate:(NSDate *)aDate
|
||||
{
|
||||
if (date == aDate) return;
|
||||
[date release];
|
||||
date = [aDate copy];
|
||||
}
|
||||
@@ -35,6 +37,7 @@
|
||||
|
||||
- (void)setDescription:(NSString *)aDescription
|
||||
{
|
||||
if (description == aDescription) return;
|
||||
[description release];
|
||||
description = [aDescription copy];
|
||||
}
|
||||
@@ -44,6 +47,7 @@
|
||||
|
||||
- (void)setReleaseNotesURL:(NSURL *)aReleaseNotesURL
|
||||
{
|
||||
if (releaseNotesURL == aReleaseNotesURL) return;
|
||||
[releaseNotesURL release];
|
||||
releaseNotesURL = [aReleaseNotesURL copy];
|
||||
}
|
||||
@@ -53,6 +57,7 @@
|
||||
|
||||
- (void)setDSASignature:(NSString *)aDSASignature
|
||||
{
|
||||
if (DSASignature == aDSASignature) return;
|
||||
[DSASignature release];
|
||||
DSASignature = [aDSASignature copy];
|
||||
}
|
||||
@@ -62,6 +67,7 @@
|
||||
|
||||
- (void)setFileURL:(NSURL *)aFileURL
|
||||
{
|
||||
if (fileURL == aFileURL) return;
|
||||
[fileURL release];
|
||||
fileURL = [aFileURL copy];
|
||||
}
|
||||
@@ -71,6 +77,7 @@
|
||||
|
||||
- (void)setVersionString:(NSString *)s
|
||||
{
|
||||
if (versionString == s) return;
|
||||
[versionString release];
|
||||
versionString = [s copy];
|
||||
}
|
||||
@@ -80,6 +87,7 @@
|
||||
|
||||
- (void)setDisplayVersionString:(NSString *)s
|
||||
{
|
||||
if (displayVersionString == s) return;
|
||||
[displayVersionString release];
|
||||
displayVersionString = [s copy];
|
||||
}
|
||||
@@ -88,6 +96,7 @@
|
||||
- (NSString *)minimumSystemVersion { return [[minimumSystemVersion retain] autorelease]; }
|
||||
- (void)setMinimumSystemVersion:(NSString *)systemVersionString
|
||||
{
|
||||
if (minimumSystemVersion == systemVersionString) return;
|
||||
[minimumSystemVersion release];
|
||||
minimumSystemVersion = [systemVersionString copy];
|
||||
}
|
||||
@@ -97,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:
|
||||
@@ -117,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 = [dict retain];
|
||||
[self setTitle:[dict objectForKey:@"title"]];
|
||||
[self setDate:[dict objectForKey:@"pubDate"]];
|
||||
[self setDescription:[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 description] hasPrefix:@"http://"]) // if the description starts with http://, use that.
|
||||
[self setReleaseNotesURL:[NSURL URLWithString:[self description]]];
|
||||
else
|
||||
[self setReleaseNotesURL:nil];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
{
|
||||
alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:updateItem hostBundle:hostBundle delegate:self];
|
||||
if ([NSApp isActive])
|
||||
[alert showWindow:self];
|
||||
[[alert window] makeKeyAndOrderFront:self];
|
||||
else
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(NSNotification *)aNotification
|
||||
{
|
||||
[alert showWindow:self];
|
||||
[[alert window] makeKeyAndOrderFront:self];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSApplicationDidBecomeActiveNotification" object:NSApp];
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
- (void)installerFinishedForHostBundle:(NSBundle *)hb
|
||||
{
|
||||
if (hb != hostBundle) { return; }
|
||||
[unarchiver cleanUp];
|
||||
if (!postponingInstallation)
|
||||
[self relaunchHostApp];
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
NSURLDownload *download;
|
||||
NSString *downloadPath;
|
||||
|
||||
SUUnarchiver *unarchiver;
|
||||
|
||||
NSString *relaunchPath;
|
||||
}
|
||||
|
||||
@@ -49,7 +47,9 @@
|
||||
- (void)installUpdate;
|
||||
- (void)installerFinishedForHostBundle:(NSBundle *)hb;
|
||||
- (void)installerForHostBundle:(NSBundle *)hb failedWithError:(NSError *)error;
|
||||
|
||||
- (void)relaunchHostApp;
|
||||
- (void)cleanUp;
|
||||
|
||||
- (void)abortUpdate;
|
||||
- (void)abortUpdateWithError:(NSError *)error;
|
||||
|
||||
+63
-39
@@ -17,7 +17,7 @@
|
||||
|
||||
if ([hostBundle isRunningFromDiskImage])
|
||||
{
|
||||
[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, 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 disk image. Move %1$@ to your Applications folder, relaunch it from there, and try again.", nil), [hostBundle name]] forKey:NSLocalizedDescriptionKey]]];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,29 +26,42 @@
|
||||
[appcast release];
|
||||
|
||||
[appcast setDelegate:self];
|
||||
[appcast setUserAgentString:[NSString stringWithFormat: @"%@/%@ Sparkle/1.5b1", [hostBundle name], [hostBundle displayVersion]]];
|
||||
[appcast setUserAgentString:[NSString stringWithFormat: @"%@/%@ Sparkle/1.5b4", [hostBundle name], [hostBundle displayVersion]]];
|
||||
[appcast fetchAppcastFromURL:appcastURL];
|
||||
[[SUUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:SULastCheckTimeKey];
|
||||
}
|
||||
|
||||
- (id <SUVersionComparison>)_versionComparator
|
||||
{
|
||||
id <SUVersionComparison> comparator = nil;
|
||||
|
||||
// Give the delegate a chance to provide a custom version comparator
|
||||
if ([delegate respondsToSelector:@selector(versionComparatorForHostBundle:)])
|
||||
comparator = [delegate versionComparatorForHostBundle:hostBundle];
|
||||
|
||||
// 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:[hostBundle 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:[NSWorkspace systemVersionString]] != NSOrderedDescending;
|
||||
}
|
||||
|
||||
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui
|
||||
{
|
||||
NSString *skippedVersion = [[SUUserDefaults standardUserDefaults] objectForKey: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,22 +71,18 @@
|
||||
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)])
|
||||
[delegate appcastDidFinishLoading:ac];
|
||||
|
||||
NSArray* updates = [ac items];
|
||||
if ([updates count] > 0)
|
||||
[[SUUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:SULastCheckTimeKey];
|
||||
|
||||
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:forHostBundle:)])
|
||||
[delegate appcastDidFinishLoading:ac forHostBundle:hostBundle];
|
||||
|
||||
// Now we have to find the best valid update in the appcast.
|
||||
if ([delegate respondsToSelector:@selector(bestValidUpdateInAppcast:)]) // Does the delegate want to handle it?
|
||||
if ([delegate respondsToSelector:@selector(bestValidUpdateInAppcast:forHostBundle:)]) // Does the delegate want to handle it?
|
||||
{
|
||||
updateItem = [delegate bestValidUpdateInAppcast:ac];
|
||||
updateItem = [delegate bestValidUpdateInAppcast:ac forHostBundle:hostBundle];
|
||||
}
|
||||
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]);
|
||||
@@ -97,13 +106,15 @@
|
||||
|
||||
- (void)didFindValidUpdate
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(didFindValidUpdate:)])
|
||||
[delegate didFindValidUpdate:updateItem];
|
||||
if ([delegate respondsToSelector:@selector(didFindValidUpdate:toHostBundle:)])
|
||||
[delegate didFindValidUpdate:updateItem toHostBundle:hostBundle];
|
||||
[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]]];
|
||||
}
|
||||
|
||||
@@ -162,18 +173,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
unarchiver = [[SUUnarchiver alloc] init];
|
||||
SUUnarchiver *unarchiver = [SUUnarchiver unarchiverForURL:[[[NSURL alloc] initFileURLWithPath:downloadPath] autorelease]];
|
||||
if (!unarchiver)
|
||||
{
|
||||
NSLog(@"Sparkle Error: No valid unarchiver for %@!", downloadPath);
|
||||
[self unarchiverDidFail:nil];
|
||||
return;
|
||||
}
|
||||
CFRetain(unarchiver); // Manage this memory manually so we don't have to make it an IV.
|
||||
[unarchiver setDelegate:self];
|
||||
[unarchiver unarchivePath:downloadPath];
|
||||
[unarchiver start];
|
||||
}
|
||||
|
||||
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
|
||||
{
|
||||
if (ua) { CFRelease(ua); }
|
||||
[self installUpdate];
|
||||
}
|
||||
|
||||
- (void)unarchiverDidFail:(SUUnarchiver *)ua
|
||||
{
|
||||
if (ua) { CFRelease(ua); }
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:[NSDictionary dictionaryWithObject:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil) forKey:NSLocalizedDescriptionKey]]];
|
||||
}
|
||||
|
||||
@@ -181,8 +201,8 @@
|
||||
|
||||
- (void)installUpdate
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(updateWillInstall:)])
|
||||
[delegate updateWillInstall:updateItem];
|
||||
if ([delegate respondsToSelector:@selector(updateWillInstall:toHostBundle:)])
|
||||
[delegate updateWillInstall:updateItem toHostBundle:hostBundle];
|
||||
// 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]];
|
||||
@@ -197,7 +217,6 @@
|
||||
- (void)installerFinishedForHostBundle:(NSBundle *)hb
|
||||
{
|
||||
if (hb != hostBundle) { return; }
|
||||
[unarchiver cleanUp];
|
||||
[self relaunchHostApp];
|
||||
}
|
||||
|
||||
@@ -205,36 +224,40 @@
|
||||
{
|
||||
// Give the host app an opportunity to postpone the relaunch.
|
||||
static BOOL postponedOnce = NO;
|
||||
if (!postponedOnce && [delegate respondsToSelector:@selector(shouldPostponeRelaunchForUpdate:untilInvoking:)])
|
||||
if (!postponedOnce && [delegate respondsToSelector:@selector(shouldPostponeRelaunchForUpdate:toHostBundle:untilInvoking:)])
|
||||
{
|
||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[[self class] instanceMethodSignatureForSelector:@selector(relaunchHostApp)] retain]];
|
||||
[invocation setSelector:@selector(relaunchHostApp)];
|
||||
[invocation setTarget:self];
|
||||
postponedOnce = YES;
|
||||
if ([delegate shouldPostponeRelaunchForUpdate:updateItem untilInvoking:invocation])
|
||||
if ([delegate shouldPostponeRelaunchForUpdate:updateItem toHostBundle:hostBundle 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];
|
||||
|
||||
@try
|
||||
{
|
||||
if(!relaunchPath || ![[NSFileManager defaultManager] fileExistsAtPath:relaunchPath])
|
||||
[NSException raise:@"SURelauncherNotFound" format:@"Couldn't find the relauncher (expected to find it at %@)", relaunchPath];
|
||||
|
||||
[NSTask launchedTaskWithLaunchPath:relaunchPath arguments:[NSArray arrayWithObjects:[hostBundle bundlePath], [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]];
|
||||
}
|
||||
@catch (NSException *e)
|
||||
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, [e reason], 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), [[NSBundle mainBundle] 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]];
|
||||
|
||||
[NSApp terminate:self];
|
||||
}
|
||||
|
||||
- (void)cleanUp
|
||||
{
|
||||
[[NSFileManager defaultManager] removeFileAtPath:[downloadPath stringByDeletingLastPathComponent] handler:nil];
|
||||
}
|
||||
|
||||
- (void)installerForHostBundle:(NSBundle *)hb failedWithError:(NSError *)error
|
||||
{
|
||||
if (hb != hostBundle) { return; }
|
||||
@@ -254,16 +277,17 @@
|
||||
NSLog(@"Sparkle Error: %@", [error localizedDescription]);
|
||||
if ([error localizedFailureReason])
|
||||
NSLog(@"Sparkle Error (continued): %@", [error localizedFailureReason]);
|
||||
if (download)
|
||||
[download cancel];
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[hostBundle release];
|
||||
[download release];
|
||||
[downloadPath release];
|
||||
[relaunchPath release];
|
||||
[unarchiver release];
|
||||
[download release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// SUDiskImageUnarchiver.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 6/16/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUDISKIMAGEUNARCHIVER_H
|
||||
#define SUDISKIMAGEUNARCHIVER_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUUnarchiver.h"
|
||||
|
||||
@interface SUDiskImageUnarchiver : SUUnarchiver {
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// SUDiskImageUnarchiver.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 6/16/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUDiskImageUnarchiver.h"
|
||||
#import "SUUnarchiver_Private.h"
|
||||
#import "NTSynchronousTask.h"
|
||||
|
||||
@implementation SUDiskImageUnarchiver
|
||||
|
||||
+ (BOOL)_canUnarchiveURL:(NSURL *)URL
|
||||
{
|
||||
return [URL conformsToType:@"public.disk-image"];
|
||||
}
|
||||
|
||||
- (void)start
|
||||
{
|
||||
[NSThread detachNewThreadSelector:@selector(_extractDMG) toTarget:self withObject:nil];
|
||||
}
|
||||
|
||||
- (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]];
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:mountPoint]) goto reportError;
|
||||
|
||||
// create mount point folder
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:mountPoint attributes:nil];
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:mountPoint]) goto reportError;
|
||||
|
||||
NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, @"-noverify", @"-nobrowse", @"-noautoopen", nil];
|
||||
// set up a pipe and push "yes" (y works too), this will accept any license agreement crap
|
||||
// not every .dmg needs this, but this will make sure it works with everyone
|
||||
NSData* yesData = [[[NSData alloc] initWithBytes:"yes\n" length:4] autorelease];
|
||||
|
||||
NSData *result = [NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:arguments input:yesData];
|
||||
if (!result) goto reportError;
|
||||
mountedSuccessfully = YES;
|
||||
|
||||
// Now that we've mounted it, we need to copy out its contents.
|
||||
NSString *targetPath = [[archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[mountPoint lastPathComponent]];
|
||||
if (![[NSFileManager defaultManager] createDirectoryAtPath:targetPath attributes:nil]) goto reportError;
|
||||
|
||||
// We can't just copyPath: from the volume root because that always fails. Seems to be a bug.
|
||||
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])
|
||||
goto reportError;
|
||||
}
|
||||
|
||||
[self performSelectorOnMainThread:@selector(_notifyDelegateOfSuccess) withObject:nil waitUntilDone:NO];
|
||||
goto finally;
|
||||
|
||||
reportError:
|
||||
[self performSelectorOnMainThread:@selector(_notifyDelegateOfFailure) withObject:nil waitUntilDone:NO];
|
||||
|
||||
finally:
|
||||
if (mountedSuccessfully)
|
||||
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray arrayWithObjects:@"detach", mountPoint, @"-force", nil]];
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
[self _registerImplementation:self];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// SUPipedUnarchiver.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 6/16/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUPIPEDUNARCHIVER_H
|
||||
#define SUPIPEDUNARCHIVER_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUUnarchiver.h"
|
||||
|
||||
@interface SUPipedUnarchiver : SUUnarchiver {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,110 @@
|
||||
//
|
||||
// SUPipedUnarchiver.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 6/16/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUPipedUnarchiver.h"
|
||||
#import "SUUnarchiver_Private.h"
|
||||
|
||||
@implementation SUPipedUnarchiver
|
||||
|
||||
+ (SEL)_selectorConformingToTypeOfURL:(NSURL *)URL
|
||||
{
|
||||
static NSDictionary *typeSelectorDictionary;
|
||||
// HACK: The UTI detector is dumb (not my fault!) and sees .tar.gz files as plain .gz files. If we see something of type .bz2 or .gz, we'll assume it's really a .tar.bz2 or .tar.gz.
|
||||
if (!typeSelectorDictionary)
|
||||
typeSelectorDictionary = [[NSDictionary dictionaryWithObjectsAndKeys:@"_extractZIP", @"com.pkware.zip-archive",
|
||||
@"_extractTGZ", @"org.gnu.gnu-zip-tar-archive", @"_extractTGZ", @"org.gnu.gnu-zip-archive",
|
||||
@"_extractTBZ", @"org.bzip.bzip2-tar-archive", @"_extractTBZ", @"org.bzip.bzip2-archive", @"_extractTBZ", @"public.archive.bzip2",
|
||||
@"_extractTAR", @"public.tar-archive", nil] retain];
|
||||
|
||||
NSEnumerator *typeEnumerator = [typeSelectorDictionary keyEnumerator];
|
||||
id currentType;
|
||||
while ((currentType = [typeEnumerator nextObject]))
|
||||
{
|
||||
if ([URL conformsToType:currentType])
|
||||
return NSSelectorFromString([typeSelectorDictionary objectForKey:currentType]);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- (void)start
|
||||
{
|
||||
[NSThread detachNewThreadSelector:[[self class] _selectorConformingToTypeOfURL:archiveURL] toTarget:self withObject:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)_canUnarchiveURL:(NSURL *)URL
|
||||
{
|
||||
return ([self _selectorConformingToTypeOfURL:URL] != 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.
|
||||
NSNumber *fs = [[[NSFileManager defaultManager] fileAttributesAtPath:archivePath traverseLink:NO] objectForKey:NSFileSize];
|
||||
if (fs == nil) goto reportError;
|
||||
|
||||
// Thank you, Allan Odgaard!
|
||||
// (who wrote the following extraction alg.)
|
||||
fp = fopen([archivePath fileSystemRepresentation], "r");
|
||||
if (!fp) goto reportError;
|
||||
|
||||
setenv("DESTINATION", [[archivePath stringByDeletingLastPathComponent] fileSystemRepresentation], 1);
|
||||
cmdFP = popen([command fileSystemRepresentation], "w");
|
||||
if (!cmdFP) goto reportError;
|
||||
|
||||
char buf[32*1024];
|
||||
long len;
|
||||
while((len = fread(buf, 1, 32*1024, fp)))
|
||||
{
|
||||
fwrite(buf, 1, len, cmdFP);
|
||||
[self performSelectorOnMainThread:@selector(_notifyDelegateOfExtractedLength:) withObject:[NSNumber numberWithLong:len] waitUntilDone:NO];
|
||||
}
|
||||
pclose(cmdFP);
|
||||
|
||||
[self performSelectorOnMainThread:@selector(_notifyDelegateOfSuccess) withObject:nil waitUntilDone:NO];
|
||||
goto finally;
|
||||
|
||||
reportError:
|
||||
[self performSelectorOnMainThread:@selector(_notifyDelegateOfFailure) withObject:nil waitUntilDone:NO];
|
||||
|
||||
finally:
|
||||
if (fp)
|
||||
fclose(fp);
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
- (void)_extractTAR
|
||||
{
|
||||
return [self _extractArchivePipingDataToCommand:@"tar -xC \"$DESTINATION\""];
|
||||
}
|
||||
|
||||
- (void)_extractTGZ
|
||||
{
|
||||
return [self _extractArchivePipingDataToCommand:@"tar -zxC \"$DESTINATION\""];
|
||||
}
|
||||
|
||||
- (void)_extractTBZ
|
||||
{
|
||||
return [self _extractArchivePipingDataToCommand:@"tar -jxC \"$DESTINATION\""];
|
||||
}
|
||||
|
||||
- (void)_extractZIP
|
||||
{
|
||||
return [self _extractArchivePipingDataToCommand:@"ditto -x -k - \"$DESTINATION\""];
|
||||
}
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
[self _registerImplementation:self];
|
||||
}
|
||||
|
||||
@end
|
||||
+1
-1
@@ -27,7 +27,7 @@ extern NSString *SUInstallerDelegateKey;
|
||||
|
||||
[self installPath:[info objectForKey:SUInstallerPathKey] overHostBundle:[info objectForKey:SUInstallerHostBundleKey] delegate:[info objectForKey:SUInstallerDelegateKey]];
|
||||
|
||||
[pool release];
|
||||
[pool drain];
|
||||
}
|
||||
|
||||
+ (void)performInstallationWithPath:(NSString *)path hostBundle:(NSBundle *)hostBundle delegate:delegate synchronously:(BOOL)synchronously;
|
||||
|
||||
@@ -16,9 +16,4 @@
|
||||
@interface SUProbingUpdateDriver : SUBasicUpdateDriver { }
|
||||
@end
|
||||
|
||||
@interface NSObject (SUProbeDriverDelegateProtocol)
|
||||
- (void)didFindValidUpdate:(SUAppcastItem *)item toHostBundle:(NSBundle *)hb;
|
||||
- (void)didNotFindUpdateToHostBundle:(NSBundle *)hb;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -11,17 +11,15 @@
|
||||
|
||||
@implementation SUProbingUpdateDriver
|
||||
|
||||
// Stop as soon as we have an answer! The superclasses will already have taken care of notifying the delegate.
|
||||
|
||||
- (void)didFindValidUpdate
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(didFindValidUpdate:toHostBundle:)])
|
||||
[delegate didFindValidUpdate:updateItem toHostBundle:hostBundle];
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(didNotFindUpdateToHostBundle:)])
|
||||
[delegate didNotFindUpdateToHostBundle:hostBundle];
|
||||
[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>667</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>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
|
||||
Generated
BIN
Binary file not shown.
@@ -28,7 +28,6 @@
|
||||
// If isDefault is YES, the button's key equivalent will be \r.
|
||||
- (void)setButtonTitle:(NSString *)buttonTitle target:target action:(SEL)action isDefault:(BOOL)isDefault;
|
||||
- (void)setButtonEnabled:(BOOL)enabled;
|
||||
- (void)setButtonHidden:(BOOL)hidden;
|
||||
|
||||
- (double)progressValue;
|
||||
- (void)setProgressValue:(double)value;
|
||||
|
||||
+12
-9
@@ -61,7 +61,11 @@
|
||||
- (void)setButtonTitle:(NSString *)aButtonTitle target:target action:(SEL)action isDefault:(BOOL)isDefault
|
||||
{
|
||||
[self willChangeValueForKey:@"buttonTitle"];
|
||||
buttonTitle = [aButtonTitle copy];
|
||||
if (buttonTitle != aButtonTitle)
|
||||
{
|
||||
[buttonTitle release];
|
||||
buttonTitle = [aButtonTitle copy];
|
||||
}
|
||||
[self didChangeValueForKey:@"buttonTitle"];
|
||||
|
||||
[self window];
|
||||
@@ -83,12 +87,6 @@
|
||||
[actionButton setEnabled:enabled];
|
||||
}
|
||||
|
||||
- (void)setButtonHidden:(BOOL)hidden
|
||||
{
|
||||
[actionButton setHidden:hidden];
|
||||
[[actionButton superview] display];
|
||||
}
|
||||
|
||||
- (double)progressValue
|
||||
{
|
||||
return progressValue;
|
||||
@@ -106,14 +104,19 @@
|
||||
|
||||
- (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
|
||||
{
|
||||
statusText = [aStatusText copy];
|
||||
if (statusText != aStatusText)
|
||||
{
|
||||
[statusText release];
|
||||
statusText = [aStatusText copy];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
+14
-2
@@ -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) {
|
||||
@@ -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);
|
||||
|
||||
+16
-13
@@ -22,35 +22,38 @@
|
||||
|
||||
// Only show the update alert if the app is active; otherwise, we'll wait until it is.
|
||||
if ([NSApp isActive])
|
||||
[updateAlert showWindow:self];
|
||||
[[updateAlert window] makeKeyAndOrderFront:self];
|
||||
else
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
|
||||
}
|
||||
|
||||
- (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];
|
||||
[alert runModal];
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(NSNotification *)aNotification
|
||||
{
|
||||
[updateAlert showWindow:self];
|
||||
[[updateAlert window] makeKeyAndOrderFront:self];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSApplicationDidBecomeActiveNotification" object:NSApp];
|
||||
}
|
||||
|
||||
- (void)updateAlert:(SUUpdateAlert *)alert finishedWithChoice:(SUUpdateAlertChoice)choice
|
||||
{
|
||||
[updateAlert release]; updateAlert = nil;
|
||||
if ([delegate respondsToSelector:@selector(userChoseAction:forUpdate:)])
|
||||
[delegate userChoseAction:choice forUpdate:updateItem];
|
||||
if ([delegate respondsToSelector:@selector(userChoseAction:forUpdate:toHostBundle:)])
|
||||
[delegate userChoseAction:choice forUpdate:updateItem toHostBundle:hostBundle];
|
||||
[[SUUserDefaults standardUserDefaults] setObject:nil forKey:SUSkippedVersionKey];
|
||||
switch (choice)
|
||||
{
|
||||
case SUInstallUpdateChoice:
|
||||
statusController = [[SUStatusController alloc] initWithHostBundle:hostBundle];
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Downloading update...", nil) maxProgressValue:0 statusText:nil];
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Downloading update\u2026", nil) maxProgressValue:0 statusText:nil];
|
||||
[statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelDownload:) isDefault:NO];
|
||||
[statusController showWindow:self];
|
||||
[self downloadUpdate];
|
||||
@@ -69,26 +72,26 @@
|
||||
[statusController setMaxProgressValue:[response expectedContentLength]];
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)download didReceiveDataOfLength:(unsigned)length
|
||||
- (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), [NSNumber humanReadableSizeFromDouble:[statusController progressValue]], [NSNumber humanReadableSizeFromDouble:[statusController maxProgressValue]]]];
|
||||
else
|
||||
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ downloaded", nil), [NSNumber humanReadableSizeFromDouble:[statusController progressValue]]]];
|
||||
}
|
||||
|
||||
- (IBAction)cancelDownload:sender
|
||||
{
|
||||
if (download)
|
||||
{
|
||||
[download cancel];
|
||||
[download release];
|
||||
}
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
- (void)extractUpdate
|
||||
{
|
||||
// Now we have to extract the downloaded archive.
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Extracting update...", nil) maxProgressValue:0 statusText:nil];
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Extracting update\u2026", nil) maxProgressValue:0 statusText:nil];
|
||||
[statusController setButtonEnabled:NO];
|
||||
[super extractUpdate];
|
||||
}
|
||||
@@ -114,7 +117,7 @@
|
||||
|
||||
- (void)installUpdate
|
||||
{
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Installing update...", nil) maxProgressValue:0 statusText:nil];
|
||||
[statusController beginActionWithTitle:SULocalizedString(@"Installing update\u2026", nil) maxProgressValue:0 statusText:nil];
|
||||
[statusController setButtonEnabled:NO];
|
||||
[super installUpdate];
|
||||
}
|
||||
|
||||
+4
-3
@@ -11,12 +11,13 @@
|
||||
|
||||
@interface SUUnarchiver : NSObject {
|
||||
id delegate;
|
||||
NSString *archivePath;
|
||||
NSURL *archiveURL;
|
||||
}
|
||||
|
||||
- (void)unarchivePath:(NSString *)path;
|
||||
+ (SUUnarchiver *)unarchiverForURL:(NSURL *)URL;
|
||||
- (void)setDelegate:delegate;
|
||||
- (void)cleanUp;
|
||||
|
||||
- (void)start;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
+12
-165
@@ -9,147 +9,22 @@
|
||||
|
||||
#import "Sparkle.h"
|
||||
#import "SUUnarchiver.h"
|
||||
#import "SUUnarchiver_Private.h"
|
||||
|
||||
@implementation SUUnarchiver
|
||||
|
||||
// This method abstracts the types that use a command line tool piping data from stdin.
|
||||
- (BOOL)_extractArchivePipingDataToCommand:(NSString *)command
|
||||
extern NSMutableArray *__unarchiverImplementations;
|
||||
|
||||
+ (SUUnarchiver *)unarchiverForURL:(NSURL *)URL
|
||||
{
|
||||
// Get the file size.
|
||||
NSNumber *fs = [[[NSFileManager defaultManager] fileAttributesAtPath:archivePath traverseLink:NO] objectForKey:NSFileSize];
|
||||
if (fs == nil) { return NO; }
|
||||
|
||||
// Thank you, Allan Odgaard!
|
||||
// (who wrote the following extraction alg.)
|
||||
|
||||
long current = 0;
|
||||
FILE *fp, *cmdFP;
|
||||
if ((fp = fopen([archivePath fileSystemRepresentation], "r")))
|
||||
NSEnumerator *implementationEnumerator = [[self _unarchiverImplementations] objectEnumerator];
|
||||
id current;
|
||||
while ((current = [implementationEnumerator nextObject]))
|
||||
{
|
||||
setenv("DESTINATION", [[archivePath stringByDeletingLastPathComponent] UTF8String], 1);
|
||||
if ((cmdFP = popen([command fileSystemRepresentation], "w")))
|
||||
{
|
||||
char buf[32*1024];
|
||||
long len;
|
||||
while((len = fread(buf, 1, 32 * 1024, fp)))
|
||||
{
|
||||
current += len;
|
||||
|
||||
NSEvent *event;
|
||||
while((event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES]))
|
||||
[NSApp sendEvent:event];
|
||||
|
||||
fwrite(buf, 1, len, cmdFP);
|
||||
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfExtractedLength:) withObject:[NSNumber numberWithLong:len] waitUntilDone:NO];
|
||||
}
|
||||
pclose(cmdFP);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)_extractTAR
|
||||
{
|
||||
return [self _extractArchivePipingDataToCommand:@"tar -xC \"$DESTINATION\""];
|
||||
}
|
||||
|
||||
- (BOOL)_extractTGZ
|
||||
{
|
||||
return [self _extractArchivePipingDataToCommand:@"tar -zxC \"$DESTINATION\""];
|
||||
}
|
||||
|
||||
- (BOOL)_extractTBZ
|
||||
{
|
||||
return [self _extractArchivePipingDataToCommand:@"tar -jxC \"$DESTINATION\""];
|
||||
}
|
||||
|
||||
- (BOOL)_extractZIP
|
||||
{
|
||||
return [self _extractArchivePipingDataToCommand:@"ditto -x -k - \"$DESTINATION\""];
|
||||
}
|
||||
|
||||
- (BOOL)_extractDMG
|
||||
{
|
||||
// get a unique mount point path
|
||||
NSString *mountPoint = [[archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"mp"];
|
||||
int cnt=1;
|
||||
while ([[NSFileManager defaultManager] fileExistsAtPath:mountPoint] && cnt <= 999)
|
||||
mountPoint = [[archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"mp%d", cnt++]];
|
||||
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:mountPoint])
|
||||
{
|
||||
// create mount point folder
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:mountPoint attributes:nil];
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:mountPoint])
|
||||
{
|
||||
NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, @"-noverify", @"-nobrowse", @"-noautoopen", nil];
|
||||
// set up a pipe and push "yes" (y works too), this will accept any license agreement crap
|
||||
// not every .dmg needs this, but this will make sure it works with everyone
|
||||
NSData* yesData = [[[NSData alloc] initWithBytes:"yes\n" length:4] autorelease];
|
||||
|
||||
[NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:arguments input:yesData];
|
||||
}
|
||||
if ([current _canUnarchiveURL:URL])
|
||||
return [[[current alloc] _initWithURL:URL] autorelease];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)_unarchive
|
||||
{
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
// This dictionary associates names of methods responsible for extraction with file extensions.
|
||||
// The methods take the path of the archive to extract. They return a BOOL indicating whether
|
||||
// we should continue with the update; returns NO if an error occurred.
|
||||
NSDictionary *commandDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"_extractTBZ", @".tbz",
|
||||
@"_extractTBZ", @".tar.bz2",
|
||||
@"_extractTGZ", @".tgz",
|
||||
@"_extractTGZ", @".tar.gz",
|
||||
@"_extractTAR", @".tar",
|
||||
@"_extractZIP", @".zip",
|
||||
@"_extractDMG", @".dmg",
|
||||
nil];
|
||||
SEL command = NULL;
|
||||
NSString *theLastPathComponent = [[archivePath lastPathComponent] lowercaseString];
|
||||
NSEnumerator *theEnumerator = [[commandDictionary allKeys] objectEnumerator];
|
||||
NSString *theExtension = NULL;
|
||||
while ((theExtension = [theEnumerator nextObject]) != NULL)
|
||||
{
|
||||
if ([[theLastPathComponent substringFromIndex:[theLastPathComponent length] - [theExtension length]] isEqualToString:theExtension])
|
||||
{
|
||||
command = NSSelectorFromString([commandDictionary objectForKey:theExtension]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL result;
|
||||
if (command)
|
||||
{
|
||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:command]];
|
||||
[invocation setSelector:command];
|
||||
[invocation invokeWithTarget:self];
|
||||
[invocation getReturnValue:&result];
|
||||
}
|
||||
else
|
||||
result = NO;
|
||||
|
||||
if (result)
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfSuccess) withObject:nil waitUntilDone:NO];
|
||||
else
|
||||
[self performSelectorOnMainThread:@selector(notifyDelegateOfFailure) withObject:nil waitUntilDone:NO];
|
||||
|
||||
[pool release];
|
||||
}
|
||||
|
||||
- (void)unarchivePath:(NSString *)path
|
||||
{
|
||||
archivePath = [path copy];
|
||||
[NSThread detachNewThreadSelector:@selector(_unarchive) toTarget:self withObject:nil];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)setDelegate:del
|
||||
@@ -157,37 +32,9 @@
|
||||
delegate = del;
|
||||
}
|
||||
|
||||
- (void)cleanUp
|
||||
- (void)start
|
||||
{
|
||||
if ([[archivePath pathExtension] isEqualToString:@".dmg"])
|
||||
{
|
||||
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray arrayWithObjects:@"detach", [archivePath stringByDeletingLastPathComponent], @"-force", nil]];
|
||||
}
|
||||
[[NSFileManager defaultManager] removeFileAtPath:archivePath handler:nil];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[archivePath release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)notifyDelegateOfExtractedLength:(long)length
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(unarchiver:extractedLength:)])
|
||||
[delegate unarchiver:self extractedLength:length];
|
||||
}
|
||||
|
||||
- (void)notifyDelegateOfSuccess
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(unarchiverDidFinish:)])
|
||||
[delegate performSelector:@selector(unarchiverDidFinish:) withObject:self];
|
||||
}
|
||||
|
||||
- (void)notifyDelegateOfFailure
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(unarchiverDidFail:)])
|
||||
[delegate performSelector:@selector(unarchiverDidFail:) withObject:self];
|
||||
// No-op
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// SUUnarchiver_Private.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 6/17/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUUNARCHIVER_PRIVATE_H
|
||||
#define SUUNARCHIVER_PRIVATE_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUUnarchiver.h"
|
||||
|
||||
@interface SUUnarchiver (Private)
|
||||
+ (void)_registerImplementation:(Class)implementation;
|
||||
+ (NSArray *)_unarchiverImplementations;
|
||||
+ (BOOL)_canUnarchiveURL:(NSURL *)URL;
|
||||
- _initWithURL:(NSURL *)URL;
|
||||
|
||||
- (void)_notifyDelegateOfExtractedLength:(long)length;
|
||||
- (void)_notifyDelegateOfSuccess;
|
||||
- (void)_notifyDelegateOfFailure;
|
||||
@end
|
||||
|
||||
@interface NSURL (SUTypeDetection)
|
||||
- (BOOL)conformsToType:(NSString *)type;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// SUUnarchiver_Private.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 6/17/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUUnarchiver_Private.h"
|
||||
|
||||
@implementation SUUnarchiver (Private)
|
||||
|
||||
- _initWithURL:(NSURL *)URL
|
||||
{
|
||||
if ((self = [super init]))
|
||||
archiveURL = [URL copy];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[archiveURL release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
+ (BOOL)_canUnarchiveURL:(NSURL *)URL
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)_notifyDelegateOfExtractedLength:(long)length
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(unarchiver:extractedLength:)])
|
||||
[delegate unarchiver:self extractedLength:length];
|
||||
}
|
||||
|
||||
- (void)_notifyDelegateOfSuccess
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(unarchiverDidFinish:)])
|
||||
[delegate performSelector:@selector(unarchiverDidFinish:) withObject:self];
|
||||
}
|
||||
|
||||
- (void)_notifyDelegateOfFailure
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(unarchiverDidFail:)])
|
||||
[delegate performSelector:@selector(unarchiverDidFail:) withObject:self];
|
||||
}
|
||||
|
||||
static NSMutableArray *__unarchiverImplementations;
|
||||
|
||||
+ (void)_registerImplementation:(Class)implementation
|
||||
{
|
||||
if (!__unarchiverImplementations)
|
||||
__unarchiverImplementations = [[NSMutableArray alloc] init];
|
||||
[__unarchiverImplementations addObject:implementation];
|
||||
}
|
||||
|
||||
+ (NSArray *)_unarchiverImplementations
|
||||
{
|
||||
return [NSArray arrayWithArray:__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
|
||||
+1
-1
@@ -150,7 +150,7 @@
|
||||
|
||||
- (NSString *)descriptionText
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available%Cyou have %@. Would you like to download it now?", nil), [hostBundle name], [updateItem displayVersionString], 0x2014, [hostBundle displayVersion]];
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available\u2014you have %@. Would you like to download it now?", nil), [hostBundle name], [updateItem displayVersionString], [hostBundle displayVersion]];
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)sender didFinishLoadForFrame:frame
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
extern NSString *SUUpdateDriverFinishedNotification;
|
||||
|
||||
@interface SUUpdateDriver : NSObject
|
||||
{
|
||||
BOOL finished;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#import "SUUpdateDriver.h"
|
||||
|
||||
NSString *SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
|
||||
|
||||
@implementation SUUpdateDriver
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb
|
||||
@@ -18,6 +19,7 @@
|
||||
- (void)abortUpdate
|
||||
{
|
||||
[self setValue:[NSNumber numberWithBool:YES] forKey:@"finished"];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdateDriverFinishedNotification object:self];
|
||||
}
|
||||
|
||||
- (BOOL)finished { return finished; }
|
||||
|
||||
+35
-12
@@ -9,59 +9,82 @@
|
||||
#ifndef SUUPDATER_H
|
||||
#define SUUPDATER_H
|
||||
|
||||
@class SUUpdateDriver;
|
||||
#import "SUUpdateAlert.h"
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
|
||||
@class SUUpdateDriver, SUAppcastItem, SUAppcast;
|
||||
@interface SUUpdater : NSObject {
|
||||
NSTimer *checkTimer;
|
||||
SUUpdateDriver *driver;
|
||||
|
||||
NSBundle *hostBundle;
|
||||
id delegate;
|
||||
IBOutlet id delegate;
|
||||
}
|
||||
|
||||
- (void)setHostBundle:(NSBundle *)hostBundle;
|
||||
+ (SUUpdater *)sharedUpdater;
|
||||
|
||||
- (void)setDelegate:(id)delegate;
|
||||
|
||||
// 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 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;
|
||||
|
||||
// This forces an update to begin with a particular driver (see SU*UpdateDriver.h)
|
||||
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)driver;
|
||||
|
||||
- (BOOL)updateInProgress;
|
||||
// For non-.app updates:
|
||||
// Call this when your bundle is loaded to tell Sparkle what to update.
|
||||
- (void)setHostBundle:(NSBundle *)hostBundle;
|
||||
|
||||
// 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;
|
||||
|
||||
- (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 *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
|
||||
- (NSArray *)feedParametersForHostBundle:(NSBundle *)bundle sendingSystemProfile:(BOOL)sendingProfile;
|
||||
|
||||
// Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
|
||||
- (BOOL)shouldPromptForPermissionToCheckForUpdates;
|
||||
- (BOOL)shouldPromptForPermissionToCheckForUpdatesToHostBundle:(NSBundle *)bundle;
|
||||
|
||||
// Implement this if you want to do some special handling with the appcast once it finishes loading.
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)appcast;
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)appcast forHostBundle:(NSBundle *)bundle;
|
||||
|
||||
// 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;
|
||||
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forHostBundle:(NSBundle *)bundle;
|
||||
|
||||
// Sent when a valid update is found by the update driver.
|
||||
- (void)didFindValidUpdate:(SUAppcastItem *)update;
|
||||
- (void)didFindValidUpdate:(SUAppcastItem *)update toHostBundle:(NSBundle *)bundle;
|
||||
|
||||
// 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;
|
||||
- (void)userChoseAction:(SUUpdateAlertChoice)action forUpdate:(SUAppcastItem *)update toHostBundle:(NSBundle *)bundle;
|
||||
|
||||
// Sent immediately before installing the specified update.
|
||||
- (void)updateWillInstall:(SUAppcastItem *)update;
|
||||
- (void)updateWillInstall:(SUAppcastItem *)update toHostBundle:(NSBundle *)bundle;
|
||||
|
||||
// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
|
||||
- (BOOL)shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
|
||||
- (BOOL)shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update toHostBundle:(NSBundle *)hostBundle untilInvoking:(NSInvocation *)invocation;
|
||||
|
||||
// Called immediately before relaunching.
|
||||
- (void)updaterWillRelaunchApplication;
|
||||
|
||||
// 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>)versionComparatorForHostBundle:(NSBundle *)hb;
|
||||
|
||||
@end
|
||||
|
||||
// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds.
|
||||
|
||||
+75
-35
@@ -10,11 +10,12 @@
|
||||
#import "SUUpdater.h"
|
||||
|
||||
@interface SUUpdater (Private)
|
||||
- (void)beginUpdateCycle;
|
||||
- (NSArray *)feedParameters;
|
||||
- (BOOL)automaticallyUpdates;
|
||||
- (BOOL)shouldScheduleUpdateCheck;
|
||||
- (void)scheduleNextUpdateCheck;
|
||||
- (NSTimeInterval)checkInterval;
|
||||
- (NSURL *)feedURL;
|
||||
@end
|
||||
|
||||
@implementation SUUpdater
|
||||
@@ -45,6 +46,9 @@ static SUUpdater *sharedUpdater = nil;
|
||||
sharedUpdater = self;
|
||||
[self setHostBundle:[NSBundle mainBundle]];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidFinishLaunching:) name:NSApplicationDidFinishLaunchingNotification object:NSApp];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(driverDidFinish:) name:SUUpdateDriverFinishedNotification object:nil];
|
||||
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:[@"values." stringByAppendingString:SUScheduledCheckIntervalKey] options:0 context:NULL];
|
||||
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeyPath:[@"values." stringByAppendingString:SUEnableAutomaticChecksKey] options:0 context:NULL];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -56,9 +60,9 @@ static SUUpdater *sharedUpdater = nil;
|
||||
[[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(shouldPromptForPermissionToCheckForUpdates)])
|
||||
if ([delegate respondsToSelector:@selector(shouldPromptForPermissionToCheckForUpdatesToHostBundle:)])
|
||||
{
|
||||
if ([delegate shouldPromptForPermissionToCheckForUpdates])
|
||||
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.
|
||||
@@ -76,20 +80,24 @@ static SUUpdater *sharedUpdater = nil;
|
||||
}
|
||||
|
||||
// We check if the user's said they want updates, or they haven't said anything, and the default is set to checking.
|
||||
if ([self shouldScheduleUpdateCheck])
|
||||
[self beginUpdateCycle];
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
|
||||
- (void)updatePermissionPromptFinishedWithResult:(SUPermissionPromptResult)result
|
||||
{
|
||||
BOOL automaticallyCheck = (result == SUAutomaticallyCheck);
|
||||
[[SUUserDefaults standardUserDefaults] setBool:automaticallyCheck forKey:SUEnableAutomaticChecksKey];
|
||||
if ([self automaticallyUpdates])
|
||||
[self beginUpdateCycle];
|
||||
[[SUUserDefaults standardUserDefaults] setBool:(result == SUAutomaticallyCheck) forKey:SUEnableAutomaticChecksKey];
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
|
||||
- (void)beginUpdateCycle
|
||||
- (void)scheduleNextUpdateCheck
|
||||
{
|
||||
if (checkTimer)
|
||||
{
|
||||
[checkTimer invalidate];
|
||||
checkTimer = nil;
|
||||
}
|
||||
if (![self shouldScheduleUpdateCheck]) return;
|
||||
|
||||
// How long has it been since last we checked for an update?
|
||||
NSDate *lastCheckDate = [[SUUserDefaults standardUserDefaults] objectForKey:SULastCheckTimeKey];
|
||||
if (!lastCheckDate) { lastCheckDate = [NSDate distantPast]; }
|
||||
@@ -101,7 +109,6 @@ static SUUpdater *sharedUpdater = nil;
|
||||
delayUntilCheck = ([self checkInterval] - 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];
|
||||
}
|
||||
|
||||
@@ -120,28 +127,26 @@ static SUUpdater *sharedUpdater = nil;
|
||||
if ([self updateInProgress]) { return; }
|
||||
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]];
|
||||
|
||||
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 feedURL] hostBundle:hostBundle];
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
{
|
||||
if (object != driver) { return; }
|
||||
[driver removeObserver:self forKeyPath:@"finished"];
|
||||
[driver release]; driver = nil;
|
||||
if ([self shouldScheduleUpdateCheck])
|
||||
checkTimer = [NSTimer scheduledTimerWithTimeInterval:[self checkInterval] target:self selector:@selector(checkForUpdatesInBackground) userInfo:nil repeats:NO];
|
||||
if (object == [NSUserDefaultsController sharedUserDefaultsController] && ([keyPath hasSuffix:SUScheduledCheckIntervalKey] || [keyPath hasSuffix:SUEnableAutomaticChecksKey]))
|
||||
{
|
||||
[self updatePreferencesChanged];
|
||||
}
|
||||
else
|
||||
{
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updatePreferencesChanged
|
||||
{
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
|
||||
- (BOOL)shouldScheduleUpdateCheck
|
||||
@@ -154,7 +159,7 @@ static SUUpdater *sharedUpdater = nil;
|
||||
if ([[SUUserDefaults standardUserDefaults] objectForKey:SUEnableAutomaticChecksKey] == nil &&
|
||||
[[hostBundle objectForInfoDictionaryKey:SUEnableAutomaticChecksKey] boolValue] == YES)
|
||||
return YES;
|
||||
return NO; // Otherwise, don't bothe.r
|
||||
return NO; // Otherwise, don't bother.
|
||||
}
|
||||
|
||||
- (BOOL)automaticallyUpdates
|
||||
@@ -175,15 +180,42 @@ static SUUpdater *sharedUpdater = nil;
|
||||
return YES; // Otherwise, we're good to go.
|
||||
}
|
||||
|
||||
- (NSArray *)feedParameters
|
||||
- (NSURL *)_baseFeedURL
|
||||
{
|
||||
// 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) // 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]] ;
|
||||
}
|
||||
|
||||
- (NSURL *)feedURL
|
||||
{
|
||||
NSURL *baseFeedURL = [self _baseFeedURL];
|
||||
|
||||
// Determine all the parameters we're attaching to the base feed URL.
|
||||
BOOL sendingSystemProfile = ([[SUUserDefaults standardUserDefaults] boolForKey:SUSendProfileInfoKey] == YES);
|
||||
NSArray *parameters = [NSArray array];
|
||||
if ([delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)])
|
||||
parameters = [parameters arrayByAddingObjectsFromArray:[delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile]];
|
||||
if ([delegate respondsToSelector:@selector(feedParametersForHostBundle:sendingSystemProfile:)])
|
||||
parameters = [parameters arrayByAddingObjectsFromArray:[delegate feedParametersForHostBundle:hostBundle sendingSystemProfile:sendingSystemProfile]];
|
||||
if (sendingSystemProfile)
|
||||
parameters = [parameters arrayByAddingObjectsFromArray:[hostBundle systemProfile]];
|
||||
return parameters;
|
||||
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 *appcastStringWithProfile = [NSString stringWithFormat:@"%@?%@", [baseFeedURL absoluteString], [parameterStrings componentsJoinedByString:@"&"]];
|
||||
|
||||
// Clean it up so it's a valid URL
|
||||
return [NSURL URLWithString:[appcastStringWithProfile stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
|
||||
}
|
||||
|
||||
- (NSTimeInterval)checkInterval
|
||||
@@ -203,8 +235,8 @@ static SUUpdater *sharedUpdater = nil;
|
||||
- (void)dealloc
|
||||
{
|
||||
[hostBundle release];
|
||||
[delegate release];
|
||||
if (checkTimer) { [checkTimer invalidate]; }
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -217,12 +249,12 @@ static SUUpdater *sharedUpdater = nil;
|
||||
|
||||
- (void)setDelegate:aDelegate
|
||||
{
|
||||
[delegate release];
|
||||
delegate = [aDelegate retain];
|
||||
delegate = aDelegate;
|
||||
}
|
||||
|
||||
- (void)setHostBundle:(NSBundle *)hb
|
||||
{
|
||||
if (hostBundle == hb) return;
|
||||
[hostBundle release];
|
||||
hostBundle = [hb retain];
|
||||
[[SUUserDefaults standardUserDefaults] setIdentifier:[hostBundle bundleIdentifier]];
|
||||
@@ -233,4 +265,12 @@ static SUUpdater *sharedUpdater = nil;
|
||||
return driver && ([driver finished] == NO);
|
||||
}
|
||||
|
||||
- (void)driverDidFinish:(NSNotification *)notification
|
||||
{
|
||||
if ([notification object] != driver) return;
|
||||
[driver release];
|
||||
driver = nil;
|
||||
[self scheduleNextUpdateCheck];
|
||||
}
|
||||
|
||||
@end
|
||||
+15
-6
@@ -27,8 +27,11 @@
|
||||
|
||||
- (void)setIdentifier:(NSString *)anIdentifier
|
||||
{
|
||||
[identifier autorelease];
|
||||
identifier = [anIdentifier copy];
|
||||
if (identifier != anIdentifier)
|
||||
{
|
||||
[identifier release];
|
||||
identifier = [anIdentifier copy];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)verifyIdentifier
|
||||
@@ -41,11 +44,17 @@
|
||||
{
|
||||
[self verifyIdentifier];
|
||||
CFPropertyListRef obj = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)identifier);
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > 1050
|
||||
return [NSMakeCollectable(obj) autorelease];
|
||||
#else
|
||||
return [(id)obj autorelease];
|
||||
// Under Tiger, CFPreferencesCopyAppValue doesn't get values from NSRegistrationDomain, so anything
|
||||
// passed into -[NSUserDefaults registerDefaults:] is ignored. The following line falls
|
||||
// back to using NSUserDefaults, but only if the host bundle is the main bundle, and no value
|
||||
// is found elsewhere.
|
||||
if (obj == NULL && [identifier isEqualToString:[[NSBundle mainBundle] bundleIdentifier]])
|
||||
obj = [[NSUserDefaults standardUserDefaults] objectForKey:defaultName];
|
||||
id result = nil;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||
result = [NSMakeCollectable(obj) autorelease];
|
||||
#endif
|
||||
return result ?: (id)obj;
|
||||
}
|
||||
|
||||
- (void)setObject:(id)value forKey:(NSString *)defaultName;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
@interface SUUserInitiatedUpdateDriver : SUUIBasedUpdateDriver {
|
||||
SUStatusController *checkingController;
|
||||
BOOL isCanceled;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -16,29 +16,53 @@
|
||||
[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...", nil) maxProgressValue:0 statusText:nil];
|
||||
[checkingController setButtonHidden:YES];
|
||||
[checkingController beginActionWithTitle:SULocalizedString(@"Checking for updates\u2026", nil) maxProgressValue:0 statusText:nil];
|
||||
[checkingController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelCheckForUpdates:) isDefault:NO];
|
||||
[checkingController showWindow:self];
|
||||
}
|
||||
|
||||
- (void)closeCheckingWindow
|
||||
{
|
||||
if (checkingController)
|
||||
{
|
||||
[[checkingController window] close];
|
||||
[checkingController release];
|
||||
checkingController = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)cancelCheckForUpdates:sender
|
||||
{
|
||||
[self closeCheckingWindow];
|
||||
isCanceled = YES;
|
||||
}
|
||||
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac
|
||||
{
|
||||
if (isCanceled)
|
||||
{
|
||||
[self abortUpdate];
|
||||
return;
|
||||
}
|
||||
[self closeCheckingWindow];
|
||||
[super appcastDidFinishLoading:ac];
|
||||
}
|
||||
|
||||
- (void)appcast:(SUAppcast *)ac failedToLoadWithError:(NSError *)error
|
||||
{
|
||||
if (isCanceled)
|
||||
{
|
||||
[self abortUpdate];
|
||||
return;
|
||||
}
|
||||
[self closeCheckingWindow];
|
||||
[super appcast:ac failedToLoadWithError:error];
|
||||
}
|
||||
|
||||
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui
|
||||
{
|
||||
// We don't check to see if this update's been skipped, because the user explicitly *asked* if he had the latest version.
|
||||
return [self hostSupportsItem:ui] && [self isItemNewer:ui];
|
||||
}
|
||||
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
[[checkingController window] close];
|
||||
[checkingController release];
|
||||
[super didNotFindUpdate];
|
||||
}
|
||||
|
||||
- (void)didFindValidUpdate
|
||||
{
|
||||
[[checkingController window] close];
|
||||
[checkingController release];
|
||||
[super didFindValidUpdate];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -14,6 +14,7 @@
|
||||
#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>
|
||||
@@ -28,15 +29,11 @@
|
||||
#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 "NTSynchronousTask.h"
|
||||
|
||||
#import "RSS.h"
|
||||
|
||||
#import "SUAppcast.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SUAutomaticUpdateAlert.h"
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
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, ); }; };
|
||||
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, ); }; };
|
||||
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, ); }; };
|
||||
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 */; };
|
||||
@@ -64,10 +69,6 @@
|
||||
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 */; };
|
||||
@@ -85,8 +86,6 @@
|
||||
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, ); }; };
|
||||
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, ); }; };
|
||||
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, ); }; };
|
||||
@@ -95,9 +94,10 @@
|
||||
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 */; };
|
||||
61C46F340D9C54F300B06326 /* SUUpdatePermissionPrompt.nib in Resources */ = {isa = PBXBuildFile; fileRef = 61C46F330D9C54F300B06326 /* SUUpdatePermissionPrompt.nib */; };
|
||||
61D85D6D0E10B2ED00F9B4A9 /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
DAAEFC9B0DA5722F0051E0D0 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
|
||||
DAAEFD4E0DA572330051E0D0 /* relaunch.m in Sources */ = {isa = PBXBuildFile; fileRef = 613242130CD06CEF00106AA4 /* relaunch.m */; };
|
||||
@@ -161,6 +161,11 @@
|
||||
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>"; };
|
||||
6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUDiskImageUnarchiver.h; sourceTree = "<group>"; };
|
||||
6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUDiskImageUnarchiver.m; sourceTree = "<group>"; };
|
||||
6102FE590E08C7EC00F85D09 /* SUUnarchiver_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiver_Private.h; sourceTree = "<group>"; };
|
||||
6102FE5A0E08C7EC00F85D09 /* SUUnarchiver_Private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUnarchiver_Private.m; sourceTree = "<group>"; };
|
||||
61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigFrameworkReleaseGCSupport.xcconfig; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
@@ -184,6 +189,7 @@
|
||||
61299A8B09CA790200B7442F /* SUUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiver.h; sourceTree = "<group>"; };
|
||||
61299A8C09CA790200B7442F /* SUUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUnarchiver.m; sourceTree = "<group>"; };
|
||||
61299B3509CB04E000B7442F /* Sparkle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sparkle.h; sourceTree = "<group>"; };
|
||||
6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPipedUnarchiver.m; sourceTree = "<group>"; };
|
||||
612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermissionPrompt.h; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
@@ -198,6 +204,10 @@
|
||||
618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPackageInstaller.m; 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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
61A2259C0D1C495D00430CCD /* SUVersionComparisonProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUVersionComparisonProtocol.h; sourceTree = "<group>"; };
|
||||
@@ -212,35 +222,9 @@
|
||||
61AAE8230A321A7F00D8810D /* en */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8250A321A7F00D8810D /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = en; path = en.lproj/SUAutomaticUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
61AAE8270A321A7F00D8810D /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = en; path = en.lproj/SUUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
61AAE82D0A321AA200D8810D /* ca */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE83F0A321AD200D8810D /* cs */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8420A321ADC00D8810D /* cy */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = cy; path = cy.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8450A321AE500D8810D /* da */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8480A321AED00D8810D /* de */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE84F0A321AF700D8810D /* es */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8560A321AFC00D8810D /* fi */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8590A321B0400D8810D /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE85C0A321B0C00D8810D /* he */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE85F0A321EF100D8810D /* hu */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8620A321EFA00D8810D /* id */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8650A321F0100D8810D /* is */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8680A321F0B00D8810D /* it */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE86B0A321F2D00D8810D /* ja */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE86E0A321F3500D8810D /* ko */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8710A321F7700D8810D /* nl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8740A321FA500D8810D /* no */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = no; path = no.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8770A321FBE00D8810D /* pl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE87A0A321FC400D8810D /* ru */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE87D0A321FCD00D8810D /* sk */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8800A32201100D8810D /* sv */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8830A32202400D8810D /* th */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = th; path = th.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8860A32203000D8810D /* tr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE8890A32203800D8810D /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
61AAE88C0A32203F00D8810D /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.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>"; };
|
||||
@@ -259,8 +243,6 @@
|
||||
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>"; };
|
||||
@@ -269,6 +251,15 @@
|
||||
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>"; };
|
||||
61C46F350D9C54F300B06326 /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = en; path = en.lproj/SUUpdatePermissionPrompt.nib; 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>"; };
|
||||
61F3652E0E18988F007ECA02 /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/SUUpdatePermissionPrompt.nib; sourceTree = "<group>"; };
|
||||
61F3652F0E18988F007ECA02 /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/SUUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
61F365300E18988F007ECA02 /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fr; path = fr.lproj/SUAutomaticUpdateAlert.nib; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
@@ -394,6 +385,12 @@
|
||||
children = (
|
||||
61299A8B09CA790200B7442F /* SUUnarchiver.h */,
|
||||
61299A8C09CA790200B7442F /* SUUnarchiver.m */,
|
||||
6102FE590E08C7EC00F85D09 /* SUUnarchiver_Private.h */,
|
||||
6102FE5A0E08C7EC00F85D09 /* SUUnarchiver_Private.m */,
|
||||
6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */,
|
||||
6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */,
|
||||
6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */,
|
||||
6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */,
|
||||
610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */,
|
||||
610EC1BF0CF3914D00AE239E /* NTSynchronousTask.m */,
|
||||
);
|
||||
@@ -438,12 +435,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>";
|
||||
@@ -562,8 +553,6 @@
|
||||
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 */,
|
||||
@@ -591,7 +580,6 @@
|
||||
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 */,
|
||||
@@ -600,6 +588,9 @@
|
||||
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 */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -798,7 +789,7 @@
|
||||
);
|
||||
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:/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\"\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";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
@@ -824,8 +815,6 @@
|
||||
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 */,
|
||||
61B5FBB709C4FAFF00B25A18 /* SUAppcast.m in Sources */,
|
||||
@@ -851,7 +840,6 @@
|
||||
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 */,
|
||||
@@ -859,6 +847,9 @@
|
||||
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 */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -900,31 +891,10 @@
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
61AAE8230A321A7F00D8810D /* en */,
|
||||
61AAE82D0A321AA200D8810D /* ca */,
|
||||
61AAE83F0A321AD200D8810D /* cs */,
|
||||
61AAE8420A321ADC00D8810D /* cy */,
|
||||
61AAE8450A321AE500D8810D /* da */,
|
||||
61AAE8480A321AED00D8810D /* de */,
|
||||
61AAE84F0A321AF700D8810D /* es */,
|
||||
61AAE8560A321AFC00D8810D /* fi */,
|
||||
61AAE8590A321B0400D8810D /* fr */,
|
||||
61AAE85C0A321B0C00D8810D /* he */,
|
||||
61AAE85F0A321EF100D8810D /* hu */,
|
||||
61AAE8620A321EFA00D8810D /* id */,
|
||||
61AAE8650A321F0100D8810D /* is */,
|
||||
61AAE8680A321F0B00D8810D /* it */,
|
||||
61AAE86B0A321F2D00D8810D /* ja */,
|
||||
61AAE86E0A321F3500D8810D /* ko */,
|
||||
61AAE8710A321F7700D8810D /* nl */,
|
||||
61AAE8740A321FA500D8810D /* no */,
|
||||
61AAE8770A321FBE00D8810D /* pl */,
|
||||
61AAE87A0A321FC400D8810D /* ru */,
|
||||
61AAE87D0A321FCD00D8810D /* sk */,
|
||||
61AAE8800A32201100D8810D /* sv */,
|
||||
61AAE8830A32202400D8810D /* th */,
|
||||
61AAE8860A32203000D8810D /* tr */,
|
||||
61AAE8890A32203800D8810D /* zh_CN */,
|
||||
61AAE88C0A32203F00D8810D /* zh_TW */,
|
||||
619B17200E1E9D0800E72754 /* de */,
|
||||
);
|
||||
name = Sparkle.strings;
|
||||
sourceTree = "<group>";
|
||||
@@ -933,6 +903,10 @@
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
61AAE8250A321A7F00D8810D /* en */,
|
||||
61F3652B0E189883007ECA02 /* es */,
|
||||
61F365300E18988F007ECA02 /* fr */,
|
||||
61F365350E1898A3007ECA02 /* nl */,
|
||||
619B17210E1E9D0800E72754 /* de */,
|
||||
);
|
||||
name = SUAutomaticUpdateAlert.nib;
|
||||
sourceTree = "<group>";
|
||||
@@ -941,6 +915,10 @@
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
61AAE8270A321A7F00D8810D /* en */,
|
||||
61F3652A0E189883007ECA02 /* es */,
|
||||
61F3652F0E18988F007ECA02 /* fr */,
|
||||
61F365340E1898A3007ECA02 /* nl */,
|
||||
619B17220E1E9D0800E72754 /* de */,
|
||||
);
|
||||
name = SUUpdateAlert.nib;
|
||||
sourceTree = "<group>";
|
||||
@@ -965,6 +943,10 @@
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
61C46F350D9C54F300B06326 /* en */,
|
||||
61F3651A0E18987B007ECA02 /* es */,
|
||||
61F3652E0E18988F007ECA02 /* fr */,
|
||||
61F365330E1898A3007ECA02 /* nl */,
|
||||
619B17230E1E9D0800E72754 /* de */,
|
||||
);
|
||||
name = SUUpdatePermissionPrompt.nib;
|
||||
sourceTree = "<group>";
|
||||
@@ -1001,13 +983,15 @@
|
||||
61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5-only) */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_VERSION = "";
|
||||
};
|
||||
name = "Release (GC dual-mode; 10.5-only)";
|
||||
};
|
||||
61072EAE0DF263BD008FE88B /* Release (GC dual-mode; 10.5-only) */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = FA1941D50D94A70100DD942E /* ConfigFrameworkRelease.xcconfig */;
|
||||
baseConfigurationReference = 61072EB20DF2640C008FE88B /* ConfigFrameworkReleaseGCSupport.xcconfig */;
|
||||
buildSettings = {
|
||||
INSTALL_PATH = "@loader_path/../Frameworks";
|
||||
};
|
||||
name = "Release (GC dual-mode; 10.5-only)";
|
||||
};
|
||||
|
||||
+5
-2
@@ -3,15 +3,18 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>629</string>
|
||||
<string>667</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../../Sparkle.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>2</integer>
|
||||
<integer>57</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9B18</string>
|
||||
<string>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
SUAssertAscending(@"1.0b1", @"1.0");
|
||||
SUAssertAscending(@"0.9", @"1.0a1");
|
||||
SUAssertAscending(@"1.0b", @"1.0b2");
|
||||
SUAssertAscending(@"1.0b10", @"1.0b11");
|
||||
SUAssertAscending(@"1.0b9", @"1.0b10");
|
||||
SUAssertAscending(@"1.0rc", @"1.0");
|
||||
SUAssertAscending(@"1.0b", @"1.0");
|
||||
SUAssertAscending(@"1.0pre1", @"1.0");
|
||||
|
||||
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>649</string>
|
||||
<string>667</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../Sparkle.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>6</integer>
|
||||
<integer>89</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9C7010</string>
|
||||
<string>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
|
||||
BIN
Binary file not shown.
+4
-4
@@ -3,18 +3,18 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>644</string>
|
||||
<string>667</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../../Sparkle.xcodeproj</string>
|
||||
<string>../Sparkle.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>6</integer>
|
||||
<integer>42</integer>
|
||||
<integer>39</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9C7010</string>
|
||||
<string>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
|
||||
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.
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.
+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.
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>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?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>629</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array/>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
</plist>
|
||||
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
+18
@@ -0,0 +1,18 @@
|
||||
<?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>629</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.
+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>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?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>629</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array/>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Loaded 100 of 131 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user