From 6be55685c885ff38f9f779d4515472bd315d8fe8 Mon Sep 17 00:00:00 2001 From: Matt Stevens Date: Sun, 12 Feb 2012 20:02:46 -0700 Subject: [PATCH] Clean up after install on quit updates --- finish_installation.m | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/finish_installation.m b/finish_installation.m index 87cb691f..c0d2cc69 100644 --- a/finish_installation.m +++ b/finish_installation.m @@ -117,19 +117,20 @@ else appPath = [host installationPath]; [[NSWorkspace sharedWorkspace] openFile: appPath]; - if( folderpath ) - { - NSError* theError = nil; - if( ![SUPlainInstaller _removeFileAtPath: [SUInstaller updateFolder] error: &theError] ) - SULog( @"Couldn't remove update folder: %@.", theError ); - } - #if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 - [[NSFileManager defaultManager] removeFileAtPath: selfPath handler: nil]; - #else - [[NSFileManager defaultManager] removeItemAtPath: selfPath error: NULL]; - #endif } - + + if (folderpath) + { + NSError *theError = nil; + if( ![SUPlainInstaller _removeFileAtPath: [SUInstaller updateFolder] error: &theError] ) + SULog( @"Couldn't remove update folder: %@.", theError ); + } +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 + [[NSFileManager defaultManager] removeFileAtPath: selfPath handler: nil]; +#else + [[NSFileManager defaultManager] removeItemAtPath: selfPath error: NULL]; +#endif + exit(EXIT_SUCCESS); }