Added a new Info.plist key: SUPromptUserOnFirstLaunch. Set this to YES to disable Sparkle's usual behavior of waiting 'till the second launch of an app to prompt for update permission.

This is useful for apps which don't, under normal operations, get quit. Like a menu extra.
This commit is contained in:
Andy Matuschak committed 2011-05-26 18:52:24 -07:00
1 parent 3ea1a9eee4
commit 32d4f249d4
3 files changed
+10 -3

No files matched your search

+1
View File
@@ -29,6 +29,7 @@ extern NSString *const SUEnableAutomaticChecksKeyOld;
extern NSString *const SUEnableSystemProfilingKey;
extern NSString *const SUSendProfileInfoKey;
extern NSString *const SULastProfileSubmitDateKey;
extern NSString *const SUPromptUserOnFirstLaunchKey;
extern NSString *const SUSparkleErrorDomain;
// Appcast phase errors.
+1
View File
@@ -28,6 +28,7 @@ NSString *const SUEnableAutomaticChecksKey = @"SUEnableAutomaticChecks";
NSString *const SUEnableAutomaticChecksKeyOld = @"SUCheckAtStartup";
NSString *const SUSendProfileInfoKey = @"SUSendProfileInfo";
NSString *const SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate";
NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch";
NSString *const SUSparkleErrorDomain = @"SUSparkleErrorDomain";
OSStatus SUAppcastParseError = 1000;
+8 -3
View File
@@ -112,9 +112,14 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
if ([host objectForUserDefaultsKey:SUEnableAutomaticChecksKeyOld])
[self setAutomaticallyChecksForUpdates:[host boolForUserDefaultsKey:SUEnableAutomaticChecksKeyOld]];
// Now, we don't want to ask the user for permission to do a weird thing on the first launch.
// We wait until the second launch.
else if ([host boolForUserDefaultsKey:SUHasLaunchedBeforeKey] == NO)
[host setBool:YES forUserDefaultsKey:SUHasLaunchedBeforeKey];
// We wait until the second launch, unless explicitly overridden via SUPromptUserOnFirstLaunchKey.
else if (![host objectForKey:SUPromptUserOnFirstLaunchKey])
{
if ([host boolForUserDefaultsKey:SUHasLaunchedBeforeKey] == NO)
[host setBool:YES forUserDefaultsKey:SUHasLaunchedBeforeKey];
else
shouldPrompt = YES;
}
else
shouldPrompt = YES;
}