Add 1.x willInstallUpdateOnQuit:immediateInstallationBlock: stub

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

No files matched your search

+7 -1
View File
@@ -462,7 +462,13 @@ static NSMutableDictionary *sharedUpdaters = nil;
{
BOOL installationHandledByDelegate = NO;
if ([self.delegate respondsToSelector:@selector(updater:willInstallUpdateOnQuit:immediateInstallationInvocation:)]) {
if ([self.delegate respondsToSelector:@selector((updater:willInstallUpdateOnQuit:immediateInstallationBlock:))]) {
[self.delegate updater:self willInstallUpdateOnQuit:item immediateInstallationBlock:immediateInstallHandler];
// We have to assume they will handle the installation since they implement this method
// Not ideal, but this is why this delegate callback is deprecated
installationHandledByDelegate = YES;
} else if ([self.delegate respondsToSelector:@selector(updater:willInstallUpdateOnQuit:immediateInstallationInvocation:)]) {
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(finishSilentInstallation)]];
// This invocation will retain self, but this instance is kept alive forever by our singleton pattern anyway
+11
View File
@@ -295,6 +295,17 @@ __deprecated_msg("See SPUUpdaterDelegate instead")
*/
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationInvocation:(NSInvocation *)invocation;
/*!
Called when an update is scheduled to be silently installed on quit.
This is after an update has been automatically downloaded in the background.
(i.e. SUUpdater::automaticallyDownloadsUpdates is YES)
This method acts as a more modern alternative to SUUpdaterDelegate::updater:willInstallUpdateOnQuit:immediateInstallationInvocation: using a block instead 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.
\param installationBlock Can be used to trigger an immediate silent install and relaunch.
*/
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationBlock:(void (^)(void))installationBlock;
/*!
Calls after an update that was scheduled to be silently installed on quit has been canceled.