Add updater:shouldPostponeRelaunchForUpdate: 1.x stub

This commit is contained in:
Zorg committed 2021-02-20 19:40:02 -08:00
1 parent 59326e80d4
commit ea472ae3f0
2 files changed
+18

No files matched your search

+3
View File
@@ -405,6 +405,9 @@ static NSMutableDictionary *sharedUpdaters = nil;
self.postponedInstallHandler = installHandler;
shouldPostponeRelaunch = [self.delegate updater:self shouldPostponeRelaunchForUpdate:item untilInvoking:invocation];
} else if ([self.delegate respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:)]) {
// This API should really take a block, but not fixing a 1.x mishap now
shouldPostponeRelaunch = [self.delegate updater:self shouldPostponeRelaunchForUpdate:item];
}
return shouldPostponeRelaunch;
+15
View File
@@ -208,6 +208,21 @@ __deprecated_msg("See SPUUpdaterDelegate instead")
*/
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)item untilInvoking:(NSInvocation *)invocation;
/*!
Returns whether the relaunch should be delayed in order to perform other tasks.
This is not called if the user didn't relaunch on the previous update,
in that case it will immediately restart.
This method acts as a simpler alternative to SUUpdaterDelegate::updater:shouldPostponeRelaunchForUpdate:untilInvoking: avoiding usage of NSInvocation, which is not available in Swift environments.
\param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that is proposed to be installed.
\return \c YES to delay the relaunch.
*/
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)item;
/*!
Returns whether the application should be relaunched at all.