diff --git a/SUBasicUpdateDriver.h b/SUBasicUpdateDriver.h index 90cb6250..ddafed6c 100644 --- a/SUBasicUpdateDriver.h +++ b/SUBasicUpdateDriver.h @@ -47,7 +47,9 @@ - (void)installUpdate; - (void)installerFinishedForHostBundle:(NSBundle *)hb; - (void)installerForHostBundle:(NSBundle *)hb failedWithError:(NSError *)error; + - (void)relaunchHostApp; +- (void)cleanUp; - (void)abortUpdate; - (void)abortUpdateWithError:(NSError *)error; diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index b29fc369..8fecd50c 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -222,6 +222,8 @@ if ([delegate shouldPostponeRelaunchForUpdate:updateItem untilInvoking:invocation]) return; } + + [self cleanUp]; // Clean up the download and extracted files. [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterWillRestartNotification object:self]; if ([delegate respondsToSelector:@selector(updaterWillRelaunchApplication)]) @@ -243,6 +245,11 @@ [NSApp terminate:self]; } +- (void)cleanUp +{ + [[NSFileManager defaultManager] removeFileAtPath:[downloadPath stringByDeletingLastPathComponent] handler:nil]; +} + - (void)installerForHostBundle:(NSBundle *)hb failedWithError:(NSError *)error { if (hb != hostBundle) { return; }