Clean up after install on quit updates #145

Merged
merged 1 commit into from Feb 14, 2012
Jump to file
+13 −12
Split
View
@@ -117,19 +117,20 @@ - (void) relaunch
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);
}