Merge pull request #145 from mattstevens/install-on-quit-cleanup

Clean up after install on quit updates
This commit is contained in:
Andy Matuschak committed 2012-02-14 09:48:12 -08:00
commit 44cf0d0e51
1 file changed
+13 -12
+13 -12
View File
@@ -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);
}