Permalink
Browse files

Manually merge project file (recreating the finish_installation appli…

…cation target) and make things build and run again.
  • Loading branch information...
uliwitness committed May 2, 2011
1 parent 9937e5a commit a8854375f5c072b5f35814f5e6dfc5a6261c2e5b
@@ -2,6 +2,16 @@
// because it includes files also used in EyeTV, but doesn't need to be thread safe
// as it's a single-threaded process anyway.
+#ifndef EYETV
+#define EYETV 0
+#endif
+#ifndef __TOAST__
+#define __TOAST__ 0
+#endif
+#ifndef TURBO
+#define TURBO 0
+#endif
+
#if !EYETV && !__TOAST__ && !TURBO
#define ThreadSafePreferences_CopyAppValue CFPreferencesCopyAppValue
View
@@ -148,7 +148,7 @@ - (void)dealloc
[super dealloc];
}
-- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
+- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input
{
BOOL success = NO;
@@ -203,7 +203,7 @@ - (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(
}
}
-+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
++ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input
{
// we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -230,4 +230,38 @@ + (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withAr
return result;
}
+
++(int) task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input output: (NSData**)outData
+{
+ // we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ int taskResult = 0;
+ if( outData )
+ *outData = nil;
+
+ NS_DURING
+ {
+ NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
+
+ [task run:toolPath directory:currentDirectory withArgs:args input:input];
+
+ taskResult = [task result];
+ if( outData )
+ *outData = [[task output] retain];
+
+ [task release];
+ }
+ NS_HANDLER;
+ taskResult = errCppGeneral;
+ NS_ENDHANDLER;
+
+ [pool drain];
+
+ // retained above
+ if( outData )
+ [*outData autorelease];
+
+ return taskResult;
+}
+
@end
View
@@ -263,18 +263,17 @@ - (void)installUpdate
[[updater delegate] updater:updater willInstallUpdate:updateItem];
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
- NSString *relaunchPathToCopy = [SPARKLE_BUNDLE pathForResource:@"relaunch" ofType:@""];
+ NSString *relaunchPathToCopy = [SPARKLE_BUNDLE pathForResource:@"finish_installation" ofType:@"app"];
NSString *targetPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]];
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
NSError *error = nil;
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
[[NSFileManager defaultManager] createDirectoryAtPath: [targetPath stringByDeletingLastPathComponent] attributes: [NSDictionary dictionary]];
#else
- [[NSFileManager defaultManager] createDirectoryAtPath: [targetPath stringByDeletingLastPathComponent] withIntermediateDirectories: YES attributes: [NSDictionary dictionary] error: NULL];
+ [[NSFileManager defaultManager] createDirectoryAtPath: [targetPath stringByDeletingLastPathComponent] withIntermediateDirectories: YES attributes: [NSDictionary dictionary] error: &error];
#endif
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
- NSError *error = nil;
if( [SUPlainInstaller copyPathWithAuthentication: relaunchPathToCopy overPath: targetPath temporaryName: nil error: &error] )
relaunchPath = [targetPath retain];
else
@@ -293,8 +292,8 @@ - (void)installAndRelaunchWithTool
static BOOL postponedOnce = NO;
if (!postponedOnce && [[updater delegate] respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)])
{
- NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(relaunchHostApp)]];
- [invocation setSelector:@selector(relaunchHostApp)];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installAndRelaunchWithTool)]];
+ [invocation setSelector:@selector(installAndRelaunchWithTool)];
[invocation setTarget:self];
postponedOnce = YES;
if ([[updater delegate] updater:updater shouldPostponeRelaunchForUpdate:updateItem untilInvoking:invocation])
View
@@ -26,6 +26,9 @@
// following on to always reset the name back to "MyApp":
#define NORMALIZE_INSTALLED_APP_NAME 1
+
+#define TRY_TO_APPEND_VERSION_NUMBER 1
+
// -----------------------------------------------------------------------------
// Notifications:
// -----------------------------------------------------------------------------
View
@@ -14,8 +14,10 @@
@class SUHost;
@interface SUInstaller : NSObject { }
-+ (void)installFromUpdateFolder:(NSString *)updateFolder overHost:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator;
-+ (void)finishInstallationWithResult:(BOOL)result host:(SUHost *)host error:(NSError *)error delegate:delegate;
++ (void) installFromUpdateFolder:(NSString *)updateFolder overHost:(SUHost *)host delegate:delegate synchronously:(BOOL)synchronously versionComparator:(id <SUVersionComparison>)comparator;
++ (void) finishInstallationWithResult:(BOOL)result host:(SUHost *)host error:(NSError *)error delegate:delegate;
++ (NSString*) updateFolder;
++ (void) notifyDelegateOfFailure: (NSDictionary*)dict;
@end
@interface NSObject (SUInstallerDelegateInformalProtocol)
@@ -103,7 +103,8 @@ + (NSString *)_temporaryCopyNameForPath:(NSString *)path didFindTrash: (BOOL*)ou
UInt8 trashPath[MAXPATHLEN +1] = { 0 };
FSRef trashRef, pathRef;
FSVolumeRefNum vSrcRefNum = kFSInvalidVolumeRefNum;
- FSCatalogInfo catInfo = { 0 };
+ FSCatalogInfo catInfo;
+ memset( &catInfo, 0, sizeof(catInfo) );
OSStatus err = FSPathMakeRef( (UInt8*) [path fileSystemRepresentation], &pathRef, NULL );
if( err == noErr )
{
View
@@ -21,6 +21,8 @@
}
- (void)showModalAlert:(NSAlert *)alert;
+- (IBAction)cancelDownload: (id)sender;
+- (void)installAndRestart: (id)sender;
@end
Oops, something went wrong.

0 comments on commit a885437

Please sign in to comment.