From 46f9b4a049fc7be357ee3beb5793c2caf74e52d6 Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Wed, 25 Jun 2008 22:39:17 -0700 Subject: [PATCH] Fixes 242566 Sparkle now cleans up all the stuff it makes in /tmp --- SUBasicUpdateDriver.h | 2 ++ SUBasicUpdateDriver.m | 7 +++++++ 2 files changed, 9 insertions(+) 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; }