From 763ecf65dece933991b13da3899e2cd244ab27e5 Mon Sep 17 00:00:00 2001 From: Marcus Ososbase Date: Wed, 4 Apr 2018 16:58:08 -0400 Subject: [PATCH 1/3] Sparkle cleanup --- .../xcshareddata/xcschemes/Distribution.xcscheme | 2 +- .../xcshareddata/xcschemes/Sparkle.xcscheme | 10 +++++----- .../xcshareddata/xcschemes/UITests.xcscheme | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme index a02aac52..a44f53d3 100644 --- a/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme @@ -34,7 +34,7 @@ diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme index 4a3f3005..49ea0ec5 100644 --- a/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme @@ -15,7 +15,7 @@ @@ -34,7 +34,7 @@ @@ -44,7 +44,7 @@ @@ -68,7 +68,7 @@ @@ -86,7 +86,7 @@ diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme index b9378c5a..cf3b53c6 100644 --- a/Sparkle.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/UITests.xcscheme @@ -18,7 +18,7 @@ From 47c94db72743dbaf89a04c713e18c7f303fbd9af Mon Sep 17 00:00:00 2001 From: Marcus Ososbase Date: Wed, 4 Apr 2018 16:58:31 -0400 Subject: [PATCH 2/3] Don't quit host if target app is not running --- Sparkle/SUBasicUpdateDriver.m | 17 ++++++----------- Sparkle/SUUpdaterDelegate.h | 3 ++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 0ed1223b..d00570bd 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -608,18 +608,13 @@ for (NSRunningApplication *app in apps) { [app terminate]; } - - // Notify the mainBundle host the target has been terminated - id updater = self.updater; - id updaterDelegate = [updater delegate]; - if ([updaterDelegate respondsToSelector:@selector(updater:didTerminateTarget:)]) { - [updaterDelegate updater:self.updater didTerminateTarget:bundleID]; - } } - else - { - // Shouldn't happen - [NSApp terminate:self]; + + // Notify the mainBundle host the target has been terminated + id updater = self.updater; + id updaterDelegate = [updater delegate]; + if ([updaterDelegate respondsToSelector:@selector(updater:didTerminateTarget:)]) { + [updaterDelegate updater:self.updater didTerminateTarget:bundleID]; } } } diff --git a/Sparkle/SUUpdaterDelegate.h b/Sparkle/SUUpdaterDelegate.h index a614ae62..8c506203 100644 --- a/Sparkle/SUUpdaterDelegate.h +++ b/Sparkle/SUUpdaterDelegate.h @@ -293,7 +293,8 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey; - (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationBlock:(void (^)()) restartBlock; /*! - Called when the update target is not from the host mainBundle. For example, a helper app updating its parent + Called when the update target which is not from the host mainBundle has been terminated. + For example, a helper app updating its parent. \param updater the SUUpdater instance. \param targetBundleID the bundle ID of the terminated parent app From 258ad4948b2d575a2cb0310a5fe814f36846986a Mon Sep 17 00:00:00 2001 From: Marcus Ososbase Date: Wed, 4 Apr 2018 16:59:10 -0400 Subject: [PATCH 3/3] Disabled Sparkle insecure update warning --- Sparkle/SUUpdater.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 5d1c73b9..32bb65f9 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -150,8 +150,9 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults informativeText:[NSString stringWithFormat:SULocalizedString(@"For security reasons, the file (%@) indicated by the '%@' key needs to exist in the bundle's Resources.", nil), publicDSAKeyFileKey, SUPublicDSAKeyFileKey]]; } else { if (!isMainBundle) { - [self showAlertText:SULocalizedString(@"Insecure update error!", nil) - informativeText:SULocalizedString(@"For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information.", nil)]; + // Sparkle documentation doesn't explain why this is a requirement. We won't be using DSA keys for now. Codesigning will suffice. +// [self showAlertText:SULocalizedString(@"Insecure update error!", nil) +// informativeText:SULocalizedString(@"For security reasons, you need to sign your updates with a DSA key. See Sparkle's documentation for more information.", nil)]; } else { if (!hostIsCodeSigned) { [self showAlertText:SULocalizedString(@"Insecure update error!", nil)