From 1cc5f230a574ca9304a31a88c40bc3c737a9848e Mon Sep 17 00:00:00 2001 From: Deadpikle Date: Wed, 20 Dec 2017 12:40:48 -0500 Subject: [PATCH] Check OS version before creating downloader --- Sparkle/SUBasicUpdateDriver.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 7044fe88..b4e817b1 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -283,7 +283,12 @@ withRequest:request]; } // TODO: SPUDownloaderDeprecated vs SPUDownloaderSession - self.download = [[SPUDownloaderDeprecated alloc] initWithDelegate:self]; + if ([SUOperatingSystem isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 9, 0}]) { + self.download = [[SPUDownloaderSession alloc] initWithDelegate:self]; + } + else { + self.download = [[SPUDownloaderDeprecated alloc] initWithDelegate:self]; + } SPUURLRequest *urlRequest = [SPUURLRequest URLRequestWithRequest:request]; NSString *desiredFilename = [NSString stringWithFormat:@"%@ %@", [self.host name], [self.updateItem versionString]]; [self.download startPersistentDownloadWithRequest:urlRequest bundleIdentifier:bundleIdentifier desiredFilename:desiredFilename];