Moved the check for whether the host is running from a disk image to SUBasicUpdateDriver so that all drivers could take advantage of this check.

This commit is contained in:
Andy Matuschak committed 2008-05-30 21:51:34 -07:00
1 parent 21b4aeeb3b
commit 8b3d15b306
2 files changed
+7 -5

No files matched your search

+7
View File
@@ -14,6 +14,13 @@
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb
{
hostBundle = [hb retain];
if ([hostBundle isRunningFromDiskImage])
{
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated when it's running from a disk image. Move %1$@ to your Applications folder, relaunch it, and try again.", nil), [hostBundle name]] forKey:NSLocalizedDescriptionKey]]];
return;
}
SUAppcast *appcast = [[SUAppcast alloc] init];
CFRetain(appcast); // We'll manage the appcast's memory ourselves so we don't have to make it an IV to support GC.
[appcast release];
-5
View File
@@ -14,11 +14,6 @@
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb
{
if ([hostBundle isRunningFromDiskImage])
{
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated when it's running from a disk image. Move %1$@ to your Applications folder, relaunch it, and try again.", nil), [hostBundle name]] forKey:NSLocalizedDescriptionKey]]];
return;
}
[super checkForUpdatesAtURL:appcastURL hostBundle:hb];
}