diff --git a/Sparkle/SUAutomaticUpdateDriver.m b/Sparkle/SUAutomaticUpdateDriver.m index 20a0a065..8da35671 100644 --- a/Sparkle/SUAutomaticUpdateDriver.m +++ b/Sparkle/SUAutomaticUpdateDriver.m @@ -180,10 +180,18 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 - (void)abortUpdateWithError:(NSError *)error { - if (self.showErrors) + if (self.showErrors) { [super abortUpdateWithError:error]; - else + } else { + // Call delegate separately here because otherwise it won't know we stopped. + // Normally this gets called by the superclass + id updaterDelegate = [self.updater delegate]; + if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) { + [updaterDelegate updater:self.updater didAbortWithError:error]; + } + [self abortUpdate]; + } } @end diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 12147df7..c426849b 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -436,6 +436,13 @@ if (self.download) { [self.download cancel]; } + + // Notify host app that update has aborted + id updaterDelegate = [self.updater delegate]; + if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) { + [updaterDelegate updater:self.updater didAbortWithError:error]; + } + [self abortUpdate]; } diff --git a/Sparkle/SUScheduledUpdateDriver.m b/Sparkle/SUScheduledUpdateDriver.m index b51fd91d..9d6bf141 100644 --- a/Sparkle/SUScheduledUpdateDriver.m +++ b/Sparkle/SUScheduledUpdateDriver.m @@ -43,10 +43,18 @@ - (void)abortUpdateWithError:(NSError *)error { - if (self.showErrors) + if (self.showErrors) { [super abortUpdateWithError:error]; - else + } else { + // Call delegate separately here because otherwise it won't know we stopped. + // Normally this gets called by the superclass + id updaterDelegate = [self.updater delegate]; + if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) { + [updaterDelegate updater:self.updater didAbortWithError:error]; + } + [self abortUpdate]; + } } @end diff --git a/Sparkle/SUUpdater.h b/Sparkle/SUUpdater.h index f83fed5b..6d9c98d3 100644 --- a/Sparkle/SUUpdater.h +++ b/Sparkle/SUUpdater.h @@ -312,6 +312,14 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey; */ - (void)updater:(SUUpdater *)updater didCancelInstallUpdateOnQuit:(SUAppcastItem *)item; +/*! + Called after an update is aborted due to an error. + + \param updater The SUUpdater instance. + \param error The error that caused the abort + */ +- (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error; + @end #endif