From 8dc4e78cb2ff1874eb62fa5560f479624282571f Mon Sep 17 00:00:00 2001 From: Zorg Date: Fri, 14 May 2021 22:09:41 -0700 Subject: [PATCH 01/26] Remove unused installationPath variable from normalization changes --- Autoupdate/AppInstaller.m | 4 ---- Autoupdate/SUGuidedPackageInstaller.h | 2 +- Autoupdate/SUGuidedPackageInstaller.m | 5 +---- Autoupdate/SUInstaller.m | 4 ++-- Autoupdate/SUInstallerProtocol.h | 3 --- Autoupdate/SUPackageInstaller.h | 2 +- Autoupdate/SUPackageInstaller.m | 5 +---- 7 files changed, 6 insertions(+), 19 deletions(-) diff --git a/Autoupdate/AppInstaller.m b/Autoupdate/AppInstaller.m index 7d8dbbf0..9f13b664 100644 --- a/Autoupdate/AppInstaller.m +++ b/Autoupdate/AppInstaller.m @@ -561,10 +561,6 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; return; } - // Used later for relaunching - // Compute this now before we set this installer property to nil - NSString *installationPath = [self.installer installationPath]; - NSError *thirdStageError = nil; if (![self.installer performFinalInstallationProgressBlock:nil error:&thirdStageError]) { [self.installer performCleanup]; diff --git a/Autoupdate/SUGuidedPackageInstaller.h b/Autoupdate/SUGuidedPackageInstaller.h index 29e9389f..e297cf7c 100644 --- a/Autoupdate/SUGuidedPackageInstaller.h +++ b/Autoupdate/SUGuidedPackageInstaller.h @@ -21,6 +21,6 @@ A guided installation can be started by applications other than the application @interface SUGuidedPackageInstaller : NSObject -- (instancetype)initWithPackagePath:(NSString *)packagePath installationPath:(NSString *)installationPath; +- (instancetype)initWithPackagePath:(NSString *)packagePath; @end diff --git a/Autoupdate/SUGuidedPackageInstaller.m b/Autoupdate/SUGuidedPackageInstaller.m index 402e8aff..5632f0ae 100644 --- a/Autoupdate/SUGuidedPackageInstaller.m +++ b/Autoupdate/SUGuidedPackageInstaller.m @@ -16,21 +16,18 @@ @interface SUGuidedPackageInstaller () @property (nonatomic, readonly, copy) NSString *packagePath; -@property (nonatomic, readonly, copy) NSString *installationPath; @end @implementation SUGuidedPackageInstaller @synthesize packagePath = _packagePath; -@synthesize installationPath = _installationPath; -- (instancetype)initWithPackagePath:(NSString *)packagePath installationPath:(NSString *)installationPath +- (instancetype)initWithPackagePath:(NSString *)packagePath { self = [super init]; if (self != nil) { _packagePath = [packagePath copy]; - _installationPath = [installationPath copy]; } return self; } diff --git a/Autoupdate/SUInstaller.m b/Autoupdate/SUInstaller.m index 553c12b0..7db302e8 100644 --- a/Autoupdate/SUInstaller.m +++ b/Autoupdate/SUInstaller.m @@ -135,7 +135,7 @@ *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Found guided package installer but '%@=%@' was probably missing in the appcast item enclosure", SUAppcastAttributeInstallationType, SPUInstallationTypeGuidedPackage] }]; } } else { - installer = [[SUGuidedPackageInstaller alloc] initWithPackagePath:newDownloadPath installationPath:host.bundlePath]; + installer = [[SUGuidedPackageInstaller alloc] initWithPackagePath:newDownloadPath]; } } else if (isPackage) { if (![expectedInstallationType isEqualToString:SPUInstallationTypeInteractivePackage]) { @@ -143,7 +143,7 @@ *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Found package installer but '%@=%@' was probably missing in the appcast item enclosure", SUAppcastAttributeInstallationType, SPUInstallationTypeInteractivePackage] }]; } } else { - installer = [[SUPackageInstaller alloc] initWithPackagePath:newDownloadPath installationPath:host.bundlePath]; + installer = [[SUPackageInstaller alloc] initWithPackagePath:newDownloadPath]; } } else { if (![expectedInstallationType isEqualToString:SPUInstallationTypeApplication]) { diff --git a/Autoupdate/SUInstallerProtocol.h b/Autoupdate/SUInstallerProtocol.h index 86fb6f3d..c574bf41 100644 --- a/Autoupdate/SUInstallerProtocol.h +++ b/Autoupdate/SUInstallerProtocol.h @@ -33,9 +33,6 @@ NS_ASSUME_NONNULL_BEGIN // Should be thread safe - (BOOL)canInstallSilently; -// The destination and installation path of the bundle being updated -- (NSString *)installationPath; - @end NS_ASSUME_NONNULL_END diff --git a/Autoupdate/SUPackageInstaller.h b/Autoupdate/SUPackageInstaller.h index b4375618..779118af 100644 --- a/Autoupdate/SUPackageInstaller.h +++ b/Autoupdate/SUPackageInstaller.h @@ -14,6 +14,6 @@ @interface SUPackageInstaller : NSObject -- (instancetype)initWithPackagePath:(NSString *)packagePath installationPath:(NSString *)installationPath; +- (instancetype)initWithPackagePath:(NSString *)packagePath; @end diff --git a/Autoupdate/SUPackageInstaller.m b/Autoupdate/SUPackageInstaller.m index aaaa2e16..056567fb 100644 --- a/Autoupdate/SUPackageInstaller.m +++ b/Autoupdate/SUPackageInstaller.m @@ -17,7 +17,6 @@ @interface SUPackageInstaller () @property (nonatomic, readonly, copy) NSString *packagePath; -@property (nonatomic, readonly, copy) NSString *installationPath; @end @@ -26,14 +25,12 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open"; @synthesize packagePath = _packagePath; -@synthesize installationPath = _installationPath; -- (instancetype)initWithPackagePath:(NSString *)packagePath installationPath:(NSString *)installationPath +- (instancetype)initWithPackagePath:(NSString *)packagePath { self = [super init]; if (self != nil) { _packagePath = [packagePath copy]; - _installationPath = [installationPath copy]; } return self; } From debab803c9fd41d9166559914d197c50c4229b9d Mon Sep 17 00:00:00 2001 From: Zorg Date: Fri, 14 May 2021 22:28:38 -0700 Subject: [PATCH 02/26] Add auto-layout constraints to status window --- Sparkle/SUStatus.xib | 50 ++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/Sparkle/SUStatus.xib b/Sparkle/SUStatus.xib index 2985c4c9..69813dd2 100644 --- a/Sparkle/SUStatus.xib +++ b/Sparkle/SUStatus.xib @@ -1,8 +1,8 @@ - + - + @@ -23,20 +23,22 @@ - + - - - + + + + + + - - - + + @@ -46,17 +48,18 @@ - + - - - - - + + @@ -83,6 +85,22 @@ + + + + + + + + + + + + + + + + From be75bb38f68f7eeec0ff6ad1dccc683206c80769 Mon Sep 17 00:00:00 2001 From: Zorg Date: Fri, 14 May 2021 22:52:20 -0700 Subject: [PATCH 03/26] Add auto layout constraints to update permission prompt --- .../Base.lproj/SUUpdatePermissionPrompt.xib | 100 +++++++++++++----- 1 file changed, 75 insertions(+), 25 deletions(-) diff --git a/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib b/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib index 5aea2107..61e91493 100644 --- a/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib +++ b/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib @@ -1,8 +1,8 @@ - + - + @@ -30,9 +30,11 @@ - - - - - + + + + + - + - + + + @@ -79,9 +87,8 @@ Gw - - + - + + + + - + + + + + + + + + + + + + + + + + + + + + @@ -143,9 +177,12 @@ Gw - + - + + + + Anonymous system profile information is used to help us plan future development work. Please contact us if you have any questions about this. @@ -155,12 +192,11 @@ This is the information that would be sent: - + - - + @@ -184,7 +220,7 @@ This is the information that would be sent: - + @@ -203,6 +239,9 @@ This is the information that would be sent: + + + + + + + + + + + + + + From 07aca30e1136364682b20eb3a551fed60bb5edad Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 15 May 2021 11:53:08 -0700 Subject: [PATCH 04/26] Bump deployment target to 10.11 --- Configurations/ConfigCommon.xcconfig | 2 +- Configurations/ConfigUnitTest.xcconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index 04ee7259..f4e0cc54 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -30,7 +30,7 @@ GCC_SYMBOLS_PRIVATE_EXTERN = YES GCC_INLINES_ARE_PRIVATE_EXTERN = YES ARCHS = $(ARCHS_STANDARD) // NSURLSession requirements -MACOSX_DEPLOYMENT_TARGET = 10.9 +MACOSX_DEPLOYMENT_TARGET = 10.11 PRODUCT_NAME = ${TARGET_NAME} PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle.${PRODUCT_NAME:rfc1034identifier} diff --git a/Configurations/ConfigUnitTest.xcconfig b/Configurations/ConfigUnitTest.xcconfig index f9e7cea3..f0019af6 100644 --- a/Configurations/ConfigUnitTest.xcconfig +++ b/Configurations/ConfigUnitTest.xcconfig @@ -9,6 +9,6 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO WARNING_CFLAGS = $(inherited) -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments FRAMEWORK_SEARCH_PATHS = $(inherited) $(DEVELOPER_FRAMEWORKS_DIR) LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks -MACOSX_DEPLOYMENT_TARGET = 10.9 +MACOSX_DEPLOYMENT_TARGET = 10.11 CLANG_ENABLE_MODULES = YES SWIFT_OBJC_BRIDGING_HEADER = Tests/Sparkle Unit Tests-Bridging-Header.h From 3306ccd99488fe8052368797b58ba964c418f7ff Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 15 May 2021 11:58:01 -0700 Subject: [PATCH 05/26] Suppress deprecation warnings for SMJobSubmit functions --- InstallerLauncher/SUInstallerLauncher.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/InstallerLauncher/SUInstallerLauncher.m b/InstallerLauncher/SUInstallerLauncher.m index f3bc48a2..a25f72cc 100644 --- a/InstallerLauncher/SUInstallerLauncher.m +++ b/InstallerLauncher/SUInstallerLauncher.m @@ -56,7 +56,10 @@ // We could invoke SMJobCopyDictionary() first to see if the job exists, but I'd rather avoid // using it because the headers indicate it may be removed one day without any replacement CFErrorRef removeError = NULL; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" if (!SMJobRemove(domain, (__bridge CFStringRef)(label), auth, true, &removeError)) { +#pragma clang diagnostic pop if (removeError != NULL) { // It's normal for a job to not be found, so this is not an interesting error if (CFErrorGetCode(removeError) != kSMErrorJobNotFound) { @@ -77,7 +80,12 @@ jobDictionary[@"MachServices"] = @{SPUStatusInfoServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES}; CFErrorRef submitError = NULL; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // SMJobSubmit is deprecated but is the only way to submit a non-permanent + // helper and allows us to submit to user domain without requiring authorization submittedJob = SMJobSubmit(domain, (__bridge CFDictionaryRef)(jobDictionary), auth, &submitError); +#pragma clang diagnostic pop if (!submittedJob) { if (submitError != NULL) { SULog(SULogLevelError, @"Submit progress error: %@", submitError); @@ -239,7 +247,10 @@ // We could invoke SMJobCopyDictionary() first to see if the job exists, but I'd rather avoid // using it because the headers indicate it may be removed one day without any replacement CFErrorRef removeError = NULL; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" if (!SMJobRemove(domain, (__bridge CFStringRef)(label), auth, true, &removeError)) { +#pragma clang diagnostic pop if (removeError != NULL) { // It's normal for a job to not be found, so this is not an interesting error if (CFErrorGetCode(removeError) != kSMErrorJobNotFound) { @@ -252,7 +263,12 @@ NSDictionary *jobDictionary = @{@"Label" : label, @"ProgramArguments" : arguments, @"EnableTransactions" : @NO, @"KeepAlive" : @{@"SuccessfulExit" : @NO}, @"RunAtLoad" : @NO, @"Nice" : @0, @"LaunchOnlyOnce": @YES, @"MachServices" : @{SPUInstallerServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES, SPUProgressAgentServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES}}; CFErrorRef submitError = NULL; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // SMJobSubmit is deprecated but is the only way to submit a non-permanent + // helper and allows us to submit to user domain without requiring authorization submittedJob = SMJobSubmit(domain, (__bridge CFDictionaryRef)(jobDictionary), auth, &submitError); +#pragma clang diagnostic pop if (!submittedJob) { if (submitError != NULL) { SULog(SULogLevelError, @"Submit error: %@", submitError); From f6d8b506ae0ffa798cb1682a2ae41f31db9cae83 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 15 May 2021 14:21:17 -0700 Subject: [PATCH 06/26] Align disclosure button with include anonymous info text --- Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib b/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib index 61e91493..33fab419 100644 --- a/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib +++ b/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib @@ -119,7 +119,7 @@ Gw - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - + + + + - + @@ -173,15 +56,123 @@ Gw - - - + + + SUIncludeProfile + SUSendProfileInfo + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - SUIncludeProfile - SUSendProfileInfo - - From ef577fe0c0d7ee33edb82793aea89edb09466c5b Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 15 May 2021 21:54:06 -0700 Subject: [PATCH 08/26] Make subview for anonymous system info button --- .../Base.lproj/SUUpdatePermissionPrompt.xib | 127 ++++++++++-------- 1 file changed, 72 insertions(+), 55 deletions(-) diff --git a/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib b/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib index 6037686c..569f8525 100644 --- a/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib +++ b/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib @@ -11,7 +11,6 @@ - @@ -63,11 +62,11 @@ - + - + @@ -78,7 +77,7 @@ - + @@ -92,31 +91,8 @@ - - + @@ -126,41 +102,17 @@ - - - - - - - + @@ -315,9 +267,74 @@ Gw - + - + + + + + + + + + + + + + + + + + + + + + + + + + From ed87bcdab66205568315578675230160961a39be Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 16 May 2021 10:01:48 -0700 Subject: [PATCH 09/26] Use NSStackView for permission prompt window --- .../Base.lproj/SUUpdatePermissionPrompt.xib | 14 ++- Sparkle/SUUpdatePermissionPrompt.m | 102 ++++++------------ 2 files changed, 42 insertions(+), 74 deletions(-) diff --git a/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib b/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib index 569f8525..d2b224ab 100644 --- a/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib +++ b/Sparkle/Base.lproj/SUUpdatePermissionPrompt.xib @@ -11,8 +11,13 @@ + + + + + @@ -179,6 +184,9 @@ This is the information that would be sent: + + + @@ -274,7 +282,7 @@ Gw