mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115)
* Added updaterDidRelaunchApplication: delegate method. * Removed isUpdaterRelaunching property. * Revert SUHost.
This commit is contained in:
1 parent
43b4472d3c
commit
7c8ff2b969
7 files changed
+20
No files matched your search
Vendored
+3
@@ -577,6 +577,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
//Set relaunching flag.
|
||||
[self.host setBool:YES forUserDefaultsKey:SUUpdateRelaunchingMarkerKey];
|
||||
|
||||
[NSTask launchedTaskWithLaunchPath:relaunchToolPath arguments:@[[self.host bundlePath],
|
||||
pathToRelaunch,
|
||||
[NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]],
|
||||
|
||||
Vendored
+1
@@ -35,6 +35,7 @@ extern NSString *const SUTechnicalErrorInformationKey;
|
||||
|
||||
extern NSString *const SUFeedURLKey;
|
||||
extern NSString *const SUHasLaunchedBeforeKey;
|
||||
extern NSString *const SUUpdateRelaunchingMarkerKey;
|
||||
extern NSString *const SUShowReleaseNotesKey;
|
||||
extern NSString *const SUSkippedVersionKey;
|
||||
extern NSString *const SUScheduledCheckIntervalKey;
|
||||
|
||||
Vendored
+1
@@ -26,6 +26,7 @@ NSString *const SUAppcastAttributeValueMacOS = @"macos";
|
||||
NSString *const SUTechnicalErrorInformationKey = @"SUTechnicalErrorInformation";
|
||||
|
||||
NSString *const SUHasLaunchedBeforeKey = @"SUHasLaunchedBefore";
|
||||
NSString *const SUUpdateRelaunchingMarkerKey = @"SUUpdateRelaunchingMarker";
|
||||
NSString *const SUFeedURLKey = @"SUFeedURL";
|
||||
NSString *const SUShowReleaseNotesKey = @"SUShowReleaseNotes";
|
||||
NSString *const SUSkippedVersionKey = @"SUSkippedVersion";
|
||||
|
||||
File mode changed.
File mode changed.
Vendored
+8
@@ -208,6 +208,14 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
||||
if (!hasLaunchedBefore) {
|
||||
[self.host setBool:YES forUserDefaultsKey:SUHasLaunchedBeforeKey];
|
||||
}
|
||||
// Relanching from app update?
|
||||
else if ([self.host boolForUserDefaultsKey:SUUpdateRelaunchingMarkerKey]) {
|
||||
if ([self.delegate respondsToSelector:@selector(updaterDidRelaunchApplication:)]) {
|
||||
[self.delegate updaterDidRelaunchApplication:self];
|
||||
}
|
||||
//Reset flag back to NO.
|
||||
[self.host setBool:NO forUserDefaultsKey:SUUpdateRelaunchingMarkerKey];
|
||||
}
|
||||
|
||||
if (shouldPrompt) {
|
||||
NSArray<NSDictionary<NSString *, NSString *> *> *profileInfo = [SUSystemProfiler systemProfileArrayForHost:self.host];
|
||||
|
||||
Vendored
+7
@@ -192,6 +192,13 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
|
||||
*/
|
||||
- (void)updaterWillRelaunchApplication:(SUUpdater *)updater;
|
||||
|
||||
/*!
|
||||
Called immediately after relaunching. SUUpdater delegate must be set before applicationDidFinishLaunching: to catch this event.
|
||||
|
||||
\param updater The SUUpdater instance.
|
||||
*/
|
||||
- (void)updaterDidRelaunchApplication:(SUUpdater *)updater;
|
||||
|
||||
/*!
|
||||
Returns an object that compares version numbers to determine their arithmetic relation to each other.
|
||||
|
||||
|
||||
Reference in new issue
Block a user