diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index 93b9d831..6b932a13 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -185,16 +185,6 @@ realRelauncherPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"relaunch" ofType:@""]; [NSTask launchedTaskWithLaunchPath:realRelauncherPath arguments:[NSArray arrayWithObjects:[hostBundle bundlePath], [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]]; - - //if there's a possibility that a copy of relauncher is in NSTemporaryDirectory(), we need to be sure to clean it up - if(relaunchPath) - { - [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation - source:[relaunchPath stringByDeletingLastPathComponent] - destination:@"" - files:[NSArray arrayWithObject:[relaunchPath lastPathComponent]] - tag:NULL]; - } } @catch (NSException *e) { diff --git a/SUInstaller.m b/SUInstaller.m index 07bb989b..710192b1 100644 --- a/SUInstaller.m +++ b/SUInstaller.m @@ -58,6 +58,8 @@ NSString *SUInstallerDelegateKey = @"SUInstallerDelegate"; { NSString *relaunchPathToCopy = [[NSBundle bundleForClass:[self class]] pathForResource:@"relaunch" ofType:@""]; NSString *targetPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]]; + //Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems + [[NSFileManager defaultManager] removeFileAtPath:targetPath handler:nil]; if([[NSFileManager defaultManager] copyPath:relaunchPathToCopy toPath:targetPath handler:nil]) *relaunchPath = targetPath;