diff --git a/Autoupdate/AgentConnection.h b/Autoupdate/AgentConnection.h new file mode 100644 index 00000000..98082ed6 --- /dev/null +++ b/Autoupdate/AgentConnection.h @@ -0,0 +1,34 @@ +// +// AgentConnection.h +// Sparkle +// +// Created by Mayur Pawashe on 7/17/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol AgentConnectionDelegate + +- (void)agentConnectionDidInitiate; +- (void)agentConnectionDidInvalidate; + +@end + +@protocol SUInstallerAgentProtocol; + +@interface AgentConnection : NSObject + +- (instancetype)initWithHostBundleIdentifier:(NSString *)bundleIdentifier delegate:(id)delegate; + +- (void)startListener; +- (void)invalidate; + +@property (nonatomic, readonly, nullable) id agent; +@property (nonatomic, readonly) BOOL connected; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Autoupdate/AgentConnection.m b/Autoupdate/AgentConnection.m new file mode 100644 index 00000000..69b865af --- /dev/null +++ b/Autoupdate/AgentConnection.m @@ -0,0 +1,109 @@ +// +// AgentConnection.m +// Sparkle +// +// Created by Mayur Pawashe on 7/17/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import "AgentConnection.h" +#import "SUMessageTypes.h" +#import "SUInstallerAgentProtocol.h" +#import "SUInstallerAgentInitiationProtocol.h" + +#ifdef _APPKITDEFINES_H +#error This is a "daemon-safe" class and should NOT import AppKit +#endif + +@interface AgentConnection () + +@property (nonatomic) NSXPCListener *xpcListener; +@property (nonatomic, nullable) NSXPCConnection *activeConnection; +@property (nonatomic, nullable) id agent; +@property (nonatomic, weak) id delegate; +@property (nonatomic) BOOL connected; + +@end + +@implementation AgentConnection + +@synthesize xpcListener = _xpcListener; +@synthesize activeConnection = _activeConnection; +@synthesize agent = _agent; +@synthesize delegate = _delegate; +@synthesize connected = _connected; + +- (instancetype)initWithHostBundleIdentifier:(NSString *)bundleIdentifier delegate:(id)delegate +{ + self = [super init]; + if (self != nil) { + // Agents should always be the one that connect to daemons due to how mach bootstraps work + // For this reason, we are the ones that are creating a listener, not the agent + _xpcListener = [[NSXPCListener alloc] initWithMachServiceName:SUProgressAgentServiceNameForBundleIdentifier(bundleIdentifier)]; + _xpcListener.delegate = self; + _delegate = delegate; + } + return self; +} + +- (void)startListener +{ + [self.xpcListener resume]; +} + +- (void)invalidate +{ + self.delegate = nil; + + [self.activeConnection invalidate]; + self.activeConnection = nil; + + [self.xpcListener invalidate]; + self.xpcListener = nil; +} + +- (BOOL)listener:(NSXPCListener *)__unused listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection +{ + if (self.activeConnection != nil) { + [newConnection invalidate]; + return NO; + } + + newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerAgentInitiationProtocol)]; + newConnection.exportedObject = self; + + newConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerAgentProtocol)]; + + self.activeConnection = newConnection; + + __weak AgentConnection *weakSelf = self; + newConnection.interruptionHandler = ^{ + [weakSelf.activeConnection invalidate]; + }; + + newConnection.invalidationHandler = ^{ + dispatch_async(dispatch_get_main_queue(), ^{ + [weakSelf.delegate agentConnectionDidInvalidate]; + }); + }; + + [newConnection resume]; + + self.agent = newConnection.remoteObjectProxy; + + return YES; +} + +- (void)connectionDidInitiateWithReply:(void (^)(void))acknowledgement +{ + dispatch_async(dispatch_get_main_queue(), ^{ + self.connected = YES; + + [self.delegate agentConnectionDidInitiate]; + self.delegate = nil; + }); + + acknowledgement(); +} + +@end diff --git a/Sparkle/Autoupdate/AppInstaller.h b/Autoupdate/AppInstaller.h similarity index 93% rename from Sparkle/Autoupdate/AppInstaller.h rename to Autoupdate/AppInstaller.h index 84174fe6..ea1ea48e 100644 --- a/Sparkle/Autoupdate/AppInstaller.h +++ b/Autoupdate/AppInstaller.h @@ -6,7 +6,7 @@ // Copyright © 2016 Sparkle Project. All rights reserved. // -#import +#import #import "SUUnarchiverProtocol.h" @interface AppInstaller : NSObject diff --git a/Sparkle/Autoupdate/AppInstaller.m b/Autoupdate/AppInstaller.m similarity index 72% rename from Sparkle/Autoupdate/AppInstaller.m rename to Autoupdate/AppInstaller.m index a198f858..23df75f3 100644 --- a/Sparkle/Autoupdate/AppInstaller.m +++ b/Autoupdate/AppInstaller.m @@ -8,7 +8,6 @@ #import "AppInstaller.h" #import "TerminationListener.h" -#import "StatusInfo.h" #import "SUInstaller.h" #import "SULog.h" #import "SUHost.h" @@ -23,12 +22,18 @@ #import "SUFileManager.h" #import "SUInstallationInfo.h" #import "SUAppcastItem.h" -#import "SUAuthorizationEnvironment.h" -#import "SUApplicationInfo.h" #import "SUErrors.h" #import "SUInstallerCommunicationProtocol.h" +#import "AgentConnection.h" +#import "SUInstallerAgentProtocol.h" +#import "SUInstallationType.h" + +#ifdef _APPKITDEFINES_H +#error This is a "daemon-safe" class and should NOT import AppKit +#endif #define FIRST_UPDATER_MESSAGE_TIMEOUT 7ull +#define RETRIEVE_PROCESS_IDENTIFIER_TIMEOUT 5ull /*! * Terminate the application after a delay from launching the new update to avoid OS activation issues @@ -44,12 +49,12 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5; */ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; -@interface AppInstaller () +@interface AppInstaller () @property (nonatomic) NSXPCListener* xpcListener; @property (nonatomic) NSXPCConnection *activeConnection; @property (nonatomic) id communicator; -@property (nonatomic) StatusInfo *statusInfo; +@property (nonatomic) AgentConnection *agentConnection; @property (nonatomic) BOOL receivedUpdaterPong; @property (nonatomic, strong) TerminationListener *terminationListener; @@ -70,6 +75,8 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; @property (nonatomic) BOOL performedStage2Installation; @property (nonatomic) BOOL performedStage3Installation; +@property (nonatomic) NSUInteger agentConnectionCounter; + @end @implementation AppInstaller @@ -77,7 +84,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; @synthesize xpcListener = _xpcListener; @synthesize activeConnection = _activeConnection; @synthesize communicator = _communicator; -@synthesize statusInfo = _statusInfo; +@synthesize agentConnection = _agentConnection; @synthesize receivedUpdaterPong = _receivedUpdaterPong; @synthesize hostBundleIdentifier = _hostBundleIdentifier; @synthesize allowsInteraction = _allowsInteraction; @@ -93,6 +100,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; @synthesize performedStage1Installation = _performedStage1Installation; @synthesize performedStage2Installation = _performedStage2Installation; @synthesize performedStage3Installation = _performedStage3Installation; +@synthesize agentConnectionCounter = _agentConnectionCounter; - (instancetype)initWithHostBundleIdentifier:(NSString *)hostBundleIdentifier allowingInteraction:(BOOL)allowsInteraction { @@ -107,7 +115,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; _xpcListener = [[NSXPCListener alloc] initWithMachServiceName:SUInstallerServiceNameForBundleIdentifier(hostBundleIdentifier)]; _xpcListener.delegate = self; - _statusInfo = [[StatusInfo alloc] initWithHostBundleIdentifier:hostBundleIdentifier]; + _agentConnection = [[AgentConnection alloc] initWithHostBundleIdentifier:hostBundleIdentifier delegate:self]; return self; } @@ -158,13 +166,18 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; - (void)start { [self.xpcListener resume]; - [self.statusInfo startListener]; + [self.agentConnection startListener]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(FIRST_UPDATER_MESSAGE_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ if (!self.receivedInstallationData) { SULog(@"Timeout: installation data was never received"); [self cleanupAndExitWithStatus:EXIT_FAILURE]; } + + if (!self.agentConnection.connected) { + SULog(@"Timeout: agent connection was never initiated"); + [self cleanupAndExitWithStatus:EXIT_FAILURE]; + } }); } @@ -302,10 +315,50 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; } else { [self.communicator handleMessageWithIdentifier:SUInstallationStartedStage1 data:[NSData data]]; - [self startInstallation]; + self.agentConnectionCounter++; + if (self.agentConnectionCounter == 2) { + [self retrieveProcessIdentifierAndStartInstallation]; + } } } +- (void)agentConnectionDidInitiate +{ + self.agentConnectionCounter++; + if (self.agentConnectionCounter == 2) { + [self retrieveProcessIdentifierAndStartInstallation]; + } +} + +- (void)agentConnectionDidInvalidate +{ + if (self.agentConnectionCounter < 2) { + SULog(@"Error: Agent connection invalidated before installation began"); + [self cleanupAndExitWithStatus:EXIT_FAILURE]; + } +} + +- (void)retrieveProcessIdentifierAndStartInstallation +{ + // We use the relaunch path for the bundle to listen for termination instead of the host path + // For a plug-in this makes a big difference; we want to wait until the app hosting the plug-in terminates + // Otherwise for an app, the relaunch path and host path should be identical + + [self.agentConnection.agent registerRelaunchBundlePath:self.installationData.relaunchPath reply:^(NSNumber * _Nullable processIdentifier) { + dispatch_async(dispatch_get_main_queue(), ^{ + self.terminationListener = [[TerminationListener alloc] initWithProcessIdentifier:processIdentifier]; + [self startInstallation]; + }); + }]; + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(RETRIEVE_PROCESS_IDENTIFIER_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + if (self.terminationListener == nil) { + SULog(@"Timeour error: failed to retreive process identifier from agent"); + [self cleanupAndExitWithStatus:EXIT_FAILURE]; + } + }); +} + - (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data { if (identifier == SUInstallationData && self.installationData == nil) { @@ -323,40 +376,38 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; NSBundle *hostBundle = [NSBundle bundleWithPath:nonNullInstallationData.hostBundlePath]; SUHost *host = [[SUHost alloc] initWithBundle:hostBundle]; - NSString *bundleIdentifier = hostBundle.bundleIdentifier; - if (bundleIdentifier == nil || ![bundleIdentifier isEqualToString:self.hostBundleIdentifier]) { - SULog(@"Error: Failed to match host bundle identifiers %@ and %@", self.hostBundleIdentifier, bundleIdentifier); + NSString *installationType = nonNullInstallationData.installationType; + if (!SUValidInstallationType(installationType)) { + SULog(@"Error: Received invalid installation type: %@", installationType); [self cleanupAndExitWithStatus:EXIT_FAILURE]; } else { - NSBundle *relaunchBundle = [NSBundle bundleWithPath:nonNullInstallationData.relaunchPath]; - if (relaunchBundle == nil) { - SULog(@"Error: Failed to locate relaunch bundle path %@", nonNullInstallationData.relaunchPath); + NSString *bundleIdentifier = hostBundle.bundleIdentifier; + if (bundleIdentifier == nil || ![bundleIdentifier isEqualToString:self.hostBundleIdentifier]) { + SULog(@"Error: Failed to match host bundle identifiers %@ and %@", self.hostBundleIdentifier, bundleIdentifier); [self cleanupAndExitWithStatus:EXIT_FAILURE]; } else { - self.host = host; - self.installationData = installationData; - - // We use the relaunch path for the bundle to listen for termination instead of the host path - // For a plug-in this makes a big difference; we want to wait until the app hosting the plug-in terminates - // Otherwise for an app, the relaunch path and host path should be identical - - NSRunningApplication *runningApplication = [SUApplicationInfo runningApplicationWithBundle:host.bundle]; - NSNumber *processIdentifier = (runningApplication == nil || runningApplication.terminated) ? nil : @(runningApplication.processIdentifier); - - self.terminationListener = [[TerminationListener alloc] initWithProcessIdentifier:processIdentifier]; - - [self extractAndInstallUpdate]; + // This will be important later + if (nonNullInstallationData.relaunchPath == nil) { + SULog(@"Error: Failed to obtain relaunch path from installation data"); + [self cleanupAndExitWithStatus:EXIT_FAILURE]; + } else { + self.host = host; + self.installationData = installationData; + + [self extractAndInstallUpdate]; + } } } } }); } else if (identifier == SUSentUpdateAppcastItemData) { - if (self.statusInfo.installationInfoData == nil) { - SUAppcastItem *updateItem = (SUAppcastItem *)SUUnarchiveRootObjectSecurely(data, [SUAppcastItem class]); - if (updateItem != nil) { - SUInstallationInfo *installationInfo = [[SUInstallationInfo alloc] initWithAppcastItem:updateItem canSilentlyInstall:[self.installer canInstallSilently]]; - - self.statusInfo.installationInfoData = SUArchiveRootObjectSecurely(installationInfo); + SUAppcastItem *updateItem = (SUAppcastItem *)SUUnarchiveRootObjectSecurely(data, [SUAppcastItem class]); + if (updateItem != nil) { + SUInstallationInfo *installationInfo = [[SUInstallationInfo alloc] initWithAppcastItem:updateItem canSilentlyInstall:[self.installer canInstallSilently]]; + + NSData *archivedData = SUArchiveRootObjectSecurely(installationInfo); + if (archivedData != nil) { + [self.agentConnection.agent registerInstallationInfoData:archivedData]; } } } else if (identifier == SUResumeInstallationToStage2 && data.length == sizeof(uint8_t) * 2) { @@ -392,7 +443,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; dispatch_async(self.installerQueue, ^{ NSError *installerError = nil; - id installer = [SUInstaller installerForHost:self.host updateDirectory:self.installationData.updateDirectoryPath allowingInteraction:self.allowsInteraction versionComparator:[SUStandardVersionComparator standardVersionComparator] error:&installerError]; + id installer = [SUInstaller installerForHost:self.host expectedInstallationType:self.installationData.installationType updateDirectory:self.installationData.updateDirectoryPath allowingInteraction:self.allowsInteraction versionComparator:[SUStandardVersionComparator standardVersionComparator] error:&installerError]; if (installer == nil) { SULog(@"Error: Failed to create installer instance with error: %@", installerError); @@ -442,53 +493,8 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; return; } - SUAuthorizationEnvironment *environment = nil; - NSURL *tempIconDirectoryURL = nil; - if (self.shouldShowUI && self.allowsInteraction && [self.installer mayNeedToRequestAuthorization]) { - NSString *prompt = [NSString stringWithFormat:NSLocalizedString(@"%1$@ wants to update.", nil), self.host.name]; - - NSString *iconPath = nil; - - // Authorization API requires a 32x32 icon image and accepts png (but not icns or tiff) - NSImage *icon = [SUApplicationInfo bestIconForBundle:self.host.bundle]; - [icon setSize:NSMakeSize(32, 32)]; - - CGImageRef iconRef = [icon CGImageForProposedRect:NULL context:nil hints:nil]; - NSBitmapImageRep *representation = [[NSBitmapImageRep alloc] initWithCGImage:iconRef]; - NSData *pngData = [representation representationUsingType:NSPNGFileType properties:@{}]; - - // Write the icon to a temporary directory. This icon file should be in a directory that's readable to everyone. - NSError *tempError = nil; - tempIconDirectoryURL = [[SUFileManager defaultManager] makeTemporaryDirectoryWithPreferredName:@"sparkle-auth-icon" appropriateForDirectoryURL:[NSURL fileURLWithPath:NSTemporaryDirectory()] error:&tempError]; - if (tempIconDirectoryURL == nil) { - SULog(@"Failed to create temporary directory for authorization icon: %@", tempError); - } else { - NSURL *iconURL = [tempIconDirectoryURL URLByAppendingPathComponent:@"icon.png"]; - if ([pngData writeToURL:iconURL atomically:YES]) { - iconPath = iconURL.path; - } - } - - environment = [[SUAuthorizationEnvironment alloc] initWithPrompt:prompt iconPath:(iconPath != nil ? iconPath : @"")]; - - dispatch_async(dispatch_get_main_queue(), ^{ - // We should activate our app so that the auth prompt will be active - [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; - }); - } - - NSString *fileOperationToolPath = [[[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@""SPARKLE_FILEOP_TOOL_NAME]; - - if (![[NSFileManager defaultManager] fileExistsAtPath:fileOperationToolPath]) { - SULog(@"Potential Installation Error: File operation tool path %@ is not found", fileOperationToolPath); - } - NSError *secondStageError = nil; - BOOL performedSecondStage = [self.installer performSecondStageAllowingAuthorization:self.allowsInteraction fileOperationToolPath:fileOperationToolPath environment:environment allowingUI:self.shouldShowUI error:&secondStageError]; - - if (tempIconDirectoryURL != nil) { - [[SUFileManager defaultManager] removeItemAtURL:tempIconDirectoryURL error:NULL]; - } + BOOL performedSecondStage = [self.installer performSecondStageAllowingUI:self.shouldShowUI error:&secondStageError]; if (performedSecondStage) { self.performedStage2Installation = YES; @@ -504,25 +510,25 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; }); }; - // Let the other end know we cancelled so they can fail gracefully without disturbing the user - BOOL installationCancelled = (!performedSecondStage && secondStageError.code == SUInstallationCancelledError); - if (performedSecondStage || installationCancelled) { + // Let the other end know we canceled so they can fail gracefully without disturbing the user + BOOL installationCanceled = (!performedSecondStage && secondStageError.code == SUInstallationCanceledError); + if (performedSecondStage || installationCanceled) { dispatch_async(dispatch_get_main_queue(), ^{ - uint8_t cancelled = (uint8_t)installationCancelled; + uint8_t canceled = (uint8_t)installationCanceled; uint8_t targetTerminated = (uint8_t)self.terminationListener.terminated; - uint8_t sendInfo[] = {cancelled, targetTerminated}; + uint8_t sendInfo[] = {canceled, targetTerminated}; NSData *sendData = [NSData dataWithBytes:sendInfo length:sizeof(sendInfo)]; [self.communicator handleMessageWithIdentifier:SUInstallationFinishedStage2 data:sendData]; - if (installationCancelled) { + if (installationCanceled) { cleanupAndExit(); } }); } - if (!performedSecondStage && !installationCancelled) { + if (!performedSecondStage && !installationCanceled) { cleanupAndExit(); } } @@ -543,37 +549,17 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; [self.communicator handleMessageWithIdentifier:SUUpdaterAlivePing data:[NSData data]]; // Launch our installer progress UI tool if only after a certain amount of time passes - __block NSRunningApplication *installerProgressRunningApplication = nil; __block BOOL shouldLaunchInstallerProgress = YES; - - NSString *progressToolPath = self.installationData.progressToolPath; - if (progressToolPath != nil && self.shouldShowUI && ![self.installer displaysUserProgress]) { - NSURL *progressToolURL = [NSURL fileURLWithPath:progressToolPath]; - if (progressToolURL != nil) { - NSError *quarantineError = nil; - if (![[SUFileManager defaultManager] releaseItemFromQuarantineAtRootURL:progressToolURL error:&quarantineError]) { - SULog(@"Error: Failed releasing quarantine from installer progress tool: %@", quarantineError); + if (self.shouldShowUI && ![self.installer displaysUserProgress]) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(SUDisplayProgressTimeDelay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + // Make sure we're still eligible for showing the installer progress + // Also if the updater process is still alive, showing the progress should not be our duty + // if the communicator object is nil, the updater definitely isn't alive. However, if it is not nil, + // this does not necessarily mean the updater is alive, so we should also check if we got a recent response back from the updater + if (shouldLaunchInstallerProgress && (!self.receivedUpdaterPong || self.communicator == nil)) { + [self.agentConnection.agent showProgress]; } - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(SUDisplayProgressTimeDelay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - // Make sure we're still eligible for showing the installer progress - // Also if the updater process is still alive, showing the progress should not be our duty - // if the communicator object is nil, the updater definitely isn't alive. However, if it is not nil, - // this does not necessarily mean the updater is alive, so we should also check if we got a recent response back from the updater - if (shouldLaunchInstallerProgress && (!self.receivedUpdaterPong || self.communicator == nil)) { - NSError *launchError = nil; - - NSArray *arguments = @[self.host.bundlePath]; - NSRunningApplication *runningApplication = [[NSWorkspace sharedWorkspace] launchApplicationAtURL:progressToolURL options:(NSWorkspaceLaunchOptions)(NSWorkspaceLaunchDefault | NSWorkspaceLaunchNewInstance) configuration:@{NSWorkspaceLaunchConfigurationArguments : arguments} error:&launchError]; - - if (runningApplication == nil) { - SULog(@"Failed to launch installer progress tool with error: %@", launchError); - } else { - installerProgressRunningApplication = runningApplication; - } - } - }); - } + }); } dispatch_async(self.installerQueue, ^{ @@ -600,18 +586,14 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; self.performedStage3Installation = YES; dispatch_async(dispatch_get_main_queue(), ^{ - // Make sure to terminate our displayed progress before we move onto cleanup - [installerProgressRunningApplication terminate]; + // Make sure to terminate our displayed progress before we move onto cleanup & relaunch + // This will also stop the agent from broadcasting the status info service, which we want to do before + // we relaunch the app because the relaunched app could check the service upon launch.. + [self.agentConnection.agent stopProgress]; shouldLaunchInstallerProgress = NO; [self.communicator handleMessageWithIdentifier:SUInstallationFinishedStage3 data:[NSData data]]; - // Invalidate the status info listener before re-launching the updated app - // If we don't do this, the updated app could think the installation can be resumable, - // if it checks for updates immediately on launch - [self.statusInfo invalidate]; - self.statusInfo = nil; - NSString *installationPath = [SUInstaller installationPathForHost:self.host]; if (self.shouldRelaunch) { @@ -624,7 +606,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; pathToRelaunch = self.installationData.relaunchPath; } - [self relaunchAtPath:pathToRelaunch]; + [self.agentConnection.agent relaunchPath:pathToRelaunch]; } dispatch_async(self.installerQueue, ^{ @@ -649,8 +631,8 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; [self.xpcListener invalidate]; self.xpcListener = nil; - [self.statusInfo invalidate]; - self.statusInfo = nil; + [self.agentConnection invalidate]; + self.agentConnection = nil; NSError *theError = nil; if (![[NSFileManager defaultManager] removeItemAtPath:self.installationData.updateDirectoryPath error:&theError]) { @@ -662,12 +644,4 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; exit(status); } -- (void)relaunchAtPath:(NSString *)relaunchPath -{ - // Don't use -launchApplication: because we may not be launching an application. Eg: it could be a system prefpane - if (![[NSWorkspace sharedWorkspace] openFile:relaunchPath]) { - SULog(@"Failed to launch %@", relaunchPath); - } -} - @end diff --git a/Sparkle/SUBinaryDeltaApply.h b/Autoupdate/SUBinaryDeltaApply.h similarity index 100% rename from Sparkle/SUBinaryDeltaApply.h rename to Autoupdate/SUBinaryDeltaApply.h diff --git a/Sparkle/SUBinaryDeltaApply.m b/Autoupdate/SUBinaryDeltaApply.m similarity index 100% rename from Sparkle/SUBinaryDeltaApply.m rename to Autoupdate/SUBinaryDeltaApply.m diff --git a/Sparkle/SUBinaryDeltaCommon.h b/Autoupdate/SUBinaryDeltaCommon.h similarity index 100% rename from Sparkle/SUBinaryDeltaCommon.h rename to Autoupdate/SUBinaryDeltaCommon.h diff --git a/Sparkle/SUBinaryDeltaCommon.m b/Autoupdate/SUBinaryDeltaCommon.m similarity index 100% rename from Sparkle/SUBinaryDeltaCommon.m rename to Autoupdate/SUBinaryDeltaCommon.m diff --git a/Sparkle/SUBinaryDeltaCreate.h b/Autoupdate/SUBinaryDeltaCreate.h similarity index 100% rename from Sparkle/SUBinaryDeltaCreate.h rename to Autoupdate/SUBinaryDeltaCreate.h diff --git a/Sparkle/SUBinaryDeltaCreate.m b/Autoupdate/SUBinaryDeltaCreate.m similarity index 100% rename from Sparkle/SUBinaryDeltaCreate.m rename to Autoupdate/SUBinaryDeltaCreate.m diff --git a/Sparkle/SUBinaryDeltaTool.m b/Autoupdate/SUBinaryDeltaTool.m similarity index 100% rename from Sparkle/SUBinaryDeltaTool.m rename to Autoupdate/SUBinaryDeltaTool.m diff --git a/Sparkle/SUBinaryDeltaUnarchiver.h b/Autoupdate/SUBinaryDeltaUnarchiver.h similarity index 100% rename from Sparkle/SUBinaryDeltaUnarchiver.h rename to Autoupdate/SUBinaryDeltaUnarchiver.h diff --git a/Sparkle/SUBinaryDeltaUnarchiver.m b/Autoupdate/SUBinaryDeltaUnarchiver.m similarity index 100% rename from Sparkle/SUBinaryDeltaUnarchiver.m rename to Autoupdate/SUBinaryDeltaUnarchiver.m diff --git a/Sparkle/SUCodeSigningVerifier.h b/Autoupdate/SUCodeSigningVerifier.h similarity index 100% rename from Sparkle/SUCodeSigningVerifier.h rename to Autoupdate/SUCodeSigningVerifier.h diff --git a/Sparkle/SUCodeSigningVerifier.m b/Autoupdate/SUCodeSigningVerifier.m similarity index 100% rename from Sparkle/SUCodeSigningVerifier.m rename to Autoupdate/SUCodeSigningVerifier.m diff --git a/Sparkle/SUDSAVerifier.h b/Autoupdate/SUDSAVerifier.h similarity index 100% rename from Sparkle/SUDSAVerifier.h rename to Autoupdate/SUDSAVerifier.h diff --git a/Sparkle/SUDSAVerifier.m b/Autoupdate/SUDSAVerifier.m similarity index 100% rename from Sparkle/SUDSAVerifier.m rename to Autoupdate/SUDSAVerifier.m diff --git a/Sparkle/SUDiskImageUnarchiver.h b/Autoupdate/SUDiskImageUnarchiver.h similarity index 100% rename from Sparkle/SUDiskImageUnarchiver.h rename to Autoupdate/SUDiskImageUnarchiver.h diff --git a/Sparkle/SUDiskImageUnarchiver.m b/Autoupdate/SUDiskImageUnarchiver.m similarity index 100% rename from Sparkle/SUDiskImageUnarchiver.m rename to Autoupdate/SUDiskImageUnarchiver.m diff --git a/Sparkle/SUGuidedPackageInstaller.h b/Autoupdate/SUGuidedPackageInstaller.h similarity index 100% rename from Sparkle/SUGuidedPackageInstaller.h rename to Autoupdate/SUGuidedPackageInstaller.h diff --git a/Sparkle/SUGuidedPackageInstaller.m b/Autoupdate/SUGuidedPackageInstaller.m similarity index 55% rename from Sparkle/SUGuidedPackageInstaller.m rename to Autoupdate/SUGuidedPackageInstaller.m index f6644b17..cb9d73d7 100644 --- a/Sparkle/SUGuidedPackageInstaller.m +++ b/Autoupdate/SUGuidedPackageInstaller.m @@ -43,7 +43,7 @@ return YES; } -- (BOOL)performSecondStageAllowingAuthorization:(BOOL)allowsAuthorization fileOperationToolPath:(NSString *)fileOperationToolPath environment:(SUAuthorizationEnvironment * _Nullable)authorizationEnvironment allowingUI:(BOOL)allowsUI error:(NSError * __autoreleasing *)error +- (BOOL)performSecondStageAllowingUI:(BOOL)allowsUI error:(NSError * __autoreleasing *)error { if (!allowsUI && ![self canInstallSilently]) { if (error != NULL) { @@ -53,14 +53,39 @@ } // If we're root, we can allow using the authorization APIs - self.fileManager = (allowsAuthorization || [self isRootUser]) ? [SUFileManager fileManagerWithAuthorizationToolPath:fileOperationToolPath environment:authorizationEnvironment] : [SUFileManager defaultManager]; + self.fileManager = [SUFileManager defaultManager]; - return [self.fileManager grantAuthorizationPrivilegesWithError:error]; + return YES; } - (BOOL)performThirdStage:(NSError * __autoreleasing *)error { - return [self.fileManager executePackageAtURL:[NSURL fileURLWithPath:self.packagePath] error:error]; + // This command *must* be run as root + NSString *installerPath = @"/usr/sbin/installer"; + + NSTask *task = [[NSTask alloc] init]; + task.launchPath = installerPath; + task.arguments = @[@"-pkg", self.packagePath, @"-target", @"/"]; + task.standardError = [NSPipe pipe]; + task.standardOutput = [NSPipe pipe]; + + BOOL success = YES; + @try { + [task launch]; + [task waitUntilExit]; + if (task.terminationStatus != EXIT_SUCCESS) { + success = NO; + if (error != NULL) { + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Guided package installer returned non-zero exit status (%d)", task.terminationStatus] }]; + } + } + } @catch (NSException *) { + success = NO; + if (error != NULL) { + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Guided package installer task threw an exception"] }]; + } + } + return success; } - (BOOL)displaysUserProgress @@ -78,11 +103,6 @@ return [self isRootUser]; } -- (BOOL)mayNeedToRequestAuthorization -{ - return YES; -} - - (void)cleanup { } diff --git a/Sparkle/Autoupdate/SUInstallationInfo.h b/Autoupdate/SUInstallationInfo.h similarity index 100% rename from Sparkle/Autoupdate/SUInstallationInfo.h rename to Autoupdate/SUInstallationInfo.h diff --git a/Sparkle/Autoupdate/SUInstallationInfo.m b/Autoupdate/SUInstallationInfo.m similarity index 100% rename from Sparkle/Autoupdate/SUInstallationInfo.m rename to Autoupdate/SUInstallationInfo.m diff --git a/Sparkle/Autoupdate/SUInstallationInputData.h b/Autoupdate/SUInstallationInputData.h similarity index 69% rename from Sparkle/Autoupdate/SUInstallationInputData.h rename to Autoupdate/SUInstallationInputData.h index 48a9ad8f..d585ac72 100644 --- a/Sparkle/Autoupdate/SUInstallationInputData.h +++ b/Autoupdate/SUInstallationInputData.h @@ -14,20 +14,19 @@ NS_ASSUME_NONNULL_BEGIN /* * relaunchPath - path to application bundle to relaunch and listen for termination - * progressToolPath - path to optional GUI tool that shows update progress if installation is not quick * hostBundlePath - path to host bundle to update & replace * updateDirectoryPath - path to update directory (i.e, temporary directory containing the new update archive) * downloadName - name of update archive in update directory * dsaSignature - DSA signature for the update that came from the appcast item * decryptionPassword - optional decryption password for dmg archives */ -- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath progressToolPath:(nullable NSString *)progressToolPath hostBundlePath:(NSString *)hostBundlePath updateDirectoryPath:(NSString *)updateDirectoryPath downloadName:(NSString *)downloadName dsaSignature:(NSString *)dsaSignature decryptionPassword:(nullable NSString *)decryptionPassword; +- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateDirectoryPath:(NSString *)updateDirectoryPath downloadName:(NSString *)downloadName installationType:(NSString *)installationType dsaSignature:(NSString *)dsaSignature decryptionPassword:(nullable NSString *)decryptionPassword; @property (nonatomic, copy, readonly) NSString *relaunchPath; -@property (nonatomic, copy, readonly, nullable) NSString *progressToolPath; @property (nonatomic, copy, readonly) NSString *hostBundlePath; @property (nonatomic, copy, readonly) NSString *updateDirectoryPath; @property (nonatomic, copy, readonly) NSString *downloadName; +@property (nonatomic, copy, readonly) NSString *installationType; @property (nonatomic, copy, readonly) NSString *dsaSignature; @property (nonatomic, copy, readonly, nullable) NSString *decryptionPassword; diff --git a/Sparkle/Autoupdate/SUInstallationInputData.m b/Autoupdate/SUInstallationInputData.m similarity index 71% rename from Sparkle/Autoupdate/SUInstallationInputData.m rename to Autoupdate/SUInstallationInputData.m index 467049c5..4854677a 100644 --- a/Sparkle/Autoupdate/SUInstallationInputData.m +++ b/Autoupdate/SUInstallationInputData.m @@ -7,34 +7,42 @@ // #import "SUInstallationInputData.h" +#import "SUInstallationType.h" + +#ifdef _APPKITDEFINES_H +#error This is a "daemon-safe" class and should NOT import AppKit +#endif static NSString *SURelaunchPathKey = @"SURelaunchPath"; -static NSString *SUProgressToolPathKey = @"SUProgressToolPath"; static NSString *SUHostBundlePathKey = @"SUHostBundlePath"; static NSString *SUUpdateDirectoryPathKey = @"SUUpdateDirectoryPath"; static NSString *SUDownloadNameKey = @"SUDownloadName"; static NSString *SUDSASignatureKey = @"SUDSASignature"; static NSString *SUDecryptionPasswordKey = @"SUDecryptionPassword"; +static NSString *SUInstallationTypeKey = @"SUInstallationType"; @implementation SUInstallationInputData @synthesize relaunchPath = _relaunchPath; -@synthesize progressToolPath = _progressToolPath; @synthesize hostBundlePath = _hostBundlePath; @synthesize updateDirectoryPath = _updateDirectoryPath; @synthesize downloadName = _downloadName; @synthesize dsaSignature = _dsaSignature; @synthesize decryptionPassword = _decryptionPassword; +@synthesize installationType = _installationType; -- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath progressToolPath:(nullable NSString *)progressToolPath hostBundlePath:(NSString *)hostBundlePath updateDirectoryPath:(NSString *)updateDirectoryPath downloadName:(NSString *)downloadName dsaSignature:(NSString *)dsaSignature decryptionPassword:(nullable NSString *)decryptionPassword +- (instancetype)initWithRelaunchPath:(NSString *)relaunchPath hostBundlePath:(NSString *)hostBundlePath updateDirectoryPath:(NSString *)updateDirectoryPath downloadName:(NSString *)downloadName installationType:(NSString *)installationType dsaSignature:(NSString *)dsaSignature decryptionPassword:(nullable NSString *)decryptionPassword { self = [super init]; if (self != nil) { _relaunchPath = [relaunchPath copy]; - _progressToolPath = [progressToolPath copy]; _hostBundlePath = [hostBundlePath copy]; _updateDirectoryPath = [updateDirectoryPath copy]; _downloadName = [downloadName copy]; + + _installationType = [installationType copy]; + assert(SUValidInstallationType(_installationType)); + _dsaSignature = [dsaSignature copy]; _decryptionPassword = [decryptionPassword copy]; } @@ -48,8 +56,6 @@ static NSString *SUDecryptionPasswordKey = @"SUDecryptionPassword"; return nil; } - NSString *progressToolPath = [decoder decodeObjectOfClass:[NSString class] forKey:SUProgressToolPathKey]; - NSString *hostBundlePath = [decoder decodeObjectOfClass:[NSString class] forKey:SUHostBundlePathKey]; if (hostBundlePath == nil) { return nil; @@ -65,6 +71,11 @@ static NSString *SUDecryptionPasswordKey = @"SUDecryptionPassword"; return nil; } + NSString *installationType = [decoder decodeObjectOfClass:[NSString class] forKey:SUInstallationTypeKey]; + if (!SUValidInstallationType(installationType)) { + return nil; + } + NSString *dsaSignature = [decoder decodeObjectOfClass:[NSString class] forKey:SUDSASignatureKey]; if (dsaSignature == nil) { return nil; @@ -72,17 +83,15 @@ static NSString *SUDecryptionPasswordKey = @"SUDecryptionPassword"; NSString *decryptionPassword = [decoder decodeObjectOfClass:[NSString class] forKey:SUDecryptionPasswordKey]; - return [self initWithRelaunchPath:relaunchPath progressToolPath:progressToolPath hostBundlePath:hostBundlePath updateDirectoryPath:updateDirectoryPath downloadName:downloadName dsaSignature:dsaSignature decryptionPassword:decryptionPassword]; + return [self initWithRelaunchPath:relaunchPath hostBundlePath:hostBundlePath updateDirectoryPath:updateDirectoryPath downloadName:downloadName installationType:installationType dsaSignature:dsaSignature decryptionPassword:decryptionPassword]; } - (void)encodeWithCoder:(NSCoder *)coder { [coder encodeObject:self.relaunchPath forKey:SURelaunchPathKey]; - if (self.progressToolPath != nil) { - [coder encodeObject:self.progressToolPath forKey:SUProgressToolPathKey]; - } [coder encodeObject:self.hostBundlePath forKey:SUHostBundlePathKey]; [coder encodeObject:self.updateDirectoryPath forKey:SUUpdateDirectoryPathKey]; + [coder encodeObject:self.installationType forKey:SUInstallationTypeKey]; [coder encodeObject:self.downloadName forKey:SUDownloadNameKey]; [coder encodeObject:self.dsaSignature forKey:SUDSASignatureKey]; if (self.decryptionPassword != nil) { diff --git a/Sparkle/SUInstaller.h b/Autoupdate/SUInstaller.h similarity index 73% rename from Sparkle/SUInstaller.h rename to Autoupdate/SUInstaller.h index d6fc3b96..9f8952fc 100644 --- a/Sparkle/SUInstaller.h +++ b/Autoupdate/SUInstaller.h @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SUInstaller : NSObject -+ (nullable id)installerForHost:(SUHost *)host updateDirectory:(NSString *)updateDirectory allowingInteraction:(BOOL)allowsInteraction versionComparator:(id )comparator error:(NSError **)error; ++ (nullable id)installerForHost:(SUHost *)host expectedInstallationType:(NSString *)expectedInstallationType updateDirectory:(NSString *)updateDirectory allowingInteraction:(BOOL)allowsInteraction versionComparator:(id )comparator error:(NSError **)error; + (NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(nullable BOOL *)isGuidedPtr; diff --git a/Sparkle/SUInstaller.m b/Autoupdate/SUInstaller.m similarity index 67% rename from Sparkle/SUInstaller.m rename to Autoupdate/SUInstaller.m index 1e043c16..63604e33 100644 --- a/Sparkle/SUInstaller.m +++ b/Autoupdate/SUInstaller.m @@ -15,6 +15,7 @@ #import "SULog.h" #import "SUParameterAssert.h" #import "SUErrors.h" +#import "SUInstallationType.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -112,7 +113,7 @@ return newAppDownloadPath; } -+ (nullable id)installerForHost:(SUHost *)host updateDirectory:(NSString *)updateDirectory allowingInteraction:(BOOL)allowsInteraction versionComparator:(id )comparator error:(NSError * __autoreleasing *)error ++ (nullable id)installerForHost:(SUHost *)host expectedInstallationType:(NSString *)expectedInstallationType updateDirectory:(NSString *)updateDirectory allowingInteraction:(BOOL)allowsInteraction versionComparator:(id )comparator error:(NSError * __autoreleasing *)error { BOOL isPackage = NO; BOOL isGuided = NO; @@ -125,16 +126,43 @@ return nil; } - // If the installer does not allow interaction, we could be running as root - // If we are running as root, using a non-guided package installer does not work properly so avoid it at all costs + // Make sure we find the type of installer that we were expecting to find + // We shouldn't implicitly trust the installation type fed into here from the appcast because the installation type helps us determine + // ahead of time whether or not this installer tool should be ran as root or not id installer = nil; - if (isPackage && (isGuided || !allowsInteraction)) { - installer = [[SUGuidedPackageInstaller alloc] initWithPackagePath:newDownloadPath]; + if (isPackage && isGuided) { + if (![expectedInstallationType isEqualToString:SUInstallationTypeGuidedPackage]) { + if (error != NULL) { + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Found guided package installer but '%@=%@' was probably missing in the appcast item enclosure", SUAppcastAttributeInstallationType, SUInstallationTypeGuidedPackage] }]; + } + } else { + installer = [[SUGuidedPackageInstaller alloc] initWithPackagePath:newDownloadPath]; + } } else if (isPackage) { - installer = [[SUPackageInstaller alloc] initWithPackagePath:newDownloadPath]; + if (![expectedInstallationType isEqualToString:SUInstallationTypePackage]) { + if (error != NULL) { + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Found package installer but '%@=%@' was probably missing in the appcast item enclosure", SUAppcastAttributeInstallationType, SUInstallationTypePackage] }]; + } + } else { +#warning review this + // Even if we expect an ordinary package, if we don't allow interaction (eg: because we're already running root) - + // we should try a guided installation instead - because an ordinary package installation may not work well + if (allowsInteraction) { + installer = [[SUPackageInstaller alloc] initWithPackagePath:newDownloadPath]; + } else { + installer = [[SUGuidedPackageInstaller alloc] initWithPackagePath:newDownloadPath]; + } + } } else { - installer = [[SUPlainInstaller alloc] initWithHost:host applicationPath:newDownloadPath installationPath:[[self class] installationPathForHost:host] versionComparator:comparator]; + if (![expectedInstallationType isEqualToString:SUInstallationTypeApplication]) { + if (error != NULL) { + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Found regular application update but expected '%@=%@' from the appcast item enclosure instead", SUAppcastAttributeInstallationType, expectedInstallationType] }]; + } + } else { + installer = [[SUPlainInstaller alloc] initWithHost:host applicationPath:newDownloadPath installationPath:[[self class] installationPathForHost:host] versionComparator:comparator]; + } } + return installer; } diff --git a/Sparkle/Autoupdate/SUInstallerProtocol.h b/Autoupdate/SUInstallerProtocol.h similarity index 83% rename from Sparkle/Autoupdate/SUInstallerProtocol.h rename to Autoupdate/SUInstallerProtocol.h index bd418afc..9cd28e0e 100644 --- a/Sparkle/Autoupdate/SUInstallerProtocol.h +++ b/Autoupdate/SUInstallerProtocol.h @@ -8,8 +8,6 @@ #import -@class SUAuthorizationEnvironment; - NS_ASSUME_NONNULL_BEGIN @protocol SUInstallerProtocol @@ -25,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN // The allowsUI flag indicates whether this and the 3rd stage can show UI or not, possibly affecting whether or not this stage succeeds. // Eg: This may be appropriate for first showing an authorization prompt before the user application is terminated (if the operation succeeds) // Should be able to be called from non-main thread -- (BOOL)performSecondStageAllowingAuthorization:(BOOL)allowsAuthorization fileOperationToolPath:(NSString *)fileOperationToolPath environment:(SUAuthorizationEnvironment * _Nullable)authorizationEnvironment allowingUI:(BOOL)allowsUI error:(NSError **)error; +- (BOOL)performSecondStageAllowingUI:(BOOL)allowsUI error:(NSError **)error; // Stage 3 occurs after the user application has has been terminated. This is where the final installation work can be done. // After this stage is done, the user application will be relaunched. @@ -42,10 +40,6 @@ NS_ASSUME_NONNULL_BEGIN // Should be thread safe - (BOOL)canInstallSilently; -// Indicates whether or not this installer may need authorization when performing the second stage of the installation -// Should be thread safe -- (BOOL)mayNeedToRequestAuthorization; - // Cleans up work done from any of the previous stages. This should be invoked after stage 3 succeeds, // or after any one of the stages fails. // Should be able to be called from non-main thread diff --git a/Sparkle/Autoupdate/SUMessageTypes.h b/Autoupdate/SUMessageTypes.h similarity index 86% rename from Sparkle/Autoupdate/SUMessageTypes.h rename to Autoupdate/SUMessageTypes.h index 8a5e2392..f82217d0 100644 --- a/Sparkle/Autoupdate/SUMessageTypes.h +++ b/Autoupdate/SUMessageTypes.h @@ -43,4 +43,8 @@ NSString *SUInstallerServiceNameForBundleIdentifier(NSString *bundleIdentifier); NSString *SUStatusInfoServiceNameForBundleIdentifier(NSString *bundleIdentifier); +NSString *SUProgressAgentServiceNameForBundleIdentifier(NSString *bundleIdentifier); + +NSString *SUProgressAgentLauncherServiceNameForBundleIdentifier(NSString *bundleIdentifier); + NS_ASSUME_NONNULL_END diff --git a/Sparkle/Autoupdate/SUMessageTypes.m b/Autoupdate/SUMessageTypes.m similarity index 87% rename from Sparkle/Autoupdate/SUMessageTypes.m rename to Autoupdate/SUMessageTypes.m index 7abbf1d5..9fa5f91e 100644 --- a/Sparkle/Autoupdate/SUMessageTypes.m +++ b/Autoupdate/SUMessageTypes.m @@ -15,6 +15,8 @@ NSString *SUAppcastItemArchiveKey = @"SUAppcastItemArchive"; // These should be very short because length restrictions exist on earlier versions of macOS #define SPARKLE_INSTALLER_TAG @"-spki" #define SPARKLE_STATUS_TAG @"-spks" +#define SPARKLE_PROGRESS_TAG @"-spkp" +#define SPARKLE_PROGRESS_LAUNCH_INSTALLER_TAG @"-spkl" // macOS 10.8 at least can't handle service names that are 64 characters or longer // This was fixed some point after 10.8, but I'm not sure if it was fixed in 10.9 or 10.10 or 10.11 @@ -77,3 +79,13 @@ NSString *SUStatusInfoServiceNameForBundleIdentifier(NSString *bundleIdentifier) { return SUServiceNameWithTag(SPARKLE_STATUS_TAG, bundleIdentifier); } + +NSString *SUProgressAgentServiceNameForBundleIdentifier(NSString *bundleIdentifier) +{ + return SUServiceNameWithTag(SPARKLE_PROGRESS_TAG, bundleIdentifier); +} + +NSString *SUProgressAgentLauncherServiceNameForBundleIdentifier(NSString *bundleIdentifier) +{ + return SUServiceNameWithTag(SPARKLE_PROGRESS_LAUNCH_INSTALLER_TAG, bundleIdentifier); +} diff --git a/Sparkle/SUPackageInstaller.h b/Autoupdate/SUPackageInstaller.h similarity index 100% rename from Sparkle/SUPackageInstaller.h rename to Autoupdate/SUPackageInstaller.h diff --git a/Sparkle/SUPackageInstaller.m b/Autoupdate/SUPackageInstaller.m similarity index 87% rename from Sparkle/SUPackageInstaller.m rename to Autoupdate/SUPackageInstaller.m index 4177113d..147c7ff9 100644 --- a/Sparkle/SUPackageInstaller.m +++ b/Autoupdate/SUPackageInstaller.m @@ -47,7 +47,7 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open"; return YES; } -- (BOOL)performSecondStageAllowingAuthorization:(BOOL)__unused allowsAuthorization fileOperationToolPath:(NSString *)__unused fileOperationToolPath environment:(SUAuthorizationEnvironment * _Nullable)__unused authorizationEnvironment allowingUI:(BOOL)allowsUI error:(NSError * __autoreleasing *)error +- (BOOL)performSecondStageAllowingUI:(BOOL)allowsUI error:(NSError * __autoreleasing *)error { if (!allowsUI) { if (error != NULL) { @@ -91,11 +91,6 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open"; return NO; } -- (BOOL)mayNeedToRequestAuthorization -{ - return NO; -} - - (void)cleanup { } diff --git a/Sparkle/SUPipedUnarchiver.h b/Autoupdate/SUPipedUnarchiver.h similarity index 100% rename from Sparkle/SUPipedUnarchiver.h rename to Autoupdate/SUPipedUnarchiver.h diff --git a/Sparkle/SUPipedUnarchiver.m b/Autoupdate/SUPipedUnarchiver.m similarity index 100% rename from Sparkle/SUPipedUnarchiver.m rename to Autoupdate/SUPipedUnarchiver.m diff --git a/Sparkle/SUPlainInstaller.h b/Autoupdate/SUPlainInstaller.h similarity index 100% rename from Sparkle/SUPlainInstaller.h rename to Autoupdate/SUPlainInstaller.h diff --git a/Sparkle/SUPlainInstaller.m b/Autoupdate/SUPlainInstaller.m similarity index 87% rename from Sparkle/SUPlainInstaller.m rename to Autoupdate/SUPlainInstaller.m index cdca4669..0b53fd35 100644 --- a/Sparkle/SUPlainInstaller.m +++ b/Autoupdate/SUPlainInstaller.m @@ -227,22 +227,11 @@ return YES; } -- (BOOL)performSecondStageAllowingAuthorization:(BOOL)allowsAuthorization fileOperationToolPath:(NSString *)fileOperationToolPath environment:(SUAuthorizationEnvironment * _Nullable)authorizationEnvironment allowingUI:(BOOL)allowsUI error:(NSError * __autoreleasing *)error +- (BOOL)performSecondStageAllowingUI:(BOOL)allowsUI error:(NSError * __autoreleasing *)error { - self.fileManager = (allowsAuthorization && allowsUI) ? [SUFileManager fileManagerWithAuthorizationToolPath:fileOperationToolPath environment:authorizationEnvironment] : [SUFileManager defaultManager]; + self.fileManager = [SUFileManager defaultManager]; - // Bring up authorization prompt right away if we need it - BOOL canInstallSilently = [self canInstallSilently]; - if (allowsAuthorization && !canInstallSilently) { - return [self.fileManager grantAuthorizationPrivilegesWithError:error]; - } else { - if (!canInstallSilently) { - if (error != NULL) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUDowngradeError userInfo:@{ NSLocalizedDescriptionKey: @"Sparkle cannot install the update silently" }]; - } - } - return canInstallSilently; - } + return YES; } - (BOOL)performThirdStage:(NSError * __autoreleasing *)error @@ -259,21 +248,12 @@ - (BOOL)canInstallSilently { - return ![self mayNeedToRequestAuthorization]; -} - -- (BOOL)mayNeedToRequestAuthorization -{ - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSString *bundlePath = self.host.bundle.bundlePath; - // It's very well possible to have the bundle be writable but not be able to write into the parent directory - // And if the bundle isn't writable, but we can write into the parent directory, we will still need to authorize to replace it - return ![fileManager isWritableFileAtPath:bundlePath] || ![fileManager isWritableFileAtPath:[bundlePath stringByDeletingLastPathComponent]]; + return YES; } - (void)cleanup { - SUFileManager *fileManager = [self.fileManager fileManagerByPreservingAuthorizationRights];; + SUFileManager *fileManager = self.fileManager; NSURL *oldTempURL = self.oldTempURL; NSURL *tempOldDirectoryURL = self.tempOldDirectoryURL; NSURL *tempNewDirectoryURL = self.tempNewDirectoryURL; diff --git a/Sparkle/Autoupdate/SUStatusInfoProtocol.h b/Autoupdate/SUStatusInfoProtocol.h similarity index 100% rename from Sparkle/Autoupdate/SUStatusInfoProtocol.h rename to Autoupdate/SUStatusInfoProtocol.h diff --git a/Sparkle/SUUnarchiver.h b/Autoupdate/SUUnarchiver.h similarity index 100% rename from Sparkle/SUUnarchiver.h rename to Autoupdate/SUUnarchiver.h diff --git a/Sparkle/SUUnarchiver.m b/Autoupdate/SUUnarchiver.m similarity index 100% rename from Sparkle/SUUnarchiver.m rename to Autoupdate/SUUnarchiver.m diff --git a/Sparkle/SUUnarchiverProtocol.h b/Autoupdate/SUUnarchiverProtocol.h similarity index 100% rename from Sparkle/SUUnarchiverProtocol.h rename to Autoupdate/SUUnarchiverProtocol.h diff --git a/Sparkle/Autoupdate/StatusInfo.h b/Autoupdate/StatusInfo.h similarity index 100% rename from Sparkle/Autoupdate/StatusInfo.h rename to Autoupdate/StatusInfo.h diff --git a/Sparkle/Autoupdate/StatusInfo.m b/Autoupdate/StatusInfo.m similarity index 93% rename from Sparkle/Autoupdate/StatusInfo.m rename to Autoupdate/StatusInfo.m index 1f8d99b8..0062de9d 100644 --- a/Sparkle/Autoupdate/StatusInfo.m +++ b/Autoupdate/StatusInfo.m @@ -8,7 +8,10 @@ #import "StatusInfo.h" #import "SUMessageTypes.h" -#import "SULog.h" + +#ifdef _APPKITDEFINES_H +#error This is a "daemon-safe" class and should NOT import AppKit +#endif @interface StatusInfo () diff --git a/Sparkle/Autoupdate/TerminationListener.h b/Autoupdate/TerminationListener.h similarity index 100% rename from Sparkle/Autoupdate/TerminationListener.h rename to Autoupdate/TerminationListener.h diff --git a/Sparkle/Autoupdate/TerminationListener.m b/Autoupdate/TerminationListener.m similarity index 98% rename from Sparkle/Autoupdate/TerminationListener.m rename to Autoupdate/TerminationListener.m index ff24b274..07a5f57a 100644 --- a/Sparkle/Autoupdate/TerminationListener.m +++ b/Autoupdate/TerminationListener.m @@ -14,7 +14,7 @@ #include #ifdef _APPKITDEFINES_H -#error This is class should NOT import AppKit +#error This is a "daemon-safe" class and should NOT import AppKit #endif @interface TerminationListener () diff --git a/Sparkle/Autoupdate/Autoupdate.m b/Autoupdate/main.m similarity index 100% rename from Sparkle/Autoupdate/Autoupdate.m rename to Autoupdate/main.m diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index fc78b29e..b4448915 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -3,7 +3,6 @@ SPARKLE_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle SPARKLE_RELAUNCH_TOOL_NAME = Autoupdate SPARKLE_INSTALLER_PROGRESS_TOOL_NAME = Updater -SPARKLE_FILEOP_TOOL_NAME = fileop SPARKLE_APPEND_VERSION_NUMBER = 1 @@ -46,7 +45,7 @@ INSTALLER_LAUNCHER_BUNDLE_ID = org.sparkle-project.${INSTALLER_LAUNCHER_PRODUCT_ TEMPORARY_DOWNLOADER_BUNDLE_ID = org.sparkle-project.${TEMPORARY_DOWNLOADER_PRODUCT_NAME} PERSISTENT_DOWNLOADER_BUNDLE_ID = org.sparkle-project.${PERSISTENT_DOWNLOADER_PRODUCT_NAME} -GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_AUTOMATED_DOWNGRADES=$(SPARKLE_AUTOMATED_DOWNGRADES) SPARKLE_APPEND_VERSION_NUMBER=$(SPARKLE_APPEND_VERSION_NUMBER) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" CURRENT_PROJECT_VERSION=\"$(CURRENT_PROJECT_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_INSTALLER_PROGRESS_TOOL_NAME=\"$(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)\" SPARKLE_ICON_NAME=\"$(SPARKLE_ICON_NAME)\" INSTALLER_LAUNCHER_BUNDLE_ID=\"${INSTALLER_LAUNCHER_BUNDLE_ID}\" INSTALLER_CONNECTION_BUNDLE_ID=\"${INSTALLER_CONNECTION_BUNDLE_ID}\" INSTALLER_STATUS_BUNDLE_ID=\"${INSTALLER_STATUS_BUNDLE_ID}\" TEMPORARY_DOWNLOADER_BUNDLE_ID=\"${TEMPORARY_DOWNLOADER_BUNDLE_ID}\" PERSISTENT_DOWNLOADER_BUNDLE_ID=\"${PERSISTENT_DOWNLOADER_BUNDLE_ID}\" INSTALLER_LAUNCHER_PRODUCT_NAME=\"${INSTALLER_LAUNCHER_PRODUCT_NAME}\" INSTALLER_CONNECTION_PRODUCT_NAME=\"${INSTALLER_CONNECTION_PRODUCT_NAME}\" INSTALLER_STATUS_PRODUCT_NAME=\"${INSTALLER_STATUS_PRODUCT_NAME}\" TEMPORARY_DOWNLOADER_PRODUCT_NAME=\"${TEMPORARY_DOWNLOADER_PRODUCT_NAME}\" PERSISTENT_DOWNLOADER_PRODUCT_NAME=\"${PERSISTENT_DOWNLOADER_PRODUCT_NAME}\" SPARKLE_FILEOP_TOOL_NAME=\"$(SPARKLE_FILEOP_TOOL_NAME)\" +GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_AUTOMATED_DOWNGRADES=$(SPARKLE_AUTOMATED_DOWNGRADES) SPARKLE_APPEND_VERSION_NUMBER=$(SPARKLE_APPEND_VERSION_NUMBER) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" CURRENT_PROJECT_VERSION=\"$(CURRENT_PROJECT_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_INSTALLER_PROGRESS_TOOL_NAME=\"$(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)\" SPARKLE_ICON_NAME=\"$(SPARKLE_ICON_NAME)\" INSTALLER_LAUNCHER_BUNDLE_ID=\"${INSTALLER_LAUNCHER_BUNDLE_ID}\" INSTALLER_CONNECTION_BUNDLE_ID=\"${INSTALLER_CONNECTION_BUNDLE_ID}\" INSTALLER_STATUS_BUNDLE_ID=\"${INSTALLER_STATUS_BUNDLE_ID}\" TEMPORARY_DOWNLOADER_BUNDLE_ID=\"${TEMPORARY_DOWNLOADER_BUNDLE_ID}\" PERSISTENT_DOWNLOADER_BUNDLE_ID=\"${PERSISTENT_DOWNLOADER_BUNDLE_ID}\" INSTALLER_LAUNCHER_PRODUCT_NAME=\"${INSTALLER_LAUNCHER_PRODUCT_NAME}\" INSTALLER_CONNECTION_PRODUCT_NAME=\"${INSTALLER_CONNECTION_PRODUCT_NAME}\" INSTALLER_STATUS_PRODUCT_NAME=\"${INSTALLER_STATUS_PRODUCT_NAME}\" TEMPORARY_DOWNLOADER_PRODUCT_NAME=\"${TEMPORARY_DOWNLOADER_PRODUCT_NAME}\" PERSISTENT_DOWNLOADER_PRODUCT_NAME=\"${PERSISTENT_DOWNLOADER_PRODUCT_NAME}\" CLANG_ENABLE_OBJC_ARC = YES GCC_ENABLE_PASCAL_STRINGS = NO diff --git a/Configurations/ConfigFileop.xcconfig b/Configurations/ConfigFileop.xcconfig deleted file mode 100644 index 33efd218..00000000 --- a/Configurations/ConfigFileop.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -// Fileop tool only - -PRODUCT_NAME = $(SPARKLE_FILEOP_TOOL_NAME) -SKIP_INSTALL = YES -CLANG_ENABLE_MODULES = NO diff --git a/Configurations/ConfigRelaunch.xcconfig b/Configurations/ConfigRelaunch.xcconfig index 412771c6..b2de1b6c 100644 --- a/Configurations/ConfigRelaunch.xcconfig +++ b/Configurations/ConfigRelaunch.xcconfig @@ -1,6 +1,5 @@ // Relaunch Tool only -INFOPLIST_FILE = Sparkle/Autoupdate/Autoupdate-Info.plist PRODUCT_NAME = $(SPARKLE_RELAUNCH_TOOL_NAME) SKIP_INSTALL = YES CLANG_ENABLE_MODULES = NO diff --git a/InstallerConnection/SUInstallerConnection.m b/InstallerConnection/SUInstallerConnection.m index 9db088a5..b4f26932 100644 --- a/InstallerConnection/SUInstallerConnection.m +++ b/InstallerConnection/SUInstallerConnection.m @@ -58,9 +58,9 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K [self enableAutomaticTermination]; } -- (void)setServiceName:(NSString *)serviceName +- (void)setServiceName:(NSString *)serviceName hostPath:(NSString *)hostPath installationType:(NSString *)installationType { - NSXPCConnectionOptions options = SUGrantsSystemAuthorizationAccess() ? NSXPCConnectionPrivileged : 0; + NSXPCConnectionOptions options = SUNeedsSystemAuthorizationAccess(hostPath, installationType, NULL) ? NSXPCConnectionPrivileged : 0; NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:options]; connection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerCommunicationProtocol)]; @@ -72,7 +72,7 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K __weak SUInstallerConnection *weakSelf = self; self.connection.interruptionHandler = ^{ - [weakSelf invalidate]; + [weakSelf.connection invalidate]; }; self.connection.invalidationHandler = ^{ diff --git a/InstallerConnection/SUInstallerConnectionProtocol.h b/InstallerConnection/SUInstallerConnectionProtocol.h index 4669f37b..61bb80de 100644 --- a/InstallerConnection/SUInstallerConnectionProtocol.h +++ b/InstallerConnection/SUInstallerConnectionProtocol.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)setInvalidationHandler:(void (^)(void))invalidationHandler; -- (void)setServiceName:(NSString *)serviceName; +- (void)setServiceName:(NSString *)serviceName hostPath:(NSString *)hostPath installationType:(NSString *)installationType; - (void)invalidate; diff --git a/InstallerConnection/SUXPCInstallerConnection.m b/InstallerConnection/SUXPCInstallerConnection.m index af28c0d3..ae04b223 100644 --- a/InstallerConnection/SUXPCInstallerConnection.m +++ b/InstallerConnection/SUXPCInstallerConnection.m @@ -59,9 +59,9 @@ }]; } -- (void)setServiceName:(NSString *)serviceName +- (void)setServiceName:(NSString *)serviceName hostPath:(NSString *)hostPath installationType:(NSString *)installationType { - [self.connection.remoteObjectProxy setServiceName:serviceName]; + [self.connection.remoteObjectProxy setServiceName:serviceName hostPath:hostPath installationType:installationType]; } - (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data diff --git a/InstallerLauncher/SUAuthorizationReply.h b/InstallerLauncher/SUAuthorizationReply.h new file mode 100644 index 00000000..cba296b2 --- /dev/null +++ b/InstallerLauncher/SUAuthorizationReply.h @@ -0,0 +1,17 @@ +// +// SUAuthorizationReply.h +// Sparkle +// +// Created by Mayur Pawashe on 7/18/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import + +typedef NS_ENUM(NSUInteger, SUAuthorizationReply) +{ + SUAuthorizationReplySuccess = 0, + SUAuthorizationReplyCanceled = 1, + SUAuthorizationReplyFailure = 2, + SUAuthorizationReplyAuthorizeLater = 3 +}; diff --git a/InstallerLauncher/SUInstallerLauncher.m b/InstallerLauncher/SUInstallerLauncher.m index 5d6e0aba..b04e0aa6 100644 --- a/InstallerLauncher/SUInstallerLauncher.m +++ b/InstallerLauncher/SUInstallerLauncher.m @@ -10,76 +10,293 @@ #import "SUFileManager.h" #import "SULog.h" #import "SUMessageTypes.h" -#import #import "SUSystemAuthorization.h" +#import "SUBundleIcon.h" + +#ifdef _APPKITDEFINES_H +#error This is a "core" class and should NOT import AppKit +#endif @implementation SUInstallerLauncher -- (void)launchInstallerAtPath:(NSString *)installerPath withHostBundleIdentifier:(NSString *)hostBundleIdentifier allowingInteraction:(BOOL)allowingInteraction completion:(void (^)(BOOL success))completionHandler +- (BOOL)submitProgressToolAtPath:(NSString *)progressToolPath withHostBundle:(NSBundle *)hostBundle inSystemDomainForInstaller:(BOOL)inSystemDomainForInstaller +{ + SUFileManager *fileManager = [SUFileManager defaultManager]; + + NSURL *progressToolURL = [NSURL fileURLWithPath:progressToolPath]; + + NSError *quarantineError = nil; + if (![fileManager releaseItemFromQuarantineAtRootURL:progressToolURL error:&quarantineError]) { + // This may or may not be a fatal error depending on if the process is sandboxed or not + SULog(@"Failed to release quarantine on installer at %@ with error %@", progressToolPath, quarantineError); + } + + NSString *executablePath = [[NSBundle bundleWithURL:progressToolURL] executablePath]; + assert(executablePath != nil); + + NSString *hostBundlePath = hostBundle.bundlePath; + assert(hostBundlePath != nil); + + NSString *hostBundleIdentifier = hostBundle.bundleIdentifier; + assert(hostBundleIdentifier != nil); + + NSArray *arguments = @[executablePath, hostBundlePath, @(inSystemDomainForInstaller).stringValue]; + +#warning support running under system domain if updater is running as root - this means we would have to try running job under a different user + CFStringRef domain = kSMDomainUserLaunchd; + NSString *label = [NSString stringWithFormat:@"%@-sparkle-progress", hostBundleIdentifier]; + + AuthorizationRef auth = NULL; + Boolean submittedJob = false; + OSStatus createStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth); + if (createStatus == errAuthorizationSuccess) { + // Try to remove the job from launchd if it is already running + // 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; + if (!SMJobRemove(domain, (__bridge CFStringRef)(label), auth, true, &removeError)) { + if (removeError != NULL) { + // It's normal for a job to not be found, so this is not an interesting error + if (CFErrorGetCode(removeError) != kSMErrorJobNotFound) { + SULog(@"Remove error: %@", removeError); + } + CFRelease(removeError); + } + } + + NSMutableDictionary *jobDictionary = [[NSMutableDictionary alloc] init]; + jobDictionary[@"Label"] = label; + jobDictionary[@"ProgramArguments"] = arguments; + jobDictionary[@"EnableTransactions"] = @NO; + jobDictionary[@"KeepAlive"] = @{@"SuccessfulExit" : @NO}; + jobDictionary[@"RunAtLoad"] = @NO; + jobDictionary[@"NICE"] = @0; + jobDictionary[@"LaunchOnlyOnce"] = @YES; + jobDictionary[@"MachServices"] = @{SUStatusInfoServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES}; + + CFErrorRef submitError = NULL; + submittedJob = SMJobSubmit(domain, (__bridge CFDictionaryRef)(jobDictionary), auth, &submitError); + if (!submittedJob) { + if (submitError != NULL) { + SULog(@"Submit progress error: %@", submitError); + CFRelease(submitError); + } + } + + AuthorizationFree(auth, kAuthorizationFlagDefaults); + } + + return (submittedJob == true); +} + +- (SUAuthorizationReply)submitInstallerAtPath:(NSString *)installerPath withHostBundle:(NSBundle *)hostBundle authorizationPrompt:(NSString *)authorizationPrompt allowingInteraction:(BOOL)allowingInteraction inSystemDomain:(BOOL)systemDomain +{ + SUFileManager *fileManager = [SUFileManager defaultManager]; + + NSURL *installerURL = [NSURL fileURLWithPath:installerPath]; + + NSError *quarantineError = nil; + if (![fileManager releaseItemFromQuarantineAtRootURL:installerURL error:&quarantineError]) { + // Probably not a fatal error because we are submitting the executable through launchd + SULog(@"Failed to release quarantine on installer at %@ with error %@", installerPath, quarantineError); + } + + NSString *hostBundleIdentifier = hostBundle.bundleIdentifier; + assert(hostBundleIdentifier != nil); + + NSArray *arguments = @[installerPath, hostBundleIdentifier, @(allowingInteraction).stringValue]; + + AuthorizationRef auth = NULL; + OSStatus createStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth); + if (createStatus != errAuthorizationSuccess) { + auth = NULL; + SULog(@"Failed to create authorization reference: %d", createStatus); + } + + BOOL canceledAuthorization = NO; + BOOL failedToUseSystemDomain = NO; + if (auth != NULL && systemDomain) { + // See Apple's 'EvenBetterAuthorizationSample' sample code and + // https://developer.apple.com/library/mac/technotes/tn2095/_index.html#//apple_ref/doc/uid/DTS10003110-CH1-SECTION7 + // We can set a custom right name for authenticating as an administrator + // Using this right rather than using something like kSMRightModifySystemDaemons allows us to present a better worded prompt + + const char *rightName = [[NSString stringWithFormat:@"%@.sparkle-auth", hostBundleIdentifier] UTF8String]; + assert(rightName != NULL); + + OSStatus getRightResult = AuthorizationRightGet(rightName, NULL); + if (getRightResult == errAuthorizationDenied) { + if (AuthorizationRightSet(auth, rightName, (__bridge CFTypeRef _Nonnull)(@(kAuthorizationRuleAuthenticateAsAdmin)), (__bridge CFStringRef _Nullable)(authorizationPrompt), NULL, NULL) != errAuthorizationSuccess) { + SULog(@"Failed to make auth right set"); + } + } + + AuthorizationItem right = { .name = rightName, .valueLength = 0, .value = NULL, .flags = 0 }; + AuthorizationRights rights = { .count = 1, .items = &right }; + + AuthorizationFlags flags = (AuthorizationFlags)(kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed); + + AuthorizationItem iconAuthorizationItem = {.name = kAuthorizationEnvironmentIcon, .valueLength = 0, .value = NULL, .flags = 0}; + AuthorizationEnvironment authorizationEnvironment = {.count = 0, .items = NULL}; + + // Find a 32x32 image representation of the icon, and write out a PNG version of it to a temporary location + // Then use the icon (if one is available) for the authorization prompt + // NSImage is not used because it relies on AppKit + NSURL *tempIconDestinationURL = nil; + NSURL *iconURL = [SUBundleIcon iconURLForBundle:hostBundle]; + if (iconURL != nil) { + CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef)iconURL, (CFDictionaryRef)@{}); + if (imageSource != NULL) { + size_t imageCount = CGImageSourceGetCount(imageSource); + for (size_t imageIndex = 0; imageIndex < imageCount; imageIndex++) { + CFDictionaryRef cfProperties = CGImageSourceCopyPropertiesAtIndex(imageSource, imageIndex, (CFDictionaryRef)@{}); + NSDictionary *properties = (__bridge NSDictionary *)(cfProperties); + + NSNumber *pixelWidth = properties[(const NSString *)kCGImagePropertyPixelWidth]; + NSNumber *pixelHeight = properties[(const NSString *)kCGImagePropertyPixelHeight]; + + // If we don't find a 32x32 image representation, then we don't provide an icon + // Don't try to make up with it by eg: converting an image representation to this size + // The app developer should be providing the icon representation. + // The authorization API may not take other size dimensions. + NSNumber *targetDimension = @32; + if ([pixelWidth isKindOfClass:[NSNumber class]] && [pixelHeight isKindOfClass:[NSNumber class]] && [pixelWidth isEqualToNumber:targetDimension] && [pixelHeight isEqualToNumber:targetDimension]) { + + // Use /tmp rather than NSTemporaryDirectory() or SUFileManager's temp directory function because we want: + // a) no spaces in the path (SU/NSFileManager fails here) + // b) short file path that does not exceed a small threshold (NSTemporaryDirectory() fails here) + // These limitations only apply to older systems (eg: macOS 10.8) + // The file also needs to be placed in a system readable place such as /tmp + // See https://github.com/sparkle-project/Sparkle/issues/347#issuecomment-149523848 for more info + char pathBuffer[] = "/tmp/XXXXXX.png"; + int tempIconFile = mkstemps(pathBuffer, strlen(".png")); + if (tempIconFile == -1) { + SULog(@"Failed to open temp icon from path buffer with error: %d", errno); + } else { + close(tempIconFile); + + NSString *path = [[NSString alloc] initWithUTF8String:pathBuffer]; + tempIconDestinationURL = [NSURL fileURLWithPath:path]; + + CGImageDestinationRef imageDestination = CGImageDestinationCreateWithURL((CFURLRef)tempIconDestinationURL, kUTTypePNG, 1, NULL); + if (imageDestination != NULL) { + CGImageDestinationAddImageFromSource(imageDestination, imageSource, imageIndex, (CFDictionaryRef)@{}); + if (CGImageDestinationFinalize(imageDestination)) { + iconAuthorizationItem.valueLength = strlen(pathBuffer); + iconAuthorizationItem.value = pathBuffer; + + authorizationEnvironment.count = 1; + authorizationEnvironment.items = &iconAuthorizationItem; + } + + CFRelease(imageDestination); + } + } + + break; + } + } + + CFRelease(imageSource); + } + } + + // This should prompt up the authorization dialog if necessary + OSStatus copyStatus = AuthorizationCopyRights(auth, &rights, &authorizationEnvironment, flags, NULL); + if (copyStatus != errAuthorizationSuccess) { + failedToUseSystemDomain = YES; + + if (copyStatus == errAuthorizationCanceled) { + canceledAuthorization = YES; + } else { + SULog(@"Failed copying system domain rights: %d", copyStatus); + } + } + + if (tempIconDestinationURL != nil) { + [fileManager removeItemAtURL:tempIconDestinationURL error:NULL]; + } + } + + Boolean submittedJob = false; + if (!canceledAuthorization && !failedToUseSystemDomain && auth != NULL) { + CFStringRef domain = (systemDomain ? kSMDomainSystemLaunchd : kSMDomainUserLaunchd); + NSString *label = [NSString stringWithFormat:@"%@-sparkle-updater", hostBundleIdentifier]; + + // Try to remove the job from launchd if it is already running + // 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; + if (!SMJobRemove(domain, (__bridge CFStringRef)(label), auth, true, &removeError)) { + if (removeError != NULL) { + // It's normal for a job to not be found, so this is not an interesting error + if (CFErrorGetCode(removeError) != kSMErrorJobNotFound) { + SULog(@"Remove job error: %@", removeError); + } + CFRelease(removeError); + } + } + + NSDictionary *jobDictionary = @{@"Label" : label, @"ProgramArguments" : arguments, @"EnableTransactions" : @NO, @"KeepAlive" : @{@"SuccessfulExit" : @NO}, @"RunAtLoad" : @NO, @"NICE" : @0, @"LaunchOnlyOnce": @YES, @"MachServices" : @{SUInstallerServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES, SUProgressAgentServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES}}; + + CFErrorRef submitError = NULL; + submittedJob = SMJobSubmit(domain, (__bridge CFDictionaryRef)(jobDictionary), auth, &submitError); + if (!submittedJob) { + if (submitError != NULL) { + SULog(@"Submit error: %@", submitError); + CFRelease(submitError); + } + } + } + + if (auth != NULL) { + AuthorizationFree(auth, kAuthorizationFlagDefaults); + } + + SUAuthorizationReply reply; + if (submittedJob == true) { + reply = SUAuthorizationReplySuccess; + } else if (canceledAuthorization) { + reply = SUAuthorizationReplyCanceled; + } else { + reply = SUAuthorizationReplyFailure; + } + return reply; +} + +- (void)launchInstallerAtPath:(NSString *)installerPath progressToolPath:(NSString *)progressToolPath withHostBundlePath:(NSString *)hostBundlePath authorizationPrompt:(NSString *)authorizationPrompt installationType:(NSString *)installationType allowingInteraction:(BOOL)allowingInteraction completion:(void (^)(SUAuthorizationReply))completionHandler { dispatch_async(dispatch_get_main_queue(), ^{ - SUFileManager *fileManager = [SUFileManager defaultManager]; + NSBundle *hostBundle = [NSBundle bundleWithPath:hostBundlePath]; - NSURL *installerURL = [NSURL fileURLWithPath:installerPath]; + BOOL preflighted = NO; + BOOL needsSystemAuthorization = SUNeedsSystemAuthorizationAccess(hostBundlePath, installationType, &preflighted); - NSError *quarantineError = nil; - if (![fileManager releaseItemFromQuarantineAtRootURL:installerURL error:&quarantineError]) { - // This may or may not be a fatal error depending on if the process is sandboxed or not - SULog(@"Failed to release quarantine on installer at %@ with error %@", installerPath, quarantineError); - } - - NSString *executablePath = [[[installerPath stringByAppendingPathComponent:@"Contents"] stringByAppendingPathComponent:@"MacOS"] stringByAppendingPathComponent:@SPARKLE_RELAUNCH_TOOL_NAME]; - - NSError *ownershipError = nil; - if (![fileManager changeOwnerAndGroupOfItemAtRootURL:[NSURL fileURLWithPath:executablePath] toMatchURL:installerURL error:&ownershipError]) { - // This may or may not be a fatal error - SULog(@"Failed to change ownership on installer executable at %@ with error %@", executablePath, ownershipError); - } - - NSArray *arguments = @[executablePath, hostBundleIdentifier, @(allowingInteraction).stringValue]; - - // If the updater is running as the logged in user, we submit a job under the user domain - // However if the updater is running as root (which is experimental), we submit the job under the system domain - // We don't yet handle the updater running as the logged in user, and submitting a job under the system domain, which - // would remove the need for using AuthorizationExecuteWithPrivileges() in the installer. That would require knowing before hand - // if we will need to request authorization privileges, and that would prevent this code from being invoked silently/automatically. - // Additionally, we would want to remove AppKit references in the installer - BOOL grantsSystemPrivilege = NO; - AuthorizationRef auth = SUCreateAuthorization(&grantsSystemPrivilege); - Boolean submittedJob = false; - if (auth != NULL) { - CFStringRef domain = (grantsSystemPrivilege ? kSMDomainSystemLaunchd : kSMDomainUserLaunchd); - NSString *label = [NSString stringWithFormat:@"%@-sparkle-updater", hostBundleIdentifier]; + // if we need to use the system domain and we aren't already root and we aren't allowed interaction, then try sometime later when interaction is allowed + if (needsSystemAuthorization && !preflighted && !allowingInteraction) { + completionHandler(SUAuthorizationReplyAuthorizeLater); + } else { + SUAuthorizationReply installerReply = [self submitInstallerAtPath:installerPath withHostBundle:hostBundle authorizationPrompt:authorizationPrompt allowingInteraction:allowingInteraction inSystemDomain:needsSystemAuthorization]; - // Try to remove the job from launchd if it is already running - // 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; - if (!SMJobRemove(domain, (__bridge CFStringRef)(label), auth, true, &removeError)) { - if (removeError != NULL) { - // It's normal for a job to not be found, so this is not an interesting error - if (CFErrorGetCode(removeError) != kSMErrorJobNotFound) { - SULog(@"Remove error: %@", removeError); - } - CFRelease(removeError); + if (installerReply == SUAuthorizationReplyFailure) { + SULog(@"Failed to submit installer job"); + } + + BOOL submittedProgressTool = NO; + if (installerReply == SUAuthorizationReplySuccess) { + submittedProgressTool = [self submitProgressToolAtPath:progressToolPath withHostBundle:hostBundle inSystemDomainForInstaller:needsSystemAuthorization]; + + if (!submittedProgressTool) { + SULog(@"Failed to submit progress tool job"); } } - NSDictionary *jobDictionary = @{@"Label" : label, @"ProgramArguments" : arguments, @"EnableTransactions" : @NO, @"KeepAlive" : @{@"SuccessfulExit" : @NO}, @"RunAtLoad" : @NO, @"NICE" : @0, @"LaunchOnlyOnce": @YES, @"MachServices" : @{SUInstallerServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES, SUStatusInfoServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES}}; - - CFErrorRef submitError = NULL; - submittedJob = SMJobSubmit(domain, (__bridge CFDictionaryRef)(jobDictionary), auth, &submitError); - if (!submittedJob) { - if (submitError != NULL) { - SULog(@"Submit error: %@", submitError); - CFRelease(submitError); - } + if (installerReply == SUAuthorizationReplyCanceled) { + completionHandler(installerReply); + } else { + completionHandler(submittedProgressTool ? SUAuthorizationReplySuccess : SUAuthorizationReplyFailure); } - - AuthorizationFree(auth, kAuthorizationFlagDefaults); } - - completionHandler(submittedJob == true); }); } diff --git a/InstallerLauncher/SUInstallerLauncherProtocol.h b/InstallerLauncher/SUInstallerLauncherProtocol.h index 76054683..5fd9fa3c 100644 --- a/InstallerLauncher/SUInstallerLauncherProtocol.h +++ b/InstallerLauncher/SUInstallerLauncherProtocol.h @@ -7,9 +7,10 @@ // #import +#import "SUAuthorizationReply.h" @protocol SUInstallerLauncherProtocol -- (void)launchInstallerAtPath:(NSString *)installerPath withHostBundleIdentifier:(NSString *)hostBundleIdentifier allowingInteraction:(BOOL)allowingInteraction completion:(void (^)(BOOL success))completionHandler; +- (void)launchInstallerAtPath:(NSString *)installerPath progressToolPath:(NSString *)progressToolPath withHostBundlePath:(NSString *)hostBundlePath authorizationPrompt:(NSString *)authorizationPrompt installationType:(NSString *)installationType allowingInteraction:(BOOL)allowingInteraction completion:(void (^)(SUAuthorizationReply))completionHandler; @end diff --git a/InstallerStatus/SUInstallerStatus.m b/InstallerStatus/SUInstallerStatus.m index 834834fb..49041d72 100644 --- a/InstallerStatus/SUInstallerStatus.m +++ b/InstallerStatus/SUInstallerStatus.m @@ -28,8 +28,7 @@ - (void)setServiceName:(NSString *)serviceName { - NSXPCConnectionOptions options = SUGrantsSystemAuthorizationAccess() ? NSXPCConnectionPrivileged : 0; - NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:options]; + NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:(NSXPCConnectionOptions)0]; connection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUStatusInfoProtocol)]; @@ -37,7 +36,7 @@ __weak SUInstallerStatus *weakSelf = self; self.connection.interruptionHandler = ^{ - [weakSelf invalidate]; + [weakSelf.connection invalidate]; }; self.connection.invalidationHandler = ^{ diff --git a/InstallerStatus/SUInstallerStatusProtocol.h b/InstallerStatus/SUInstallerStatusProtocol.h index 32aef2a6..bc7c2d88 100644 --- a/InstallerStatus/SUInstallerStatusProtocol.h +++ b/InstallerStatus/SUInstallerStatusProtocol.h @@ -14,8 +14,10 @@ NS_ASSUME_NONNULL_BEGIN // The protocol that this service will vend as its API. This header file will also need to be visible to the process hosting the service. @protocol SUInstallerStatusProtocol -// Include SUStatusInfoProtocol protocol methods because XPC on 10.8 won't know about them +// Even though this is declared in SUStatusInfoProtocol, we should declare it here because macOS 10.8 doesn't traverse adopted protocols - (void)probeStatusInfoWithReply:(void (^)(NSData * _Nullable installationInfoData))reply; + +// Even though this is declared in SUStatusInfoProtocol, we should declare it here because macOS 10.8 doesn't traverse adopted protocols - (void)probeStatusConnectivityWithReply:(void (^)(void))reply; - (void)setInvalidationHandler:(void (^)(void))invalidationHandler; diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 03015769..4a8843ef 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -17,7 +17,6 @@ 14950066195FB8A600BC5B5B /* PBXTargetDependency */, 14950068195FB8A600BC5B5B /* PBXTargetDependency */, 1495006A195FB8A600BC5B5B /* PBXTargetDependency */, - 1495006C195FB8A600BC5B5B /* PBXTargetDependency */, ); name = All; productName = All; @@ -26,13 +25,9 @@ /* Begin PBXBuildFile section */ 1420DF50196247F900203BB0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1420DF4F196247F900203BB0 /* Images.xcassets */; }; - 1420DF51196247F900203BB0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1420DF4F196247F900203BB0 /* Images.xcassets */; }; 142E0E0019A6954400E4312B /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 142E0E0219A6A14700E4312B /* Sparkle.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 142E0E0419A6A26F00E4312B /* Autoupdate.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 55C14BB7136EEF1500649790 /* Autoupdate.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 142E0E0919A83AAC00E4312B /* SUBinaryDeltaTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 142E0E0819A83AAC00E4312B /* SUBinaryDeltaTest.m */; }; - 14652F7C19A9725300959E44 /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E20FD68CC7005AE3F6 /* SUBinaryDeltaCommon.m */; }; - 14652F7D19A9726700959E44 /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E00FD68CC7005AE3F6 /* SUBinaryDeltaApply.m */; }; 14652F7E19A9728A00959E44 /* bspatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8DC0FD68CB9005AE3F6 /* bspatch.c */; }; 14652F8019A9740F00959E44 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; }; 14652F8219A9746000959E44 /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; }; @@ -43,28 +38,17 @@ 14732BD319610A1800593899 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 14732BD219610A1800593899 /* XCTest.framework */; }; 1495006E195FCE1100BC5B5B /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; 1495006F195FCE1800BC5B5B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; - 14950070195FCE3A00BC5B5B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; - 14950071195FCE3D00BC5B5B /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; 14950072195FCE4B00BC5B5B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; 14950073195FCE4E00BC5B5B /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; 14958C6E19AEBC950061B14F /* signed-test-file.txt in Resources */ = {isa = PBXBuildFile; fileRef = 14958C6B19AEBC530061B14F /* signed-test-file.txt */; }; 14958C6F19AEBC980061B14F /* test-pubkey.pem in Resources */ = {isa = PBXBuildFile; fileRef = 14958C6C19AEBC610061B14F /* test-pubkey.pem */; }; 3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 3772FEA813DE0B6B00F79537 /* SUVersionDisplayProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 55C14BD4136EEFCE00649790 /* Autoupdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14BD3136EEFCE00649790 /* Autoupdate.m */; }; 55C14BEF136EF21700649790 /* SUStatus.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55C14BD8136EF00C00649790 /* SUStatus.xib */; }; 55C14C04136EF26100649790 /* SUUpdateAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55C14BF0136EF26100649790 /* SUUpdateAlert.xib */; }; 55C14C19136EF2C700649790 /* SUUpdatePermissionPrompt.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55C14C05136EF2C700649790 /* SUUpdatePermissionPrompt.xib */; }; - 55C14F00136EF6B700649790 /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; 55C14F06136EF6DB00649790 /* SULog.h in Headers */ = {isa = PBXBuildFile; fileRef = 55C14F04136EF6DB00649790 /* SULog.h */; }; 55C14F07136EF6DB00649790 /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; }; - 55C14F08136EF6DB00649790 /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; }; - 55C14F0C136EF6EA00649790 /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; }; - 55C14F0D136EF6F200649790 /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; }; - 55C14F21136EF84D00649790 /* SUPlainInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5040DAE8AB80026945C /* SUPlainInstaller.m */; }; - 55C14F22136EF86000649790 /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; }; - 55C14F24136EF86F00649790 /* SUPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */; }; 55C14F32136EFC2400649790 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55C14F31136EFC2400649790 /* SystemConfiguration.framework */; }; - 55C14F9A136F045400649790 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; }; 55E6F33319EC9F6C00005E76 /* SUErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 55E6F33219EC9F6C00005E76 /* SUErrors.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AA4DCD01C73E5510078F128 /* SUAppcastTest.swift */; }; 5AD0FA7F1C73F2E2004BCEFF /* testappcast.xml in Resources */ = {isa = PBXBuildFile; fileRef = 5AD0FA7E1C73F2E2004BCEFF /* testappcast.xml */; }; @@ -74,25 +58,17 @@ 5AF6C7541AEA49840014A3AB /* SUInstallerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF6C74C1AEA40760014A3AB /* SUInstallerTest.m */; }; 5AF9DC3C1981DBEE001EA135 /* SUDSAVerifierTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF9DC3B1981DBEE001EA135 /* SUDSAVerifierTest.m */; }; 5D06E8E90FD68CDB005AE3F6 /* bsdiff.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8DB0FD68CB9005AE3F6 /* bsdiff.c */; }; - 5D06E8EA0FD68CDB005AE3F6 /* SUBinaryDeltaTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E30FD68CC7005AE3F6 /* SUBinaryDeltaTool.m */; }; 5D06E8FF0FD68D6D005AE3F6 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D06E8FB0FD68D61005AE3F6 /* libbz2.dylib */; }; 5D06E9050FD68D7D005AE3F6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; 5D1AF58B0FD7678C0065DB48 /* libxar.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */; }; 5D1AF5900FD767AD0065DB48 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF58F0FD767AD0065DB48 /* libxml2.dylib */; }; 5D1AF59A0FD767E50065DB48 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF5990FD767E50065DB48 /* libz.dylib */; }; 5F1510A21C96E591006E1629 /* testnamespaces.xml in Resources */ = {isa = PBXBuildFile; fileRef = 5F1510A11C96E591006E1629 /* testnamespaces.xml */; }; - 6102FE460E077FCE00F85D09 /* SUPipedUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */; settings = {ATTRIBUTES = (); }; }; - 6102FE4A0E07803800F85D09 /* SUDiskImageUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */; settings = {ATTRIBUTES = (); }; }; - 61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */; settings = {ATTRIBUTES = (); }; }; 61299A5C09CA6D4500B7442F /* SUConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A5B09CA6D4500B7442F /* SUConstants.h */; settings = {ATTRIBUTES = (); }; }; 61299A6009CA6EB100B7442F /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; - 61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A8B09CA790200B7442F /* SUUnarchiver.h */; }; 61299B3609CB04E000B7442F /* Sparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299B3509CB04E000B7442F /* Sparkle.h */; settings = {ATTRIBUTES = (Public, ); }; }; 612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */; }; 615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */ = {isa = PBXBuildFile; fileRef = 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */; }; - 618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (); }; }; - 618FA5050DAE8AB80026945C /* SUPlainInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */; settings = {ATTRIBUTES = (); }; }; - 618FA5220DAE8E8A0026945C /* SUPackageInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */; settings = {ATTRIBUTES = (); }; }; 6196CFF909C72148000DC222 /* SUStatusController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6196CFE309C71ADE000DC222 /* SUStatusController.h */; settings = {ATTRIBUTES = (); }; }; 6196CFFA09C72149000DC222 /* SUStatusController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6196CFE409C71ADE000DC222 /* SUStatusController.m */; }; 61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A2259C0D1C495D00430CCD /* SUVersionComparisonProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -101,7 +77,6 @@ 61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A2279A0D1CEE7600430CCD /* SUSystemProfiler.h */; settings = {ATTRIBUTES = (); }; }; 61A2279D0D1CEE7600430CCD /* SUSystemProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A2279B0D1CEE7600430CCD /* SUSystemProfiler.m */; }; 61AAE8280A321A7F00D8810D /* Sparkle.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8220A321A7F00D8810D /* Sparkle.strings */; }; - 61B078CE15A5FB6100600039 /* SUCodeSigningVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B078CC15A5FB6100600039 /* SUCodeSigningVerifier.h */; }; 61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */; settings = {ATTRIBUTES = (Public, ); }; }; 61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */; }; 61B5F8F709C4CEB300B25A18 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; }; @@ -120,15 +95,16 @@ 61EF67590E25C5B400F754E0 /* SUHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 61EF67580E25C5B400F754E0 /* SUHost.h */; }; 61FA52880E2D9EA400EF58AD /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 720B16451C66433D006985FB /* SUTestApplicationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 720B16431C66433D006985FB /* SUTestApplicationTest.swift */; }; - 720E21781D0CED2B003A311C /* SUFileOperationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 72E641A61D090F51000404CA /* SUFileOperationConstants.m */; }; 720E217B1D0D00BF003A311C /* SUUpdaterCycle.h in Headers */ = {isa = PBXBuildFile; fileRef = 720E21791D0D00BF003A311C /* SUUpdaterCycle.h */; }; 720E217C1D0D00BF003A311C /* SUUpdaterCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 720E217A1D0D00BF003A311C /* SUUpdaterCycle.m */; }; 7210C7681B9A9A1500EB90AC /* SUUnarchiverTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */; }; + 7214B8811D456A8500CB5CED /* SUBundleIcon.h in Headers */ = {isa = PBXBuildFile; fileRef = 7214B87F1D456A8500CB5CED /* SUBundleIcon.h */; }; + 7214B8821D456A8500CB5CED /* SUBundleIcon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7214B8801D456A8500CB5CED /* SUBundleIcon.m */; }; + 7214B8831D456C2400CB5CED /* SUBundleIcon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7214B8801D456A8500CB5CED /* SUBundleIcon.m */; }; + 7214B8841D456C9500CB5CED /* SUBundleIcon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7214B8801D456A8500CB5CED /* SUBundleIcon.m */; }; 72162B061C82C8B30013C1C5 /* SUParameterAssert.h in Headers */ = {isa = PBXBuildFile; fileRef = 72162B051C82C8B30013C1C5 /* SUParameterAssert.h */; }; 72162B081C82C9600013C1C5 /* SULocalizations.h in Headers */ = {isa = PBXBuildFile; fileRef = 72162B071C82C9600013C1C5 /* SULocalizations.h */; }; - 721BC2031D17A4FC002BC71E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; }; - 721BC2041D17A51B002BC71E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; - 721BC20B1D17A5AD002BC71E /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 721BC20A1D17A5AD002BC71E /* CoreServices.framework */; }; + 721652621D3C44A100FD13D8 /* SUSystemAuthorization.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3AC1D347EDE005D534A /* SUSystemAuthorization.m */; }; 721BC20E1D1CDE55002BC71E /* SULocalCacheDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = 721BC20C1D1CDE55002BC71E /* SULocalCacheDirectory.h */; }; 721BC20F1D1CDE55002BC71E /* SULocalCacheDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = 721BC20D1D1CDE55002BC71E /* SULocalCacheDirectory.m */; }; 721BC2101D1CDE55002BC71E /* SULocalCacheDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = 721BC20D1D1CDE55002BC71E /* SULocalCacheDirectory.m */; }; @@ -136,7 +112,6 @@ 721C245C1CB7576E005440CB /* SUStatusController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6196CFE409C71ADE000DC222 /* SUStatusController.m */; }; 721C245D1CB757C4005440CB /* SUApplicationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 725602D41C83551C00DAA70E /* SUApplicationInfo.m */; }; 721C245E1CB757DE005440CB /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; - 721C245F1CB75A6B005440CB /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 729746561C936D5E00FC134E /* SUMessageTypes.m */; }; 721C24611CB75C5D005440CB /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; }; 721C24621CB75C68005440CB /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; }; 721CF1A71AD7643600D9AC09 /* bsdiff.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8DB0FD68CB9005AE3F6 /* bsdiff.c */; settings = {COMPILER_FLAGS = "-w"; }; }; @@ -144,6 +119,7 @@ 721CF1A91AD7644C00D9AC09 /* sais.c in Sources */ = {isa = PBXBuildFile; fileRef = 7223E7611AD1AEFF008E3161 /* sais.c */; settings = {COMPILER_FLAGS = "-w"; }; }; 721CF1AA1AD7647000D9AC09 /* libxar.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */; }; 721CF1AB1AD764EB00D9AC09 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D06E8FB0FD68D61005AE3F6 /* libbz2.dylib */; }; + 7221947A1D3C42EA004C34FF /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 724BB3B51D35AAC3005D534A /* ServiceManagement.framework */; }; 7223E7631AD1AEFF008E3161 /* sais.c in Sources */ = {isa = PBXBuildFile; fileRef = 7223E7611AD1AEFF008E3161 /* sais.c */; }; 7229E1B61C97C91100CB50D0 /* SUUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7229E1B51C97C91100CB50D0 /* SUUpdateDriver.h */; }; 7229E1B91C97CC4D00CB50D0 /* SUScheduledUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7229E1B71C97CC4D00CB50D0 /* SUScheduledUpdateDriver.h */; }; @@ -159,14 +135,12 @@ 724A0A3B1CF7AEEA00D8C3D5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 724A0A351CF7AEEA00D8C3D5 /* main.m */; }; 724A0A3D1CF7AEEA00D8C3D5 /* SUTemporaryDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 724A0A381CF7AEEA00D8C3D5 /* SUTemporaryDownloader.m */; }; 724A0A3E1CF7AF0E00D8C3D5 /* SUTemporaryDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 724A0A381CF7AEEA00D8C3D5 /* SUTemporaryDownloader.m */; }; - 724BB3671D30B2C5005D534A /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 729746561C936D5E00FC134E /* SUMessageTypes.m */; }; 724BB3711D31D0B7005D534A /* SUInstallerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3701D31D0B7005D534A /* SUInstallerConnection.m */; }; 724BB3731D31D0B7005D534A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3721D31D0B7005D534A /* main.m */; }; 724BB3841D3203BA005D534A /* SparkleInstallerConnection.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 724BB36C1D31D0B7005D534A /* SparkleInstallerConnection.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 724BB3871D32A167005D534A /* SUXPCInstallerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 724BB3851D32A167005D534A /* SUXPCInstallerConnection.h */; }; 724BB3881D32A167005D534A /* SUXPCInstallerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3861D32A167005D534A /* SUXPCInstallerConnection.m */; }; 724BB3891D32B915005D534A /* SUInstallerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3701D31D0B7005D534A /* SUInstallerConnection.m */; }; - 724BB38D1D33283C005D534A /* StatusInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB38C1D33283C005D534A /* StatusInfo.m */; }; 724BB3981D333832005D534A /* SUInstallerStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3971D333832005D534A /* SUInstallerStatus.m */; }; 724BB39A1D333832005D534A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3991D333832005D534A /* main.m */; }; 724BB39E1D333832005D534A /* SparkleInstallerStatus.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 724BB3931D333832005D534A /* SparkleInstallerStatus.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -177,8 +151,6 @@ 724BB3B01D3482BA005D534A /* SUSystemAuthorization.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3AC1D347EDE005D534A /* SUSystemAuthorization.m */; }; 724BB3B11D3484B2005D534A /* SUSystemAuthorization.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3AC1D347EDE005D534A /* SUSystemAuthorization.m */; }; 724BB3B21D34862A005D534A /* SUSystemAuthorization.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3AC1D347EDE005D534A /* SUSystemAuthorization.m */; }; - 724BB3B31D35A6E6005D534A /* SUInstallerStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3971D333832005D534A /* SUInstallerStatus.m */; }; - 724BB3B41D35AA44005D534A /* SUSystemAuthorization.m in Sources */ = {isa = PBXBuildFile; fileRef = 724BB3AC1D347EDE005D534A /* SUSystemAuthorization.m */; }; 724BB3B71D35ABA8005D534A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; }; 725602D51C83551C00DAA70E /* SUApplicationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 725602D31C83551C00DAA70E /* SUApplicationInfo.h */; }; 725602D61C83551C00DAA70E /* SUApplicationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 725602D41C83551C00DAA70E /* SUApplicationInfo.m */; }; @@ -193,26 +165,85 @@ 725F97A51C8B304D00265BE4 /* SUInstallUpdateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 725F97A31C8B304D00265BE4 /* SUInstallUpdateViewController.m */; }; 725F97A61C8B304D00265BE4 /* SUInstallUpdateViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 725F97A41C8B304D00265BE4 /* SUInstallUpdateViewController.xib */; }; 725F97A81C8B42D700265BE4 /* SUStandardUserDriverProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 725F97A71C8B42D700265BE4 /* SUStandardUserDriverProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7268AC631AD634C200C3E0C1 /* SUBinaryDeltaCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7268AC621AD634C200C3E0C1 /* SUBinaryDeltaCreate.m */; }; + 7267E5751D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */; }; + 7267E5761D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */; }; + 7267E5771D3D895B00D1BF90 /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5711D3D895B00D1BF90 /* SUBinaryDeltaCommon.m */; }; + 7267E5781D3D895B00D1BF90 /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5711D3D895B00D1BF90 /* SUBinaryDeltaCommon.m */; }; + 7267E5791D3D895B00D1BF90 /* SUBinaryDeltaCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5731D3D895B00D1BF90 /* SUBinaryDeltaCreate.m */; }; + 7267E57A1D3D895B00D1BF90 /* SUBinaryDeltaCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5731D3D895B00D1BF90 /* SUBinaryDeltaCreate.m */; }; + 7267E57C1D3D895B00D1BF90 /* SUBinaryDeltaTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5741D3D895B00D1BF90 /* SUBinaryDeltaTool.m */; }; + 7267E57F1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E57E1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.m */; }; + 7267E5861D3D89B300D1BF90 /* SUDiskImageUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5811D3D89B300D1BF90 /* SUDiskImageUnarchiver.m */; }; + 7267E5871D3D89B300D1BF90 /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5831D3D89B300D1BF90 /* SUPipedUnarchiver.m */; }; + 7267E5881D3D89B300D1BF90 /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5851D3D89B300D1BF90 /* SUUnarchiver.m */; }; + 7267E59C1D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5991D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m */; }; + 7267E59D1D3D8A5A00D1BF90 /* SUDSAVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E59B1D3D8A5A00D1BF90 /* SUDSAVerifier.m */; }; + 7267E59F1D3D8A6F00D1BF90 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E59E1D3D8A6F00D1BF90 /* main.m */; }; + 7267E5A21D3D8A7E00D1BF90 /* AppInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5A11D3D8A7E00D1BF90 /* AppInstaller.m */; }; + 7267E5A81D3D8A9900D1BF90 /* AgentConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5A71D3D8A9900D1BF90 /* AgentConnection.m */; }; + 7267E5AB1D3D8AA800D1BF90 /* TerminationListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5AA1D3D8AA800D1BF90 /* TerminationListener.m */; }; + 7267E5AE1D3D8AB700D1BF90 /* SUInstallationInputData.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5AD1D3D8AB700D1BF90 /* SUInstallationInputData.m */; }; + 7267E5B11D3D8AD500D1BF90 /* SUMessageTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7267E5AF1D3D8AD500D1BF90 /* SUMessageTypes.h */; }; + 7267E5B21D3D8AD500D1BF90 /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5B01D3D8AD500D1BF90 /* SUMessageTypes.m */; }; + 7267E5B31D3D8AD500D1BF90 /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5B01D3D8AD500D1BF90 /* SUMessageTypes.m */; }; + 7267E5B61D3D8AEE00D1BF90 /* SUInstallationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 7267E5B41D3D8AEE00D1BF90 /* SUInstallationInfo.h */; }; + 7267E5B71D3D8AEE00D1BF90 /* SUInstallationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5B51D3D8AEE00D1BF90 /* SUInstallationInfo.m */; }; + 7267E5B81D3D8AEE00D1BF90 /* SUInstallationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5B51D3D8AEE00D1BF90 /* SUInstallationInfo.m */; }; + 7267E5C21D3D8B2700D1BF90 /* SUGuidedPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5BB1D3D8B2700D1BF90 /* SUGuidedPackageInstaller.m */; }; + 7267E5C31D3D8B2700D1BF90 /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5BD1D3D8B2700D1BF90 /* SUInstaller.m */; }; + 7267E5C41D3D8B2700D1BF90 /* SUPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5BF1D3D8B2700D1BF90 /* SUPackageInstaller.m */; }; + 7267E5C51D3D8B2700D1BF90 /* SUPlainInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5C11D3D8B2700D1BF90 /* SUPlainInstaller.m */; }; + 7267E5C91D3D8C4300D1BF90 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 721BC20A1D17A5AD002BC71E /* CoreServices.framework */; }; + 7267E5CA1D3D8C4800D1BF90 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; + 7267E5CB1D3D8C6400D1BF90 /* SUAppcastItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5FC5409C5182000B25A18 /* SUAppcastItem.m */; }; + 7267E5CC1D3D8C6B00D1BF90 /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; + 7267E5CD1D3D8C7200D1BF90 /* SUSecureCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E075B1CA3A6D6001A286B /* SUSecureCoding.m */; }; + 7267E5CE1D3D8C7500D1BF90 /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; }; + 7267E5D11D3D8CD900D1BF90 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; }; + 7267E5D21D3D8CE800D1BF90 /* bsdiff.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8DB0FD68CB9005AE3F6 /* bsdiff.c */; }; + 7267E5D31D3D8CF200D1BF90 /* bscommon.c in Sources */ = {isa = PBXBuildFile; fileRef = 72B09CE91CEA18900052EF9E /* bscommon.c */; }; + 7267E5D41D3D8CF200D1BF90 /* bspatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8DC0FD68CB9005AE3F6 /* bspatch.c */; }; + 7267E5D51D3D8D2800D1BF90 /* libxar.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 726E07681CA616A4001A286B /* libxar.tbd */; }; + 7267E5D61D3D8D3500D1BF90 /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 726E076A1CA616B3001A286B /* libbz2.tbd */; }; + 7267E5D71D3D8D3F00D1BF90 /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; }; + 7267E5D81D3D8D4400D1BF90 /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; }; + 7267E5D91D3D8D4B00D1BF90 /* sais.c in Sources */ = {isa = PBXBuildFile; fileRef = 7223E7611AD1AEFF008E3161 /* sais.c */; }; + 7267E5DC1D3D8F1E00D1BF90 /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5B01D3D8AD500D1BF90 /* SUMessageTypes.m */; }; + 7267E5DF1D3D8FFA00D1BF90 /* SUInstallationInputData.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5AD1D3D8AB700D1BF90 /* SUInstallationInputData.m */; }; + 7267E5E11D3D901600D1BF90 /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5B01D3D8AD500D1BF90 /* SUMessageTypes.m */; }; + 7267E5E51D3D90AA00D1BF90 /* SUFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7267E5E31D3D90AA00D1BF90 /* SUFileManager.h */; }; + 7267E5E61D3D90AA00D1BF90 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */; }; + 7267E5E71D3D90AA00D1BF90 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */; }; + 7267E5E81D3D90AA00D1BF90 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */; }; + 7267E5E91D3D90AA00D1BF90 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */; }; + 7267E5EA1D3D90AA00D1BF90 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */; }; + 7267E5EB1D3D90C200D1BF90 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */; }; + 7267E5EC1D3D912900D1BF90 /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5BD1D3D8B2700D1BF90 /* SUInstaller.m */; }; + 7267E5ED1D3D912E00D1BF90 /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5851D3D89B300D1BF90 /* SUUnarchiver.m */; }; + 7267E5EE1D3D915900D1BF90 /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */; }; + 7267E5EF1D3D915900D1BF90 /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5711D3D895B00D1BF90 /* SUBinaryDeltaCommon.m */; }; + 7267E5F01D3D915900D1BF90 /* SUBinaryDeltaCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5731D3D895B00D1BF90 /* SUBinaryDeltaCreate.m */; }; + 7267E5F11D3D917A00D1BF90 /* SUBinaryDeltaUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E57E1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.m */; }; + 7267E5F21D3D918000D1BF90 /* SUDSAVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E59B1D3D8A5A00D1BF90 /* SUDSAVerifier.m */; }; + 7267E5F31D3D918500D1BF90 /* SUCodeSigningVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5991D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m */; }; + 7267E5F41D3D918B00D1BF90 /* SUGuidedPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5BB1D3D8B2700D1BF90 /* SUGuidedPackageInstaller.m */; }; + 7267E5F51D3D918B00D1BF90 /* SUPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5BF1D3D8B2700D1BF90 /* SUPackageInstaller.m */; }; + 7267E5F61D3D919000D1BF90 /* SUDiskImageUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5811D3D89B300D1BF90 /* SUDiskImageUnarchiver.m */; }; + 7267E5F71D3D919600D1BF90 /* SUPlainInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5C11D3D8B2700D1BF90 /* SUPlainInstaller.m */; }; + 7267E5F81D3D91A800D1BF90 /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5831D3D89B300D1BF90 /* SUPipedUnarchiver.m */; }; + 7267E5F91D3D92DA00D1BF90 /* Autoupdate in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72B398D21D3D879300EE297F /* Autoupdate */; }; + 7267E5FA1D3DAC3600D1BF90 /* StatusInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5A41D3D8A8A00D1BF90 /* StatusInfo.m */; }; + 7267E5FD1D3DD1B700D1BF90 /* SUDownloadedUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7267E5FB1D3DD1B700D1BF90 /* SUDownloadedUpdate.h */; }; + 7267E5FE1D3DD1B700D1BF90 /* SUDownloadedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SUDownloadedUpdate.m */; }; + 7267E5FF1D3DD1B700D1BF90 /* SUDownloadedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SUDownloadedUpdate.m */; }; + 7267E6001D3DD1B700D1BF90 /* SUDownloadedUpdate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5FC1D3DD1B700D1BF90 /* SUDownloadedUpdate.m */; }; 726DF88E1C84277600188804 /* SUStatusCompletionResults.h in Headers */ = {isa = PBXBuildFile; fileRef = 726DF88D1C84277500188804 /* SUStatusCompletionResults.h */; settings = {ATTRIBUTES = (Public, ); }; }; 726E075C1CA3A6D6001A286B /* SUSecureCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E075A1CA3A6D6001A286B /* SUSecureCoding.h */; }; 726E075D1CA3A6D6001A286B /* SUSecureCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E075B1CA3A6D6001A286B /* SUSecureCoding.m */; }; - 726E07601CA4E9A5001A286B /* SUInstallationInputData.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E075E1CA4E9A5001A286B /* SUInstallationInputData.h */; }; - 726E07611CA4E9A5001A286B /* SUInstallationInputData.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E075F1CA4E9A5001A286B /* SUInstallationInputData.m */; }; - 726E07621CA4E9A5001A286B /* SUInstallationInputData.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E075F1CA4E9A5001A286B /* SUInstallationInputData.m */; }; - 726E07631CA4F35F001A286B /* SUSecureCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E075B1CA3A6D6001A286B /* SUSecureCoding.m */; }; - 726E07641CA615ED001A286B /* SUBinaryDeltaUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E9380FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.m */; }; - 726E07651CA61603001A286B /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E00FD68CC7005AE3F6 /* SUBinaryDeltaApply.m */; }; - 726E07661CA61621001A286B /* bspatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8DC0FD68CB9005AE3F6 /* bspatch.c */; }; - 726E07671CA61648001A286B /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E20FD68CC7005AE3F6 /* SUBinaryDeltaCommon.m */; }; - 726E07691CA616A4001A286B /* libxar.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 726E07681CA616A4001A286B /* libxar.tbd */; }; - 726E076B1CA616B3001A286B /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 726E076A1CA616B3001A286B /* libbz2.tbd */; }; - 726E076D1CA66180001A286B /* SUBinaryDeltaUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E9380FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.m */; }; 726E078D1CA891E9001A286B /* SUUpdaterSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E078B1CA891E9001A286B /* SUUpdaterSettings.h */; settings = {ATTRIBUTES = (Public, ); }; }; 726E078E1CA891E9001A286B /* SUUpdaterSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E078C1CA891E9001A286B /* SUUpdaterSettings.m */; }; 726E07B21CAF08D6001A286B /* SUInstallerLauncher.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E07B11CAF08D6001A286B /* SUInstallerLauncher.m */; }; 726E07B41CAF08D6001A286B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E07B31CAF08D6001A286B /* main.m */; }; - 726E07BE1CAF0C5C001A286B /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; }; 726E07BF1CAF0C6C001A286B /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; 726E07C01CAF15B7001A286B /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; }; 726E4A0E1C86881600C57C6A /* SUStandardUserDriverUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E4A0D1C86881600C57C6A /* SUStandardUserDriverUIDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -225,16 +256,11 @@ 726E4A341C87E0C700C57C6A /* SURemoteUpdateSettingsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E4A321C87E0C700C57C6A /* SURemoteUpdateSettingsWindowController.m */; }; 726E4A351C87E0C700C57C6A /* SURemoteUpdateSettingsWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 726E4A331C87E0C700C57C6A /* SURemoteUpdateSettingsWindowController.xib */; }; 726E4A371C89116000C57C6A /* SUStandardUserDriverDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E4A361C89116000C57C6A /* SUStandardUserDriverDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 726F2CDE1BC9BE5B001971A4 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; }; 726F2CE51BC9C33D001971A4 /* SUOperatingSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */; }; 726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; }; - 726F2CE71BC9C3E2001971A4 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; }; 726F2CE81BC9C48F001971A4 /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; 726F2CE91BC9C499001971A4 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; }; 726F2CEB1BC9C733001971A4 /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; - 7275F9C11B5F1F2900B1D19E /* SUFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7275F9BF1B5F1F2900B1D19E /* SUFileManager.h */; }; - 7275F9C21B5F1F2900B1D19E /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; }; - 7275F9C31B5F1F2900B1D19E /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; }; 728337A61C9E6FF40085AA99 /* SUProbeInstallStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 728337A41C9E6FF40085AA99 /* SUProbeInstallStatus.h */; }; 728337A71C9E6FF40085AA99 /* SUProbeInstallStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 728337A51C9E6FF40085AA99 /* SUProbeInstallStatus.m */; }; 728638ED1CAF50CE00783084 /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; @@ -242,30 +268,10 @@ 7293A1AF1CEE933800B957A7 /* SUURLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7293A1AD1CEE933800B957A7 /* SUURLRequest.m */; }; 7293A1B01CEE9B9800B957A7 /* SUURLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7293A1AD1CEE933800B957A7 /* SUURLRequest.m */; }; 7293A1B11CEE9B9F00B957A7 /* SUURLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7293A1AD1CEE933800B957A7 /* SUURLRequest.m */; }; - 729746201C8E8D9A00FC134E /* TerminationListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 7297461F1C8E8D9A00FC134E /* TerminationListener.m */; }; - 729746231C8E8F1100FC134E /* AppInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 729746221C8E8F1100FC134E /* AppInstaller.m */; }; - 729746371C8FC04600FC134E /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A8C09CA790200B7442F /* SUUnarchiver.m */; }; - 729746381C8FC04B00FC134E /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */; }; - 729746391C8FC04F00FC134E /* SUDiskImageUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */; }; - 7297463A1C8FCA4900FC134E /* SUDSAVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */; }; - 7297463C1C8FF6AE00FC134E /* SUCodeSigningVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B078CD15A5FB6100600039 /* SUCodeSigningVerifier.m */; }; - 729746571C936D5E00FC134E /* SUMessageTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 729746551C936D5E00FC134E /* SUMessageTypes.h */; }; - 729746581C936D5E00FC134E /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 729746561C936D5E00FC134E /* SUMessageTypes.m */; }; - 729746591C936D5E00FC134E /* SUMessageTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 729746561C936D5E00FC134E /* SUMessageTypes.m */; }; 72A1C2631CD6849C004CD282 /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; }; 72A450531C69A68900D67EEA /* SUUpdatePermission.h in Headers */ = {isa = PBXBuildFile; fileRef = 72A450511C69A68900D67EEA /* SUUpdatePermission.h */; settings = {ATTRIBUTES = (Public, ); }; }; 72A450541C69A68900D67EEA /* SUUpdatePermission.m in Sources */ = {isa = PBXBuildFile; fileRef = 72A450521C69A68900D67EEA /* SUUpdatePermission.m */; }; 72A4A2401BB6567D00E7820D /* SUFileManagerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72A4A23F1BB6567D00E7820D /* SUFileManagerTest.swift */; }; - 72A6F97E1C94C370005F404C /* SUDSAVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */; }; - 72A6F97F1C94C392005F404C /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A8C09CA790200B7442F /* SUUnarchiver.m */; }; - 72A6F9801C94C397005F404C /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; }; - 72A6F9811C94C3BB005F404C /* SUPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */; }; - 72A6F9821C94C3BB005F404C /* SUGuidedPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 767B61AB1972D488004E0C3C /* SUGuidedPackageInstaller.m */; }; - 72A6F9831C94C3BF005F404C /* SUPlainInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5040DAE8AB80026945C /* SUPlainInstaller.m */; }; - 72A6F9841C94C3FE005F404C /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E00FD68CC7005AE3F6 /* SUBinaryDeltaApply.m */; }; - 72A6F9851C94C3FE005F404C /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E20FD68CC7005AE3F6 /* SUBinaryDeltaCommon.m */; }; - 72A6F9861C94C49C005F404C /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */; }; - 72A6F9871C94C4AE005F404C /* SUDiskImageUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */; }; 72A6F98A1C94E2D6005F404C /* SUUpdaterDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 72A6F9891C94E2D6005F404C /* SUUpdaterDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 72AC6B261B9AAC8800F62325 /* SparkleTestCodeSignApp.tar.gz in Resources */ = {isa = PBXBuildFile; fileRef = 72AC6B251B9AAC8800F62325 /* SparkleTestCodeSignApp.tar.gz */; }; 72AC6B281B9AAD6700F62325 /* SparkleTestCodeSignApp.tar in Resources */ = {isa = PBXBuildFile; fileRef = 72AC6B271B9AAD6700F62325 /* SparkleTestCodeSignApp.tar */; }; @@ -275,11 +281,6 @@ 72B09CE71CE6BCBD0052EF9E /* SUURLDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B09CE51CE6BCBD0052EF9E /* SUURLDownload.h */; }; 72B09CE81CE6BCBD0052EF9E /* SUURLDownload.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B09CE61CE6BCBD0052EF9E /* SUURLDownload.m */; }; 72B09CEC1CEA18900052EF9E /* bscommon.c in Sources */ = {isa = PBXBuildFile; fileRef = 72B09CE91CEA18900052EF9E /* bscommon.c */; }; - 72B09CEE1CEA21CD0052EF9E /* bscommon.c in Sources */ = {isa = PBXBuildFile; fileRef = 72B09CE91CEA18900052EF9E /* bscommon.c */; }; - 72B144501CF8826900B971EE /* SUAuthorizationEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B1444E1CF8826900B971EE /* SUAuthorizationEnvironment.h */; }; - 72B144511CF8826900B971EE /* SUAuthorizationEnvironment.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B1444F1CF8826900B971EE /* SUAuthorizationEnvironment.m */; }; - 72B144521CF8826900B971EE /* SUAuthorizationEnvironment.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B1444F1CF8826900B971EE /* SUAuthorizationEnvironment.m */; }; - 72B144531CF8992200B971EE /* SUApplicationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 725602D41C83551C00DAA70E /* SUApplicationInfo.m */; }; 72B767CA1C9B707000A07552 /* SUAppcastDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B767C81C9B707000A07552 /* SUAppcastDriver.h */; }; 72B767CB1C9B707000A07552 /* SUAppcastDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B767C91C9B707000A07552 /* SUAppcastDriver.m */; }; 72B767CE1C9B924900A07552 /* SUInstallerDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B767CC1C9B924900A07552 /* SUInstallerDriver.h */; }; @@ -296,11 +297,6 @@ 72B767E31C9CE90A00A07552 /* SUCoreBasedUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B767E11C9CE90A00A07552 /* SUCoreBasedUpdateDriver.m */; }; 72B767E61C9CFD7200A07552 /* SUAutomaticUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B767E41C9CFD7200A07552 /* SUAutomaticUpdateDriver.h */; }; 72B767E71C9CFD7200A07552 /* SUAutomaticUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B767E51C9CFD7200A07552 /* SUAutomaticUpdateDriver.m */; }; - 72D4DAA11AD7632900B211E2 /* SUBinaryDeltaCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7268AC621AD634C200C3E0C1 /* SUBinaryDeltaCreate.m */; }; - 72D9547B1CBA1FFF006F28BD /* SUInstallationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 72D954791CBA1FFE006F28BD /* SUInstallationInfo.h */; }; - 72D9547C1CBA1FFF006F28BD /* SUInstallationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D9547A1CBA1FFE006F28BD /* SUInstallationInfo.m */; }; - 72D9547D1CBA1FFF006F28BD /* SUInstallationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D9547A1CBA1FFE006F28BD /* SUInstallationInfo.m */; }; - 72D9547E1CBA221E006F28BD /* SUAppcastItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5FC5409C5182000B25A18 /* SUAppcastItem.m */; }; 72D954811CBACC35006F28BD /* InstallerProgressAppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D954801CBACC35006F28BD /* InstallerProgressAppController.m */; }; 72D954831CBAD34F006F28BD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D954821CBAD34F006F28BD /* main.m */; }; 72D954861CBB179D006F28BD /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1420DF4F196247F900203BB0 /* Images.xcassets */; }; @@ -315,15 +311,6 @@ 72E45CFC1B641961005C701A /* sparkletestcast.xml in Resources */ = {isa = PBXBuildFile; fileRef = 72E45CFB1B641961005C701A /* sparkletestcast.xml */; }; 72E45CFE1B641D0D005C701A /* test_app_only_dsa_priv_dont_ever_do_this_for_real.pem in Resources */ = {isa = PBXBuildFile; fileRef = 72E45CFD1B641D0D005C701A /* test_app_only_dsa_priv_dont_ever_do_this_for_real.pem */; }; 72E45DDD1B65C3BD005C701A /* sign_update in Resources */ = {isa = PBXBuildFile; fileRef = 72E45DDC1B65C3BD005C701A /* sign_update */; }; - 72E641A71D090F51000404CA /* fileop.m in Sources */ = {isa = PBXBuildFile; fileRef = 72E641A41D090F51000404CA /* fileop.m */; }; - 72E641A81D090F51000404CA /* SUFileOperationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 72E641A61D090F51000404CA /* SUFileOperationConstants.m */; }; - 72E641AB1D090F6E000404CA /* SUFileOperationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 72E641A61D090F51000404CA /* SUFileOperationConstants.m */; }; - 72E641AC1D090F7F000404CA /* SUFileOperationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 72E641A61D090F51000404CA /* SUFileOperationConstants.m */; }; - 72E641AF1D090F9E000404CA /* fileop in Resources */ = {isa = PBXBuildFile; fileRef = 72E6419B1D090F1C000404CA /* fileop */; }; - 72E641B11D091781000404CA /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; }; - 72E641B21D091789000404CA /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; - 72E641B31D0918E4000404CA /* SUFileOperationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 72E641A61D090F51000404CA /* SUFileOperationConstants.m */; }; - 72E641B51D091A15000404CA /* fileop in Copy Executables */ = {isa = PBXBuildFile; fileRef = 72E6419B1D090F1C000404CA /* fileop */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 72EB87EA1CB8798800C37F42 /* ShowInstallerProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = 72EB87E91CB8798800C37F42 /* ShowInstallerProgress.m */; }; 72EB87EB1CB8859100C37F42 /* Updater.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 721C24451CB753E6005440CB /* Updater.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 72EB87EC1CB8887E00C37F42 /* SUStatus.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55C14BD8136EF00C00649790 /* SUStatus.xib */; }; @@ -333,12 +320,9 @@ 72F94F5D1CC455B4002DEE68 /* SparkleInstallerLauncher.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 726E07AD1CAF08D6001A286B /* SparkleInstallerLauncher.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 72F94F5E1CC455B4002DEE68 /* SparklePersistentDownloader.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 726E07EF1CAF37BD001A286B /* SparklePersistentDownloader.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 72F94F5F1CC455B4002DEE68 /* SparkleTemporaryDownloader.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 728638F31CAF5A5F00783084 /* SparkleTemporaryDownloader.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 767B61AC1972D488004E0C3C /* SUGuidedPackageInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 767B61AA1972D488004E0C3C /* SUGuidedPackageInstaller.h */; }; - 767B61AE1972D488004E0C3C /* SUGuidedPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 767B61AB1972D488004E0C3C /* SUGuidedPackageInstaller.m */; }; C23E885B1BE7B24F0050BB73 /* SparkleTestCodeSignApp.enc.dmg in Resources */ = {isa = PBXBuildFile; fileRef = C23E88591BE7AF890050BB73 /* SparkleTestCodeSignApp.enc.dmg */; }; F8761EB11ADC5068000C9034 /* SUCodeSigningVerifierTest.m in Sources */ = {isa = PBXBuildFile; fileRef = F8761EB01ADC5068000C9034 /* SUCodeSigningVerifierTest.m */; }; F8761EB31ADC50EB000C9034 /* SparkleTestCodeSignApp.zip in Resources */ = {isa = PBXBuildFile; fileRef = F8761EB21ADC50EB000C9034 /* SparkleTestCodeSignApp.zip */; }; - F8761EB61ADC5E7A000C9034 /* SUCodeSigningVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B078CD15A5FB6100600039 /* SUCodeSigningVerifier.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -398,20 +382,6 @@ remoteGlobalIDString = 5D06E8CF0FD68C7C005AE3F6; remoteInfo = BinaryDelta; }; - 1495006B195FB8A600BC5B5B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 55C14BB6136EEF1500649790; - remoteInfo = Autoupdate; - }; - 55C14F96136F044100649790 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 55C14BB6136EEF1500649790; - remoteInfo = Autoupdate; - }; 61B5F91B09C4CF7200B25A18 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -468,20 +438,6 @@ remoteGlobalIDString = 721C24441CB753E6005440CB; remoteInfo = "Installer Progress"; }; - 72E641A91D090F63000404CA /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 72E6419A1D090F1C000404CA; - remoteInfo = fileop; - }; - 72E641AD1D090F98000404CA /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 72E6419A1D090F1C000404CA; - remoteInfo = fileop; - }; 72F94F611CC48669002DEE68 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -544,8 +500,8 @@ dstPath = ""; dstSubfolderSpec = 12; files = ( + 7267E5F91D3D92DA00D1BF90 /* Autoupdate in CopyFiles */, 72EB87EB1CB8859100C37F42 /* Updater.app in CopyFiles */, - 142E0E0419A6A26F00E4312B /* Autoupdate.app in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -576,6 +532,15 @@ name = "Embed XPC Services"; runOnlyForDeploymentPostprocessing = 0; }; + 72B398D01D3D879300EE297F /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; 72D954B41CBB4469006F28BD /* Copy Sparkle */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -587,26 +552,6 @@ name = "Copy Sparkle"; runOnlyForDeploymentPostprocessing = 0; }; - 72E641991D090F1C000404CA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; - 72E641B41D091A0A000404CA /* Copy Executables */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 6; - files = ( - 72E641B51D091A15000404CA /* fileop in Copy Executables */, - ); - name = "Copy Executables"; - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -686,9 +631,6 @@ 555CF29A196C52330000B31E /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Sparkle.strings; sourceTree = ""; }; 555CF29C196C52460000B31E /* el */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = el; path = el.lproj/SUUpdateAlert.xib; sourceTree = ""; }; 555CF29D196C524C0000B31E /* el */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = el; path = el.lproj/SUUpdatePermissionPrompt.xib; sourceTree = ""; }; - 55C14BB7136EEF1500649790 /* Autoupdate.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Autoupdate.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 55C14BB9136EEF1500649790 /* Autoupdate-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Autoupdate-Info.plist"; sourceTree = ""; }; - 55C14BD3136EEFCE00649790 /* Autoupdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Autoupdate.m; sourceTree = ""; }; 55C14BD8136EF00C00649790 /* SUStatus.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SUStatus.xib; sourceTree = ""; }; 55C14BF1136EF26100649790 /* cs */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = cs; path = cs.lproj/SUUpdateAlert.xib; sourceTree = ""; }; 55C14BF2136EF26100649790 /* da */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = da; path = da.lproj/SUUpdateAlert.xib; sourceTree = ""; }; @@ -739,22 +681,12 @@ 5D06E8D00FD68C7C005AE3F6 /* BinaryDelta */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = BinaryDelta; sourceTree = BUILT_PRODUCTS_DIR; }; 5D06E8DB0FD68CB9005AE3F6 /* bsdiff.c */ = {isa = PBXFileReference; comments = "-Wno-shorten-64-to-32"; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bsdiff.c; sourceTree = ""; }; 5D06E8DC0FD68CB9005AE3F6 /* bspatch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bspatch.c; sourceTree = ""; }; - 5D06E8DF0FD68CC7005AE3F6 /* SUBinaryDeltaApply.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBinaryDeltaApply.h; sourceTree = ""; }; - 5D06E8E00FD68CC7005AE3F6 /* SUBinaryDeltaApply.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaApply.m; sourceTree = ""; }; - 5D06E8E10FD68CC7005AE3F6 /* SUBinaryDeltaCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBinaryDeltaCommon.h; sourceTree = ""; }; - 5D06E8E20FD68CC7005AE3F6 /* SUBinaryDeltaCommon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaCommon.m; sourceTree = ""; }; - 5D06E8E30FD68CC7005AE3F6 /* SUBinaryDeltaTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaTool.m; sourceTree = ""; usesTabs = 0; }; 5D06E8F10FD68D21005AE3F6 /* ConfigBinaryDelta.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigBinaryDelta.xcconfig; sourceTree = ""; }; 5D06E8FB0FD68D61005AE3F6 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; }; - 5D06E9370FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBinaryDeltaUnarchiver.h; sourceTree = ""; }; - 5D06E9380FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaUnarchiver.m; sourceTree = ""; }; 5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxar.1.dylib; path = usr/lib/libxar.1.dylib; sourceTree = SDKROOT; }; 5D1AF58F0FD767AD0065DB48 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; 5D1AF5990FD767E50065DB48 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 5F1510A11C96E591006E1629 /* testnamespaces.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testnamespaces.xml; sourceTree = ""; }; - 6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPipedUnarchiver.h; sourceTree = ""; }; - 6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUDiskImageUnarchiver.h; sourceTree = ""; }; - 6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUDiskImageUnarchiver.m; sourceTree = ""; }; 611142E810FB1BE5009810AA /* bspatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bspatch.h; sourceTree = ""; }; 61131A050F846CE600E97AF6 /* da */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Sparkle.strings; sourceTree = ""; }; 61131A090F846D0A00E97AF6 /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Sparkle.strings; sourceTree = ""; }; @@ -765,14 +697,9 @@ 612279D90DB5470200AB99EA /* Sparkle Unit Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Sparkle Unit Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 612279DA0DB5470200AB99EA /* SparkleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SparkleTests-Info.plist"; sourceTree = ""; }; 61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUVersionComparisonTest.m; sourceTree = ""; }; - 61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUDSAVerifier.h; sourceTree = ""; }; - 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUDSAVerifier.m; sourceTree = ""; }; 61299A5B09CA6D4500B7442F /* SUConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUConstants.h; sourceTree = ""; }; 61299A5F09CA6EB100B7442F /* SUConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUConstants.m; sourceTree = ""; }; - 61299A8B09CA790200B7442F /* SUUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiver.h; sourceTree = ""; }; - 61299A8C09CA790200B7442F /* SUUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUnarchiver.m; sourceTree = ""; }; 61299B3509CB04E000B7442F /* Sparkle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sparkle.h; sourceTree = ""; }; - 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPipedUnarchiver.m; sourceTree = ""; }; 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermissionPrompt.h; sourceTree = ""; }; 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermissionPrompt.m; sourceTree = ""; }; 613151B20FB4946A000DCD59 /* is */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/Sparkle.strings; sourceTree = ""; }; @@ -787,12 +714,6 @@ 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SUModelTranslation.plist; sourceTree = ""; }; 6186554310D7484E00B1E074 /* pt_PT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Sparkle.strings; sourceTree = ""; }; 618915730E35937600B5E981 /* sv */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = ""; }; - 618FA4FF0DAE88B40026945C /* SUInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstaller.h; sourceTree = ""; }; - 618FA5000DAE88B40026945C /* SUInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstaller.m; sourceTree = ""; }; - 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPlainInstaller.h; sourceTree = ""; }; - 618FA5040DAE8AB80026945C /* SUPlainInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPlainInstaller.m; sourceTree = ""; }; - 618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPackageInstaller.h; sourceTree = ""; }; - 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUPackageInstaller.m; sourceTree = ""; }; 6195D4920E404AD700D41A50 /* ru */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Sparkle.strings; sourceTree = ""; }; 6196CFE309C71ADE000DC222 /* SUStatusController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStatusController.h; sourceTree = ""; }; 6196CFE409C71ADE000DC222 /* SUStatusController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUStatusController.m; sourceTree = ""; }; @@ -806,8 +727,6 @@ 61AAE84F0A321AF700D8810D /* es */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Sparkle.strings; sourceTree = ""; }; 61AAE8590A321B0400D8810D /* fr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Sparkle.strings; sourceTree = ""; }; 61AAE8710A321F7700D8810D /* nl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Sparkle.strings; sourceTree = ""; }; - 61B078CC15A5FB6100600039 /* SUCodeSigningVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUCodeSigningVerifier.h; sourceTree = ""; }; - 61B078CD15A5FB6100600039 /* SUCodeSigningVerifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUCodeSigningVerifier.m; sourceTree = ""; }; 61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SUUpdater.h; sourceTree = ""; }; 61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SUUpdater.m; sourceTree = ""; }; 61B5F8F609C4CEB300B25A18 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; @@ -839,8 +758,12 @@ 720E21791D0D00BF003A311C /* SUUpdaterCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdaterCycle.h; sourceTree = ""; }; 720E217A1D0D00BF003A311C /* SUUpdaterCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdaterCycle.m; sourceTree = ""; }; 7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUUnarchiverTest.swift; sourceTree = ""; }; + 7214B87F1D456A8500CB5CED /* SUBundleIcon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBundleIcon.h; sourceTree = ""; }; + 7214B8801D456A8500CB5CED /* SUBundleIcon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBundleIcon.m; sourceTree = ""; }; + 7214B8851D45AD9A00CB5CED /* SUInstallationType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallationType.h; sourceTree = ""; }; 72162B051C82C8B30013C1C5 /* SUParameterAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUParameterAssert.h; sourceTree = ""; }; 72162B071C82C9600013C1C5 /* SULocalizations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SULocalizations.h; sourceTree = ""; }; + 721652671D3C8FED00FD13D8 /* SUAuthorizationReply.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUAuthorizationReply.h; path = InstallerLauncher/SUAuthorizationReply.h; sourceTree = SOURCE_ROOT; }; 721BC2061D17A532002BC71E /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 721BC2081D17A553002BC71E /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; 721BC20A1D17A5AD002BC71E /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; @@ -849,6 +772,8 @@ 721C24451CB753E6005440CB /* Updater.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Updater.app; sourceTree = BUILT_PRODUCTS_DIR; }; 721C24571CB754E8005440CB /* ConfigInstallerProgress.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigInstallerProgress.xcconfig; sourceTree = ""; }; 721C24581CB7567D005440CB /* InstallerProgress-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "InstallerProgress-Info.plist"; path = "Sparkle/InstallerProgress/InstallerProgress-Info.plist"; sourceTree = SOURCE_ROOT; }; + 722194511D3BF987004C34FF /* SUInstallerAgentProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUInstallerAgentProtocol.h; path = Sparkle/InstallerProgress/SUInstallerAgentProtocol.h; sourceTree = SOURCE_ROOT; }; + 722194521D3BFEB7004C34FF /* SUInstallerAgentInitiationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUInstallerAgentInitiationProtocol.h; path = Sparkle/InstallerProgress/SUInstallerAgentInitiationProtocol.h; sourceTree = SOURCE_ROOT; }; 7223E7611AD1AEFF008E3161 /* sais.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sais.c; sourceTree = ""; }; 7223E7621AD1AEFF008E3161 /* sais.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sais.h; sourceTree = ""; }; 7229E1B51C97C91100CB50D0 /* SUUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdateDriver.h; sourceTree = ""; }; @@ -882,9 +807,6 @@ 724BB3801D31F186005D534A /* SUInstallerCommunicationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerCommunicationProtocol.h; sourceTree = ""; }; 724BB3851D32A167005D534A /* SUXPCInstallerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUXPCInstallerConnection.h; sourceTree = ""; }; 724BB3861D32A167005D534A /* SUXPCInstallerConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUXPCInstallerConnection.m; sourceTree = ""; }; - 724BB38B1D33283C005D534A /* StatusInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusInfo.h; sourceTree = ""; }; - 724BB38C1D33283C005D534A /* StatusInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusInfo.m; sourceTree = ""; }; - 724BB38E1D332EA6005D534A /* SUStatusInfoProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUStatusInfoProtocol.h; path = ../Sparkle/Autoupdate/SUStatusInfoProtocol.h; sourceTree = ""; }; 724BB3931D333832005D534A /* SparkleInstallerStatus.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = SparkleInstallerStatus.xpc; sourceTree = BUILT_PRODUCTS_DIR; }; 724BB3951D333832005D534A /* SUInstallerStatusProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerStatusProtocol.h; sourceTree = ""; }; 724BB3961D333832005D534A /* SUInstallerStatus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerStatus.h; sourceTree = ""; }; @@ -913,17 +835,62 @@ 725F97A31C8B304D00265BE4 /* SUInstallUpdateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstallUpdateViewController.m; sourceTree = ""; }; 725F97A41C8B304D00265BE4 /* SUInstallUpdateViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SUInstallUpdateViewController.xib; sourceTree = ""; }; 725F97A71C8B42D700265BE4 /* SUStandardUserDriverProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStandardUserDriverProtocol.h; sourceTree = ""; }; - 7268AC621AD634C200C3E0C1 /* SUBinaryDeltaCreate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBinaryDeltaCreate.m; sourceTree = ""; }; - 7268AC641AD634E400C3E0C1 /* SUBinaryDeltaCreate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBinaryDeltaCreate.h; sourceTree = ""; }; + 7267E56E1D3D895B00D1BF90 /* SUBinaryDeltaApply.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUBinaryDeltaApply.h; path = Autoupdate/SUBinaryDeltaApply.h; sourceTree = SOURCE_ROOT; }; + 7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUBinaryDeltaApply.m; path = Autoupdate/SUBinaryDeltaApply.m; sourceTree = SOURCE_ROOT; }; + 7267E5701D3D895B00D1BF90 /* SUBinaryDeltaCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUBinaryDeltaCommon.h; path = Autoupdate/SUBinaryDeltaCommon.h; sourceTree = SOURCE_ROOT; }; + 7267E5711D3D895B00D1BF90 /* SUBinaryDeltaCommon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUBinaryDeltaCommon.m; path = Autoupdate/SUBinaryDeltaCommon.m; sourceTree = SOURCE_ROOT; }; + 7267E5721D3D895B00D1BF90 /* SUBinaryDeltaCreate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUBinaryDeltaCreate.h; path = Autoupdate/SUBinaryDeltaCreate.h; sourceTree = SOURCE_ROOT; }; + 7267E5731D3D895B00D1BF90 /* SUBinaryDeltaCreate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUBinaryDeltaCreate.m; path = Autoupdate/SUBinaryDeltaCreate.m; sourceTree = SOURCE_ROOT; }; + 7267E5741D3D895B00D1BF90 /* SUBinaryDeltaTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUBinaryDeltaTool.m; path = Autoupdate/SUBinaryDeltaTool.m; sourceTree = SOURCE_ROOT; }; + 7267E57D1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUBinaryDeltaUnarchiver.h; path = Autoupdate/SUBinaryDeltaUnarchiver.h; sourceTree = SOURCE_ROOT; }; + 7267E57E1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUBinaryDeltaUnarchiver.m; path = Autoupdate/SUBinaryDeltaUnarchiver.m; sourceTree = SOURCE_ROOT; }; + 7267E5801D3D89B300D1BF90 /* SUDiskImageUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUDiskImageUnarchiver.h; path = Autoupdate/SUDiskImageUnarchiver.h; sourceTree = SOURCE_ROOT; }; + 7267E5811D3D89B300D1BF90 /* SUDiskImageUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUDiskImageUnarchiver.m; path = Autoupdate/SUDiskImageUnarchiver.m; sourceTree = SOURCE_ROOT; }; + 7267E5821D3D89B300D1BF90 /* SUPipedUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUPipedUnarchiver.h; path = Autoupdate/SUPipedUnarchiver.h; sourceTree = SOURCE_ROOT; }; + 7267E5831D3D89B300D1BF90 /* SUPipedUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUPipedUnarchiver.m; path = Autoupdate/SUPipedUnarchiver.m; sourceTree = SOURCE_ROOT; }; + 7267E5841D3D89B300D1BF90 /* SUUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUUnarchiver.h; path = Autoupdate/SUUnarchiver.h; sourceTree = SOURCE_ROOT; }; + 7267E5851D3D89B300D1BF90 /* SUUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUUnarchiver.m; path = Autoupdate/SUUnarchiver.m; sourceTree = SOURCE_ROOT; }; + 7267E5891D3D89CA00D1BF90 /* SUUnarchiverProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUUnarchiverProtocol.h; path = Autoupdate/SUUnarchiverProtocol.h; sourceTree = SOURCE_ROOT; }; + 7267E5981D3D8A5A00D1BF90 /* SUCodeSigningVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUCodeSigningVerifier.h; path = Autoupdate/SUCodeSigningVerifier.h; sourceTree = SOURCE_ROOT; }; + 7267E5991D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUCodeSigningVerifier.m; path = Autoupdate/SUCodeSigningVerifier.m; sourceTree = SOURCE_ROOT; }; + 7267E59A1D3D8A5A00D1BF90 /* SUDSAVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUDSAVerifier.h; path = Autoupdate/SUDSAVerifier.h; sourceTree = SOURCE_ROOT; }; + 7267E59B1D3D8A5A00D1BF90 /* SUDSAVerifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUDSAVerifier.m; path = Autoupdate/SUDSAVerifier.m; sourceTree = SOURCE_ROOT; }; + 7267E59E1D3D8A6F00D1BF90 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Autoupdate/main.m; sourceTree = SOURCE_ROOT; }; + 7267E5A01D3D8A7E00D1BF90 /* AppInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppInstaller.h; path = Autoupdate/AppInstaller.h; sourceTree = SOURCE_ROOT; }; + 7267E5A11D3D8A7E00D1BF90 /* AppInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppInstaller.m; path = Autoupdate/AppInstaller.m; sourceTree = SOURCE_ROOT; }; + 7267E5A31D3D8A8A00D1BF90 /* StatusInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatusInfo.h; path = Autoupdate/StatusInfo.h; sourceTree = SOURCE_ROOT; }; + 7267E5A41D3D8A8A00D1BF90 /* StatusInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatusInfo.m; path = Autoupdate/StatusInfo.m; sourceTree = SOURCE_ROOT; }; + 7267E5A61D3D8A9900D1BF90 /* AgentConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AgentConnection.h; path = Autoupdate/AgentConnection.h; sourceTree = SOURCE_ROOT; }; + 7267E5A71D3D8A9900D1BF90 /* AgentConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AgentConnection.m; path = Autoupdate/AgentConnection.m; sourceTree = SOURCE_ROOT; }; + 7267E5A91D3D8AA800D1BF90 /* TerminationListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TerminationListener.h; path = Autoupdate/TerminationListener.h; sourceTree = SOURCE_ROOT; }; + 7267E5AA1D3D8AA800D1BF90 /* TerminationListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TerminationListener.m; path = Autoupdate/TerminationListener.m; sourceTree = SOURCE_ROOT; }; + 7267E5AC1D3D8AB700D1BF90 /* SUInstallationInputData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUInstallationInputData.h; path = Autoupdate/SUInstallationInputData.h; sourceTree = SOURCE_ROOT; }; + 7267E5AD1D3D8AB700D1BF90 /* SUInstallationInputData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUInstallationInputData.m; path = Autoupdate/SUInstallationInputData.m; sourceTree = SOURCE_ROOT; }; + 7267E5AF1D3D8AD500D1BF90 /* SUMessageTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUMessageTypes.h; path = Autoupdate/SUMessageTypes.h; sourceTree = SOURCE_ROOT; }; + 7267E5B01D3D8AD500D1BF90 /* SUMessageTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUMessageTypes.m; path = Autoupdate/SUMessageTypes.m; sourceTree = SOURCE_ROOT; }; + 7267E5B41D3D8AEE00D1BF90 /* SUInstallationInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUInstallationInfo.h; path = Autoupdate/SUInstallationInfo.h; sourceTree = SOURCE_ROOT; }; + 7267E5B51D3D8AEE00D1BF90 /* SUInstallationInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUInstallationInfo.m; path = Autoupdate/SUInstallationInfo.m; sourceTree = SOURCE_ROOT; }; + 7267E5B91D3D8B0B00D1BF90 /* SUInstallerProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUInstallerProtocol.h; path = Autoupdate/SUInstallerProtocol.h; sourceTree = SOURCE_ROOT; }; + 7267E5BA1D3D8B2700D1BF90 /* SUGuidedPackageInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUGuidedPackageInstaller.h; path = Autoupdate/SUGuidedPackageInstaller.h; sourceTree = SOURCE_ROOT; }; + 7267E5BB1D3D8B2700D1BF90 /* SUGuidedPackageInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUGuidedPackageInstaller.m; path = Autoupdate/SUGuidedPackageInstaller.m; sourceTree = SOURCE_ROOT; }; + 7267E5BC1D3D8B2700D1BF90 /* SUInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUInstaller.h; path = Autoupdate/SUInstaller.h; sourceTree = SOURCE_ROOT; }; + 7267E5BD1D3D8B2700D1BF90 /* SUInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUInstaller.m; path = Autoupdate/SUInstaller.m; sourceTree = SOURCE_ROOT; }; + 7267E5BE1D3D8B2700D1BF90 /* SUPackageInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUPackageInstaller.h; path = Autoupdate/SUPackageInstaller.h; sourceTree = SOURCE_ROOT; }; + 7267E5BF1D3D8B2700D1BF90 /* SUPackageInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUPackageInstaller.m; path = Autoupdate/SUPackageInstaller.m; sourceTree = SOURCE_ROOT; }; + 7267E5C01D3D8B2700D1BF90 /* SUPlainInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUPlainInstaller.h; path = Autoupdate/SUPlainInstaller.h; sourceTree = SOURCE_ROOT; }; + 7267E5C11D3D8B2700D1BF90 /* SUPlainInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUPlainInstaller.m; path = Autoupdate/SUPlainInstaller.m; sourceTree = SOURCE_ROOT; }; + 7267E5CF1D3D8C8500D1BF90 /* SecurityFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SecurityFoundation.framework; path = System/Library/Frameworks/SecurityFoundation.framework; sourceTree = SDKROOT; }; + 7267E5DD1D3D8F5A00D1BF90 /* SUStatusInfoProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SUStatusInfoProtocol.h; path = Autoupdate/SUStatusInfoProtocol.h; sourceTree = SOURCE_ROOT; }; + 7267E5E31D3D90AA00D1BF90 /* SUFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUFileManager.h; sourceTree = ""; }; + 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUFileManager.m; sourceTree = ""; }; + 7267E5FB1D3DD1B700D1BF90 /* SUDownloadedUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUDownloadedUpdate.h; sourceTree = ""; }; + 7267E5FC1D3DD1B700D1BF90 /* SUDownloadedUpdate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUDownloadedUpdate.m; sourceTree = ""; }; 726B2B5D1C645FC900388755 /* UI Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UI Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 726DF88D1C84277500188804 /* SUStatusCompletionResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStatusCompletionResults.h; sourceTree = ""; }; 726E075A1CA3A6D6001A286B /* SUSecureCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUSecureCoding.h; path = Sparkle/SUSecureCoding.h; sourceTree = SOURCE_ROOT; }; 726E075B1CA3A6D6001A286B /* SUSecureCoding.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUSecureCoding.m; path = Sparkle/SUSecureCoding.m; sourceTree = SOURCE_ROOT; }; - 726E075E1CA4E9A5001A286B /* SUInstallationInputData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstallationInputData.h; sourceTree = ""; }; - 726E075F1CA4E9A5001A286B /* SUInstallationInputData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstallationInputData.m; sourceTree = ""; }; 726E07681CA616A4001A286B /* libxar.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxar.tbd; path = usr/lib/libxar.tbd; sourceTree = SDKROOT; }; 726E076A1CA616B3001A286B /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; }; - 726E076C1CA64B9C001A286B /* SUUnarchiverProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiverProtocol.h; sourceTree = ""; }; 726E078B1CA891E9001A286B /* SUUpdaterSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdaterSettings.h; sourceTree = ""; }; 726E078C1CA891E9001A286B /* SUUpdaterSettings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdaterSettings.m; sourceTree = ""; }; 726E07AD1CAF08D6001A286B /* SparkleInstallerLauncher.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = SparkleInstallerLauncher.xpc; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -950,8 +917,6 @@ 726E4A361C89116000C57C6A /* SUStandardUserDriverDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStandardUserDriverDelegate.h; sourceTree = ""; }; 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUOperatingSystem.h; sourceTree = ""; }; 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUOperatingSystem.m; sourceTree = ""; }; - 7275F9BF1B5F1F2900B1D19E /* SUFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUFileManager.h; sourceTree = ""; }; - 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUFileManager.m; sourceTree = ""; }; 728337A41C9E6FF40085AA99 /* SUProbeInstallStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUProbeInstallStatus.h; sourceTree = ""; }; 728337A51C9E6FF40085AA99 /* SUProbeInstallStatus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUProbeInstallStatus.m; sourceTree = ""; }; 728638EE1CAF589C00783084 /* ConfigPersistentDownloader.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigPersistentDownloader.xcconfig; sourceTree = ""; }; @@ -959,18 +924,11 @@ 728639041CAF614000783084 /* ConfigTemporaryDownloader.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigTemporaryDownloader.xcconfig; sourceTree = ""; }; 7293A1AC1CEE933800B957A7 /* SUURLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUURLRequest.h; sourceTree = ""; }; 7293A1AD1CEE933800B957A7 /* SUURLRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUURLRequest.m; sourceTree = ""; }; - 7297461E1C8E8D9A00FC134E /* TerminationListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TerminationListener.h; sourceTree = ""; }; - 7297461F1C8E8D9A00FC134E /* TerminationListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TerminationListener.m; sourceTree = ""; }; - 729746211C8E8F1100FC134E /* AppInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppInstaller.h; sourceTree = ""; }; - 729746221C8E8F1100FC134E /* AppInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppInstaller.m; sourceTree = ""; }; - 729746551C936D5E00FC134E /* SUMessageTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUMessageTypes.h; sourceTree = ""; }; - 729746561C936D5E00FC134E /* SUMessageTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUMessageTypes.m; sourceTree = ""; }; 729F10FD1C65A9B500DFCCC5 /* ConfigUITest.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITest.xcconfig; sourceTree = ""; }; 729F10FE1C65A9B500DFCCC5 /* ConfigUITestCoverage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITestCoverage.xcconfig; sourceTree = ""; }; 72A450511C69A68900D67EEA /* SUUpdatePermission.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermission.h; sourceTree = ""; }; 72A450521C69A68900D67EEA /* SUUpdatePermission.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermission.m; sourceTree = ""; }; 72A4A23F1BB6567D00E7820D /* SUFileManagerTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUFileManagerTest.swift; sourceTree = ""; }; - 72A6F97D1C94A5C2005F404C /* SUInstallerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUInstallerProtocol.h; path = Autoupdate/SUInstallerProtocol.h; sourceTree = ""; }; 72A6F9891C94E2D6005F404C /* SUUpdaterDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdaterDelegate.h; sourceTree = ""; }; 72AC6B251B9AAC8800F62325 /* SparkleTestCodeSignApp.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = SparkleTestCodeSignApp.tar.gz; sourceTree = ""; }; 72AC6B271B9AAD6700F62325 /* SparkleTestCodeSignApp.tar */ = {isa = PBXFileReference; lastKnownFileType = archive.tar; path = SparkleTestCodeSignApp.tar; sourceTree = ""; }; @@ -982,8 +940,7 @@ 72B09CE61CE6BCBD0052EF9E /* SUURLDownload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUURLDownload.m; sourceTree = ""; }; 72B09CE91CEA18900052EF9E /* bscommon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bscommon.c; sourceTree = ""; }; 72B09CEA1CEA18900052EF9E /* bscommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bscommon.h; sourceTree = ""; }; - 72B1444E1CF8826900B971EE /* SUAuthorizationEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAuthorizationEnvironment.h; sourceTree = ""; }; - 72B1444F1CF8826900B971EE /* SUAuthorizationEnvironment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAuthorizationEnvironment.m; sourceTree = ""; }; + 72B398D21D3D879300EE297F /* Autoupdate */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Autoupdate; sourceTree = BUILT_PRODUCTS_DIR; }; 72B767C81C9B707000A07552 /* SUAppcastDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAppcastDriver.h; sourceTree = ""; }; 72B767C91C9B707000A07552 /* SUAppcastDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAppcastDriver.m; sourceTree = ""; }; 72B767CC1C9B924900A07552 /* SUInstallerDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstallerDriver.h; sourceTree = ""; }; @@ -1000,13 +957,11 @@ 72B767E11C9CE90A00A07552 /* SUCoreBasedUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUCoreBasedUpdateDriver.m; sourceTree = ""; }; 72B767E41C9CFD7200A07552 /* SUAutomaticUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAutomaticUpdateDriver.h; sourceTree = ""; }; 72B767E51C9CFD7200A07552 /* SUAutomaticUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUAutomaticUpdateDriver.m; sourceTree = ""; }; - 72D954791CBA1FFE006F28BD /* SUInstallationInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstallationInfo.h; sourceTree = ""; }; - 72D9547A1CBA1FFE006F28BD /* SUInstallationInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstallationInfo.m; sourceTree = ""; }; 72D9547F1CBACC35006F28BD /* InstallerProgressAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstallerProgressAppController.h; path = Sparkle/InstallerProgress/InstallerProgressAppController.h; sourceTree = SOURCE_ROOT; }; 72D954801CBACC35006F28BD /* InstallerProgressAppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InstallerProgressAppController.m; path = Sparkle/InstallerProgress/InstallerProgressAppController.m; sourceTree = SOURCE_ROOT; }; 72D954821CBAD34F006F28BD /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Sparkle/InstallerProgress/main.m; sourceTree = SOURCE_ROOT; }; 72D954841CBAD418006F28BD /* ShowInstallerProgress.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ShowInstallerProgress.h; path = Sparkle/InstallerProgress/ShowInstallerProgress.h; sourceTree = SOURCE_ROOT; }; - 72D954851CBAD4AE006F28BD /* InstallerProgressAppControllerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InstallerProgressAppControllerDelegate.h; path = Sparkle/InstallerProgress/InstallerProgressAppControllerDelegate.h; sourceTree = SOURCE_ROOT; }; + 72D954851CBAD4AE006F28BD /* InstallerProgressDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InstallerProgressDelegate.h; path = Sparkle/InstallerProgress/InstallerProgressDelegate.h; sourceTree = SOURCE_ROOT; }; 72D9549E1CBB415B006F28BD /* sparkle.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = sparkle.app; sourceTree = BUILT_PRODUCTS_DIR; }; 72D954A01CBB415C006F28BD /* SUCommandLineDriver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUCommandLineDriver.h; sourceTree = ""; }; 72D954A11CBB415C006F28BD /* SUCommandLineDriver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUCommandLineDriver.m; sourceTree = ""; }; @@ -1023,11 +978,6 @@ 72E45CFB1B641961005C701A /* sparkletestcast.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = sparkletestcast.xml; sourceTree = ""; }; 72E45CFD1B641D0D005C701A /* test_app_only_dsa_priv_dont_ever_do_this_for_real.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_app_only_dsa_priv_dont_ever_do_this_for_real.pem; sourceTree = ""; }; 72E45DDC1B65C3BD005C701A /* sign_update */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = sign_update; path = bin/sign_update; sourceTree = SOURCE_ROOT; }; - 72E6419B1D090F1C000404CA /* fileop */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fileop; sourceTree = BUILT_PRODUCTS_DIR; }; - 72E641A41D090F51000404CA /* fileop.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = fileop.m; sourceTree = ""; }; - 72E641A51D090F51000404CA /* SUFileOperationConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUFileOperationConstants.h; sourceTree = ""; }; - 72E641A61D090F51000404CA /* SUFileOperationConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUFileOperationConstants.m; sourceTree = ""; }; - 72E641B01D09119F000404CA /* ConfigFileop.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigFileop.xcconfig; sourceTree = ""; }; 72EB87E91CB8798800C37F42 /* ShowInstallerProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ShowInstallerProgress.m; path = Sparkle/InstallerProgress/ShowInstallerProgress.m; sourceTree = SOURCE_ROOT; }; 72F94EB01CC2A865002DEE68 /* ConfigCommonReleaseHTTP.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigCommonReleaseHTTP.xcconfig; sourceTree = ""; }; 72F94ED31CC33F1E002DEE68 /* set-ats-exceptions.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "set-ats-exceptions.sh"; sourceTree = ""; }; @@ -1038,8 +988,6 @@ 72F94EDB1CC36C6F002DEE68 /* ConfigTestAppHelperDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigTestAppHelperDebug.xcconfig; sourceTree = ""; }; 72F94F561CC44DE1002DEE68 /* SUXPCServiceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUXPCServiceInfo.h; sourceTree = ""; }; 72F94F571CC44DE1002DEE68 /* SUXPCServiceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUXPCServiceInfo.m; sourceTree = ""; }; - 767B61AA1972D488004E0C3C /* SUGuidedPackageInstaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUGuidedPackageInstaller.h; sourceTree = ""; }; - 767B61AB1972D488004E0C3C /* SUGuidedPackageInstaller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUGuidedPackageInstaller.m; sourceTree = ""; }; 8DC2EF5A0486A6940098B216 /* Sparkle-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Sparkle-Info.plist"; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 /* Sparkle.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Sparkle.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A5BF4F1B1BC7668B007A052A /* SUTestWebServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUTestWebServer.h; sourceTree = ""; }; @@ -1060,18 +1008,6 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 55C14BB5136EEF1500649790 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 726E076B1CA616B3001A286B /* libbz2.tbd in Frameworks */, - 726E07691CA616A4001A286B /* libxar.tbd in Frameworks */, - 14950071195FCE3D00BC5B5B /* AppKit.framework in Frameworks */, - 14950070195FCE3A00BC5B5B /* Foundation.framework in Frameworks */, - 55C14F9A136F045400649790 /* Security.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 5D06E8CE0FD68C7C005AE3F6 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1112,6 +1048,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 7221947A1D3C42EA004C34FF /* ServiceManagement.framework in Frameworks */, 724BB3B71D35ABA8005D534A /* Security.framework in Frameworks */, 721C245A1CB75756005440CB /* Cocoa.framework in Frameworks */, ); @@ -1167,6 +1104,18 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 72B398CF1D3D879300EE297F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7267E5D61D3D8D3500D1BF90 /* libbz2.tbd in Frameworks */, + 7267E5D51D3D8D2800D1BF90 /* libxar.tbd in Frameworks */, + 7267E5D11D3D8CD900D1BF90 /* Security.framework in Frameworks */, + 7267E5CA1D3D8C4800D1BF90 /* Foundation.framework in Frameworks */, + 7267E5C91D3D8C4300D1BF90 /* CoreServices.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 72D9549B1CBB415B006F28BD /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1175,16 +1124,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 72E641981D090F1C000404CA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 721BC20B1D17A5AD002BC71E /* CoreServices.framework in Frameworks */, - 721BC2041D17A51B002BC71E /* Foundation.framework in Frameworks */, - 721BC2031D17A4FC002BC71E /* Security.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8DC2EF560486A6940098B216 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1204,7 +1143,6 @@ isa = PBXGroup; children = ( 5D06E8D00FD68C7C005AE3F6 /* BinaryDelta */, - 55C14BB7136EEF1500649790 /* Autoupdate.app */, 61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */, 612279D90DB5470200AB99EA /* Sparkle Unit Tests.xctest */, 8DC2EF5B0486A6940098B216 /* Sparkle.framework */, @@ -1215,9 +1153,9 @@ 728638F31CAF5A5F00783084 /* SparkleTemporaryDownloader.xpc */, 721C24451CB753E6005440CB /* Updater.app */, 72D9549E1CBB415B006F28BD /* sparkle.app */, - 72E6419B1D090F1C000404CA /* fileop */, 724BB36C1D31D0B7005D534A /* SparkleInstallerConnection.xpc */, 724BB3931D333832005D534A /* SparkleInstallerStatus.xpc */, + 72B398D21D3D879300EE297F /* Autoupdate */, ); name = Products; sourceTree = ""; @@ -1244,6 +1182,7 @@ 0867D69AFE84028FC02AAC07 /* Frameworks */ = { isa = PBXGroup; children = ( + 7267E5CF1D3D8C8500D1BF90 /* SecurityFoundation.framework */, 724BB3B51D35AAC3005D534A /* ServiceManagement.framework */, 721BC20A1D17A5AD002BC71E /* CoreServices.framework */, 721BC2081D17A553002BC71E /* Carbon.framework */, @@ -1373,20 +1312,18 @@ 55C14BD5136EEFD000649790 /* Autoupdate */ = { isa = PBXGroup; children = ( - 72E6419C1D090F1C000404CA /* fileop */, 61CFB2C10E384958007A1735 /* Verifiers */, 6101354A0DD25B7F0049ACDF /* Unarchiving */, 618FA6DB0DB485440026945C /* Installation */, - 55C14BB9136EEF1500649790 /* Autoupdate-Info.plist */, - 55C14BD3136EEFCE00649790 /* Autoupdate.m */, - 729746211C8E8F1100FC134E /* AppInstaller.h */, - 729746221C8E8F1100FC134E /* AppInstaller.m */, - 724BB38B1D33283C005D534A /* StatusInfo.h */, - 724BB38C1D33283C005D534A /* StatusInfo.m */, - 7297461E1C8E8D9A00FC134E /* TerminationListener.h */, - 7297461F1C8E8D9A00FC134E /* TerminationListener.m */, - 726E075E1CA4E9A5001A286B /* SUInstallationInputData.h */, - 726E075F1CA4E9A5001A286B /* SUInstallationInputData.m */, + 7267E59E1D3D8A6F00D1BF90 /* main.m */, + 7267E5A01D3D8A7E00D1BF90 /* AppInstaller.h */, + 7267E5A11D3D8A7E00D1BF90 /* AppInstaller.m */, + 7267E5A61D3D8A9900D1BF90 /* AgentConnection.h */, + 7267E5A71D3D8A9900D1BF90 /* AgentConnection.m */, + 7267E5A91D3D8AA800D1BF90 /* TerminationListener.h */, + 7267E5AA1D3D8AA800D1BF90 /* TerminationListener.m */, + 7267E5AC1D3D8AB700D1BF90 /* SUInstallationInputData.h */, + 7267E5AD1D3D8AB700D1BF90 /* SUInstallationInputData.m */, ); path = Autoupdate; sourceTree = ""; @@ -1394,15 +1331,15 @@ 5D06E8D90FD68C95005AE3F6 /* Binary Delta */ = { isa = PBXGroup; children = ( - 5D06E8DF0FD68CC7005AE3F6 /* SUBinaryDeltaApply.h */, - 5D06E8E00FD68CC7005AE3F6 /* SUBinaryDeltaApply.m */, - 5D06E8E10FD68CC7005AE3F6 /* SUBinaryDeltaCommon.h */, - 5D06E8E20FD68CC7005AE3F6 /* SUBinaryDeltaCommon.m */, - 7268AC641AD634E400C3E0C1 /* SUBinaryDeltaCreate.h */, - 7268AC621AD634C200C3E0C1 /* SUBinaryDeltaCreate.m */, - 5D06E8E30FD68CC7005AE3F6 /* SUBinaryDeltaTool.m */, - 5D06E9370FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.h */, - 5D06E9380FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.m */, + 7267E56E1D3D895B00D1BF90 /* SUBinaryDeltaApply.h */, + 7267E56F1D3D895B00D1BF90 /* SUBinaryDeltaApply.m */, + 7267E5701D3D895B00D1BF90 /* SUBinaryDeltaCommon.h */, + 7267E5711D3D895B00D1BF90 /* SUBinaryDeltaCommon.m */, + 7267E5721D3D895B00D1BF90 /* SUBinaryDeltaCreate.h */, + 7267E5731D3D895B00D1BF90 /* SUBinaryDeltaCreate.m */, + 7267E5741D3D895B00D1BF90 /* SUBinaryDeltaTool.m */, + 7267E57D1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.h */, + 7267E57E1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.m */, ); name = "Binary Delta"; sourceTree = ""; @@ -1411,13 +1348,13 @@ isa = PBXGroup; children = ( 5D06E8D90FD68C95005AE3F6 /* Binary Delta */, - 6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */, - 6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */, - 6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */, - 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */, - 726E076C1CA64B9C001A286B /* SUUnarchiverProtocol.h */, - 61299A8B09CA790200B7442F /* SUUnarchiver.h */, - 61299A8C09CA790200B7442F /* SUUnarchiver.m */, + 7267E5891D3D89CA00D1BF90 /* SUUnarchiverProtocol.h */, + 7267E5801D3D89B300D1BF90 /* SUDiskImageUnarchiver.h */, + 7267E5811D3D89B300D1BF90 /* SUDiskImageUnarchiver.m */, + 7267E5821D3D89B300D1BF90 /* SUPipedUnarchiver.h */, + 7267E5831D3D89B300D1BF90 /* SUPipedUnarchiver.m */, + 7267E5841D3D89B300D1BF90 /* SUUnarchiver.h */, + 7267E5851D3D89B300D1BF90 /* SUUnarchiver.m */, ); name = Unarchiving; path = ..; @@ -1449,6 +1386,7 @@ 61B5FB9509C4F04600B25A18 /* SUAppcast.m */, 61B5FC5309C5182000B25A18 /* SUAppcastItem.h */, 61B5FC5409C5182000B25A18 /* SUAppcastItem.m */, + 7214B8851D45AD9A00CB5CED /* SUInstallationType.h */, 72B09CE51CE6BCBD0052EF9E /* SUURLDownload.h */, 72B09CE61CE6BCBD0052EF9E /* SUURLDownload.m */, 7293A1AC1CEE933800B957A7 /* SUURLRequest.h */, @@ -1482,19 +1420,15 @@ 618FA6DB0DB485440026945C /* Installation */ = { isa = PBXGroup; children = ( - 7275F9BF1B5F1F2900B1D19E /* SUFileManager.h */, - 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */, - 72B1444E1CF8826900B971EE /* SUAuthorizationEnvironment.h */, - 72B1444F1CF8826900B971EE /* SUAuthorizationEnvironment.m */, - 72A6F97D1C94A5C2005F404C /* SUInstallerProtocol.h */, - 618FA4FF0DAE88B40026945C /* SUInstaller.h */, - 618FA5000DAE88B40026945C /* SUInstaller.m */, - 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */, - 618FA5040DAE8AB80026945C /* SUPlainInstaller.m */, - 618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */, - 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */, - 767B61AA1972D488004E0C3C /* SUGuidedPackageInstaller.h */, - 767B61AB1972D488004E0C3C /* SUGuidedPackageInstaller.m */, + 7267E5B91D3D8B0B00D1BF90 /* SUInstallerProtocol.h */, + 7267E5BC1D3D8B2700D1BF90 /* SUInstaller.h */, + 7267E5BD1D3D8B2700D1BF90 /* SUInstaller.m */, + 7267E5C01D3D8B2700D1BF90 /* SUPlainInstaller.h */, + 7267E5C11D3D8B2700D1BF90 /* SUPlainInstaller.m */, + 7267E5BA1D3D8B2700D1BF90 /* SUGuidedPackageInstaller.h */, + 7267E5BB1D3D8B2700D1BF90 /* SUGuidedPackageInstaller.m */, + 7267E5BE1D3D8B2700D1BF90 /* SUPackageInstaller.h */, + 7267E5BF1D3D8B2700D1BF90 /* SUPackageInstaller.m */, ); name = Installation; path = ..; @@ -1512,8 +1446,12 @@ 14652F8319A9759F00959E44 /* SUExport.h */, 61EF67580E25C5B400F754E0 /* SUHost.h */, 61EF67550E25B58D00F754E0 /* SUHost.m */, + 7267E5E31D3D90AA00D1BF90 /* SUFileManager.h */, + 7267E5E41D3D90AA00D1BF90 /* SUFileManager.m */, 721BC20C1D1CDE55002BC71E /* SULocalCacheDirectory.h */, 721BC20D1D1CDE55002BC71E /* SULocalCacheDirectory.m */, + 7214B87F1D456A8500CB5CED /* SUBundleIcon.h */, + 7214B8801D456A8500CB5CED /* SUBundleIcon.m */, 55C14F04136EF6DB00649790 /* SULog.h */, 55C14F05136EF6DB00649790 /* SULog.m */, 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */, @@ -1561,10 +1499,10 @@ 61CFB2C10E384958007A1735 /* Verifiers */ = { isa = PBXGroup; children = ( - 61B078CC15A5FB6100600039 /* SUCodeSigningVerifier.h */, - 61B078CD15A5FB6100600039 /* SUCodeSigningVerifier.m */, - 61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */, - 61299A2E09CA2DAB00B7442F /* SUDSAVerifier.m */, + 7267E5981D3D8A5A00D1BF90 /* SUCodeSigningVerifier.h */, + 7267E5991D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m */, + 7267E59A1D3D8A5A00D1BF90 /* SUDSAVerifier.h */, + 7267E59B1D3D8A5A00D1BF90 /* SUDSAVerifier.m */, ); name = Verifiers; path = ..; @@ -1588,6 +1526,8 @@ 72B767C91C9B707000A07552 /* SUAppcastDriver.m */, 728337A41C9E6FF40085AA99 /* SUProbeInstallStatus.h */, 728337A51C9E6FF40085AA99 /* SUProbeInstallStatus.m */, + 7267E5FB1D3DD1B700D1BF90 /* SUDownloadedUpdate.h */, + 7267E5FC1D3DD1B700D1BF90 /* SUDownloadedUpdate.m */, ); name = Drivers; sourceTree = ""; @@ -1612,11 +1552,15 @@ 721C24461CB753E6005440CB /* Installer Progress */ = { isa = PBXGroup; children = ( - 72D954851CBAD4AE006F28BD /* InstallerProgressAppControllerDelegate.h */, + 72D954851CBAD4AE006F28BD /* InstallerProgressDelegate.h */, + 722194511D3BF987004C34FF /* SUInstallerAgentProtocol.h */, + 722194521D3BFEB7004C34FF /* SUInstallerAgentInitiationProtocol.h */, 72D9547F1CBACC35006F28BD /* InstallerProgressAppController.h */, 72D954801CBACC35006F28BD /* InstallerProgressAppController.m */, 72D954841CBAD418006F28BD /* ShowInstallerProgress.h */, 72EB87E91CB8798800C37F42 /* ShowInstallerProgress.m */, + 7267E5A31D3D8A8A00D1BF90 /* StatusInfo.h */, + 7267E5A41D3D8A8A00D1BF90 /* StatusInfo.m */, 72D954821CBAD34F006F28BD /* main.m */, 721C24581CB7567D005440CB /* InstallerProgress-Info.plist */, ); @@ -1643,7 +1587,7 @@ 724BB3941D333832005D534A /* InstallerStatus */ = { isa = PBXGroup; children = ( - 724BB38E1D332EA6005D534A /* SUStatusInfoProtocol.h */, + 7267E5DD1D3D8F5A00D1BF90 /* SUStatusInfoProtocol.h */, 724BB3951D333832005D534A /* SUInstallerStatusProtocol.h */, 724BB3961D333832005D534A /* SUInstallerStatus.h */, 724BB3971D333832005D534A /* SUInstallerStatus.m */, @@ -1687,6 +1631,7 @@ 726E07AE1CAF08D6001A286B /* InstallerLauncher */ = { isa = PBXGroup; children = ( + 721652671D3C8FED00FD13D8 /* SUAuthorizationReply.h */, 726E07AF1CAF08D6001A286B /* SUInstallerLauncherProtocol.h */, 726E07B01CAF08D6001A286B /* SUInstallerLauncher.h */, 726E07B11CAF08D6001A286B /* SUInstallerLauncher.m */, @@ -1742,12 +1687,12 @@ 729746481C91483B00FC134E /* IPC */ = { isa = PBXGroup; children = ( - 729746551C936D5E00FC134E /* SUMessageTypes.h */, - 729746561C936D5E00FC134E /* SUMessageTypes.m */, + 7267E5AF1D3D8AD500D1BF90 /* SUMessageTypes.h */, + 7267E5B01D3D8AD500D1BF90 /* SUMessageTypes.m */, 726E075A1CA3A6D6001A286B /* SUSecureCoding.h */, 726E075B1CA3A6D6001A286B /* SUSecureCoding.m */, - 72D954791CBA1FFE006F28BD /* SUInstallationInfo.h */, - 72D9547A1CBA1FFE006F28BD /* SUInstallationInfo.m */, + 7267E5B41D3D8AEE00D1BF90 /* SUInstallationInfo.h */, + 7267E5B51D3D8AEE00D1BF90 /* SUInstallationInfo.m */, 724BB3AB1D347EDE005D534A /* SUSystemAuthorization.h */, 724BB3AC1D347EDE005D534A /* SUSystemAuthorization.m */, ); @@ -1784,17 +1729,6 @@ path = "sparkle-cli"; sourceTree = ""; }; - 72E6419C1D090F1C000404CA /* fileop */ = { - isa = PBXGroup; - children = ( - 72E641A41D090F51000404CA /* fileop.m */, - 72E641A51D090F51000404CA /* SUFileOperationConstants.h */, - 72E641A61D090F51000404CA /* SUFileOperationConstants.m */, - ); - name = fileop; - path = ../../fileop; - sourceTree = ""; - }; 72F94F551CC43D99002DEE68 /* XPC Services */ = { isa = PBXGroup; children = ( @@ -1822,7 +1756,6 @@ FA1941D10D94A70100DD942E /* ConfigFramework.xcconfig */, FA1941CA0D94A70100DD942E /* ConfigFrameworkDebug.xcconfig */, FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */, - 72E641B01D09119F000404CA /* ConfigFileop.xcconfig */, 721C24571CB754E8005440CB /* ConfigInstallerProgress.xcconfig */, FA1941CD0D94A70100DD942E /* ConfigTestApp.xcconfig */, 72F94EDA1CC36C37002DEE68 /* ConfigTestAppDebug.xcconfig */, @@ -1860,7 +1793,6 @@ files = ( 725F977B1C8A896F00265BE4 /* SUUserDriverCoreComponent.h in Headers */, 726E078D1CA891E9001A286B /* SUUpdaterSettings.h in Headers */, - 72B144501CF8826900B971EE /* SUAuthorizationEnvironment.h in Headers */, 720E217B1D0D00BF003A311C /* SUUpdaterCycle.h in Headers */, 72A6F98A1C94E2D6005F404C /* SUUpdaterDelegate.h in Headers */, 726E4A371C89116000C57C6A /* SUStandardUserDriverDelegate.h in Headers */, @@ -1872,9 +1804,9 @@ 725CB95A1C7121830064365A /* SUStandardUserDriver.h in Headers */, 725CB9571C7120410064365A /* SUUserDriver.h in Headers */, 72162B061C82C8B30013C1C5 /* SUParameterAssert.h in Headers */, - 729746571C936D5E00FC134E /* SUMessageTypes.h in Headers */, 726DF88E1C84277600188804 /* SUStatusCompletionResults.h in Headers */, 72A450531C69A68900D67EEA /* SUUpdatePermission.h in Headers */, + 7267E5B61D3D8AEE00D1BF90 /* SUInstallationInfo.h in Headers */, 7229E1B61C97C91100CB50D0 /* SUUpdateDriver.h in Headers */, 61299B3609CB04E000B7442F /* Sparkle.h in Headers */, 72F94F581CC44DE1002DEE68 /* SUXPCServiceInfo.h in Headers */, @@ -1883,47 +1815,39 @@ 72A1C2631CD6849C004CD282 /* SUUpdatePermissionPrompt.h in Headers */, 724BB3A81D33461B005D534A /* SUXPCInstallerStatus.h in Headers */, 7246E0A31C83B685003B4E75 /* SUStandardUpdaterController.h in Headers */, - 61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */, 61B5FC7009C51F4A00B25A18 /* SUAppcastItem.h in Headers */, 72B767D61C9C8B5C00A07552 /* SUBasicUpdateDriver.h in Headers */, 61EF67590E25C5B400F754E0 /* SUHost.h in Headers */, - 61B078CE15A5FB6100600039 /* SUCodeSigningVerifier.h in Headers */, 61299A5C09CA6D4500B7442F /* SUConstants.h in Headers */, - 6102FE4A0E07803800F85D09 /* SUDiskImageUnarchiver.h in Headers */, - 61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */, 55E6F33319EC9F6C00005E76 /* SUErrors.h in Headers */, 14652F8419A978C200959E44 /* SUExport.h in Headers */, - 7275F9C11B5F1F2900B1D19E /* SUFileManager.h in Headers */, - 726E07601CA4E9A5001A286B /* SUInstallationInputData.h in Headers */, + 7267E5FD1D3DD1B700D1BF90 /* SUDownloadedUpdate.h in Headers */, 725602D51C83551C00DAA70E /* SUApplicationInfo.h in Headers */, - 767B61AC1972D488004E0C3C /* SUGuidedPackageInstaller.h in Headers */, - 618FA5010DAE88B40026945C /* SUInstaller.h in Headers */, 55C14F06136EF6DB00649790 /* SULog.h in Headers */, 726F2CE51BC9C33D001971A4 /* SUOperatingSystem.h in Headers */, 72B767E61C9CFD7200A07552 /* SUAutomaticUpdateDriver.h in Headers */, - 618FA5220DAE8E8A0026945C /* SUPackageInstaller.h in Headers */, 728337A61C9E6FF40085AA99 /* SUProbeInstallStatus.h in Headers */, 72B767CA1C9B707000A07552 /* SUAppcastDriver.h in Headers */, - 6102FE460E077FCE00F85D09 /* SUPipedUnarchiver.h in Headers */, 726E075C1CA3A6D6001A286B /* SUSecureCoding.h in Headers */, - 618FA5050DAE8AB80026945C /* SUPlainInstaller.h in Headers */, 72B767E21C9CE90A00A07552 /* SUCoreBasedUpdateDriver.h in Headers */, 72B09CE71CE6BCBD0052EF9E /* SUURLDownload.h in Headers */, 61A225A40D1C4AC000430CCD /* SUStandardVersionComparator.h in Headers */, 7229E1B91C97CC4D00CB50D0 /* SUScheduledUpdateDriver.h in Headers */, + 7214B8811D456A8500CB5CED /* SUBundleIcon.h in Headers */, 7293A1AE1CEE933800B957A7 /* SUURLRequest.h in Headers */, 6196CFF909C72148000DC222 /* SUStatusController.h in Headers */, 72B767DE1C9CDB9700A07552 /* SUUserInitiatedUpdateDriver.h in Headers */, 61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */, - 72D9547B1CBA1FFF006F28BD /* SUInstallationInfo.h in Headers */, 72B767D21C9C7B9300A07552 /* SUProbingUpdateDriver.h in Headers */, 7229E1BD1C98EFF200CB50D0 /* SUDownloadDriver.h in Headers */, 72B767CE1C9B924900A07552 /* SUInstallerDriver.h in Headers */, 724BB3871D32A167005D534A /* SUXPCInstallerConnection.h in Headers */, 61B5FCDF09C52A9F00B25A18 /* SUUpdateAlert.h in Headers */, + 7267E5B11D3D8AD500D1BF90 /* SUMessageTypes.h in Headers */, 61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */, 61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */, 3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */, + 7267E5E51D3D90AA00D1BF90 /* SUFileManager.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1968,26 +1892,6 @@ /* End PBXLegacyTarget section */ /* Begin PBXNativeTarget section */ - 55C14BB6136EEF1500649790 /* Autoupdate */ = { - isa = PBXNativeTarget; - buildConfigurationList = 55C14BBE136EEF1500649790 /* Build configuration list for PBXNativeTarget "Autoupdate" */; - buildPhases = ( - 55C14BB3136EEF1500649790 /* Resources */, - 55C14BB4136EEF1500649790 /* Sources */, - 55C14BB5136EEF1500649790 /* Frameworks */, - 14652F7B19A945D600959E44 /* Run Script: Set Git Version Info */, - 72E641B41D091A0A000404CA /* Copy Executables */, - ); - buildRules = ( - ); - dependencies = ( - 72E641AA1D090F63000404CA /* PBXTargetDependency */, - ); - name = Autoupdate; - productName = Autoupdate; - productReference = 55C14BB7136EEF1500649790 /* Autoupdate.app */; - productType = "com.apple.product-type.application"; - }; 5D06E8CF0FD68C7C005AE3F6 /* BinaryDelta */ = { isa = PBXNativeTarget; buildConfigurationList = 5D06E8DA0FD68C95005AE3F6 /* Build configuration list for PBXNativeTarget "BinaryDelta" */; @@ -2016,7 +1920,6 @@ buildRules = ( ); dependencies = ( - 72E641AE1D090F98000404CA /* PBXTargetDependency */, 61FA528D0E2D9EB200EF58AD /* PBXTargetDependency */, ); name = "Sparkle Unit Tests"; @@ -2189,6 +2092,23 @@ productReference = 728638F31CAF5A5F00783084 /* SparkleTemporaryDownloader.xpc */; productType = "com.apple.product-type.xpc-service"; }; + 72B398D11D3D879300EE297F /* Autoupdate */ = { + isa = PBXNativeTarget; + buildConfigurationList = 72B398D61D3D879400EE297F /* Build configuration list for PBXNativeTarget "Autoupdate" */; + buildPhases = ( + 72B398CE1D3D879300EE297F /* Sources */, + 72B398CF1D3D879300EE297F /* Frameworks */, + 72B398D01D3D879300EE297F /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Autoupdate; + productName = Autoupdate; + productReference = 72B398D21D3D879300EE297F /* Autoupdate */; + productType = "com.apple.product-type.tool"; + }; 72D9549D1CBB415B006F28BD /* sparkle-cli */ = { isa = PBXNativeTarget; buildConfigurationList = 72D954AF1CBB415C006F28BD /* Build configuration list for PBXNativeTarget "sparkle-cli" */; @@ -2208,23 +2128,6 @@ productReference = 72D9549E1CBB415B006F28BD /* sparkle.app */; productType = "com.apple.product-type.application"; }; - 72E6419A1D090F1C000404CA /* fileop */ = { - isa = PBXNativeTarget; - buildConfigurationList = 72E6419F1D090F1C000404CA /* Build configuration list for PBXNativeTarget "fileop" */; - buildPhases = ( - 72E641971D090F1C000404CA /* Sources */, - 72E641981D090F1C000404CA /* Frameworks */, - 72E641991D090F1C000404CA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = fileop; - productName = fileop; - productReference = 72E6419B1D090F1C000404CA /* fileop */; - productType = "com.apple.product-type.tool"; - }; 8DC2EF4F0486A6940098B216 /* Sparkle */ = { isa = PBXNativeTarget; buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Sparkle" */; @@ -2242,7 +2145,6 @@ ); dependencies = ( 72D954BA1CBB6E27006F28BD /* PBXTargetDependency */, - 55C14F97136F044100649790 /* PBXTargetDependency */, ); name = Sparkle; productInstallPath = "$(HOME)/Library/Frameworks"; @@ -2311,12 +2213,12 @@ }; }; }; + 72B398D11D3D879300EE297F = { + CreatedOnToolsVersion = 7.3.1; + }; 72D9549D1CBB415B006F28BD = { CreatedOnToolsVersion = 7.3; }; - 72E6419A1D090F1C000404CA = { - CreatedOnToolsVersion = 7.3.1; - }; }; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Sparkle" */; @@ -2378,6 +2280,7 @@ projectRoot = ""; targets = ( 8DC2EF4F0486A6940098B216 /* Sparkle */, + 72B398D11D3D879300EE297F /* Autoupdate */, 726E07AC1CAF08D6001A286B /* SparkleInstallerLauncher */, 724BB36B1D31D0B7005D534A /* SparkleInstallerConnection */, 724BB3921D333832005D534A /* SparkleInstallerStatus */, @@ -2388,13 +2291,11 @@ 612279D80DB5470200AB99EA /* Sparkle Unit Tests */, 5D06E8CF0FD68C7C005AE3F6 /* BinaryDelta */, 72D9549D1CBB415B006F28BD /* sparkle-cli */, - 55C14BB6136EEF1500649790 /* Autoupdate */, 721C24441CB753E6005440CB /* Installer Progress */, 14732BC51960F69300593899 /* Distribution */, 1420DF491962329200203BB0 /* Documentation */, 1495005F195FB89400BC5B5B /* All */, 726B2B5C1C645FC900388755 /* UI Tests */, - 72E6419A1D090F1C000404CA /* fileop */, ); }; /* End PBXProject section */ @@ -2404,7 +2305,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 72E641AF1D090F9E000404CA /* fileop in Resources */, 14958C6E19AEBC950061B14F /* signed-test-file.txt in Resources */, 5F1510A21C96E591006E1629 /* testnamespaces.xml in Resources */, 72AC6B2E1B9B218C00F62325 /* SparkleTestCodeSignApp.dmg in Resources */, @@ -2420,14 +2320,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 55C14BB3136EEF1500649790 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1420DF51196247F900203BB0 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 61B5F8FE09C4CEE200B25A18 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2525,21 +2417,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 14652F7B19A945D600959E44 /* Run Script: Set Git Version Info */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script: Set Git Version Info"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$SRCROOT/Configurations/set-git-version-info.sh\""; - showEnvVarsInLog = 0; - }; 6131B1910DDCDE32005215F0 /* Run Script: Set Git Version Info */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 12; @@ -2618,61 +2495,22 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 55C14BB4136EEF1500649790 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 72E641AB1D090F6E000404CA /* SUFileOperationConstants.m in Sources */, - 72B144531CF8992200B971EE /* SUApplicationInfo.m in Sources */, - 72B09CEE1CEA21CD0052EF9E /* bscommon.c in Sources */, - 72D9547E1CBA221E006F28BD /* SUAppcastItem.m in Sources */, - 72B144521CF8826900B971EE /* SUAuthorizationEnvironment.m in Sources */, - 726E07671CA61648001A286B /* SUBinaryDeltaCommon.m in Sources */, - 726E07661CA61621001A286B /* bspatch.c in Sources */, - 726E07651CA61603001A286B /* SUBinaryDeltaApply.m in Sources */, - 726E07641CA615ED001A286B /* SUBinaryDeltaUnarchiver.m in Sources */, - 726E07631CA4F35F001A286B /* SUSecureCoding.m in Sources */, - 72D9547D1CBA1FFF006F28BD /* SUInstallationInfo.m in Sources */, - 7297463A1C8FCA4900FC134E /* SUDSAVerifier.m in Sources */, - 729746391C8FC04F00FC134E /* SUDiskImageUnarchiver.m in Sources */, - 729746381C8FC04B00FC134E /* SUPipedUnarchiver.m in Sources */, - 729746371C8FC04600FC134E /* SUUnarchiver.m in Sources */, - 729746201C8E8D9A00FC134E /* TerminationListener.m in Sources */, - 55C14BD4136EEFCE00649790 /* Autoupdate.m in Sources */, - F8761EB61ADC5E7A000C9034 /* SUCodeSigningVerifier.m in Sources */, - 55C14F00136EF6B700649790 /* SUConstants.m in Sources */, - 7275F9C31B5F1F2900B1D19E /* SUFileManager.m in Sources */, - 767B61AE1972D488004E0C3C /* SUGuidedPackageInstaller.m in Sources */, - 55C14F0C136EF6EA00649790 /* SUHost.m in Sources */, - 55C14F0D136EF6F200649790 /* SUInstaller.m in Sources */, - 724BB38D1D33283C005D534A /* StatusInfo.m in Sources */, - 729746231C8E8F1100FC134E /* AppInstaller.m in Sources */, - 55C14F08136EF6DB00649790 /* SULog.m in Sources */, - 726F2CE71BC9C3E2001971A4 /* SUOperatingSystem.m in Sources */, - 55C14F24136EF86F00649790 /* SUPackageInstaller.m in Sources */, - 55C14F21136EF84D00649790 /* SUPlainInstaller.m in Sources */, - 55C14F22136EF86000649790 /* SUStandardVersionComparator.m in Sources */, - 726E07621CA4E9A5001A286B /* SUInstallationInputData.m in Sources */, - 729746591C936D5E00FC134E /* SUMessageTypes.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 5D06E8CD0FD68C7C005AE3F6 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7267E5781D3D895B00D1BF90 /* SUBinaryDeltaCommon.m in Sources */, 5D06E8E90FD68CDB005AE3F6 /* bsdiff.c in Sources */, 14652F7E19A9728A00959E44 /* bspatch.c in Sources */, + 7267E6001D3DD1B700D1BF90 /* SUDownloadedUpdate.m in Sources */, 7223E7631AD1AEFF008E3161 /* sais.c in Sources */, 72B09CEC1CEA18900052EF9E /* bscommon.c in Sources */, - 14652F7D19A9726700959E44 /* SUBinaryDeltaApply.m in Sources */, - 14652F7C19A9725300959E44 /* SUBinaryDeltaCommon.m in Sources */, - 7268AC631AD634C200C3E0C1 /* SUBinaryDeltaCreate.m in Sources */, - 5D06E8EA0FD68CDB005AE3F6 /* SUBinaryDeltaTool.m in Sources */, + 7267E5761D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */, 726F2CE81BC9C48F001971A4 /* SUConstants.m in Sources */, - 726F2CDE1BC9BE5B001971A4 /* SUFileManager.m in Sources */, + 7267E57A1D3D895B00D1BF90 /* SUBinaryDeltaCreate.m in Sources */, + 7267E57C1D3D895B00D1BF90 /* SUBinaryDeltaTool.m in Sources */, 726F2CE91BC9C499001971A4 /* SUOperatingSystem.m in Sources */, - 720E21781D0CED2B003A311C /* SUFileOperationConstants.m in Sources */, + 7267E5EA1D3D90AA00D1BF90 /* SUFileManager.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2680,23 +2518,25 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7267E5F81D3D91A800D1BF90 /* SUPipedUnarchiver.m in Sources */, + 7267E5F71D3D919600D1BF90 /* SUPlainInstaller.m in Sources */, + 7267E5F61D3D919000D1BF90 /* SUDiskImageUnarchiver.m in Sources */, + 7267E5FF1D3DD1B700D1BF90 /* SUDownloadedUpdate.m in Sources */, + 7267E5F41D3D918B00D1BF90 /* SUGuidedPackageInstaller.m in Sources */, + 7267E5F51D3D918B00D1BF90 /* SUPackageInstaller.m in Sources */, + 7267E5F31D3D918500D1BF90 /* SUCodeSigningVerifier.m in Sources */, + 7267E5F21D3D918000D1BF90 /* SUDSAVerifier.m in Sources */, + 7267E5F11D3D917A00D1BF90 /* SUBinaryDeltaUnarchiver.m in Sources */, + 7267E5EE1D3D915900D1BF90 /* SUBinaryDeltaApply.m in Sources */, + 7267E5EF1D3D915900D1BF90 /* SUBinaryDeltaCommon.m in Sources */, + 7267E5F01D3D915900D1BF90 /* SUBinaryDeltaCreate.m in Sources */, + 7267E5ED1D3D912E00D1BF90 /* SUUnarchiver.m in Sources */, + 7267E5EC1D3D912900D1BF90 /* SUInstaller.m in Sources */, 723B252A1CEA7F3B00909873 /* bscommon.c in Sources */, - 726E076D1CA66180001A286B /* SUBinaryDeltaUnarchiver.m in Sources */, - 72A6F9871C94C4AE005F404C /* SUDiskImageUnarchiver.m in Sources */, - 72A6F9861C94C49C005F404C /* SUPipedUnarchiver.m in Sources */, - 72A6F9841C94C3FE005F404C /* SUBinaryDeltaApply.m in Sources */, - 72A6F9851C94C3FE005F404C /* SUBinaryDeltaCommon.m in Sources */, - 72A6F9831C94C3BF005F404C /* SUPlainInstaller.m in Sources */, - 72A6F9811C94C3BB005F404C /* SUPackageInstaller.m in Sources */, - 72A6F9821C94C3BB005F404C /* SUGuidedPackageInstaller.m in Sources */, - 72A6F9801C94C397005F404C /* SUInstaller.m in Sources */, - 72A6F97F1C94C392005F404C /* SUUnarchiver.m in Sources */, - 72A6F97E1C94C370005F404C /* SUDSAVerifier.m in Sources */, 721CF1A71AD7643600D9AC09 /* bsdiff.c in Sources */, 721CF1A81AD7644100D9AC09 /* bspatch.c in Sources */, 721CF1A91AD7644C00D9AC09 /* sais.c in Sources */, 5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */, - 72D4DAA11AD7632900B211E2 /* SUBinaryDeltaCreate.m in Sources */, 142E0E0919A83AAC00E4312B /* SUBinaryDeltaTest.m in Sources */, F8761EB11ADC5068000C9034 /* SUCodeSigningVerifierTest.m in Sources */, 725F97771C8A62F500265BE4 /* SUAdHocCodeSigning.m in Sources */, @@ -2705,6 +2545,7 @@ 5AF6C7541AEA49840014A3AB /* SUInstallerTest.m in Sources */, 14652F8219A9746000959E44 /* SULog.m in Sources */, 7210C7681B9A9A1500EB90AC /* SUUnarchiverTest.swift in Sources */, + 7267E5E91D3D90AA00D1BF90 /* SUFileManager.m in Sources */, 5AE459001C34118500E3BB47 /* SUUpdaterTest.m in Sources */, 5AE459021C34118500E3BB47 /* SUVersionComparisonTest.m in Sources */, ); @@ -2729,14 +2570,16 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 724BB3B41D35AA44005D534A /* SUSystemAuthorization.m in Sources */, - 724BB3B31D35A6E6005D534A /* SUInstallerStatus.m in Sources */, + 7214B8831D456C2400CB5CED /* SUBundleIcon.m in Sources */, + 7267E5FA1D3DAC3600D1BF90 /* StatusInfo.m in Sources */, + 7267E5EB1D3D90C200D1BF90 /* SUFileManager.m in Sources */, + 7267E5DC1D3D8F1E00D1BF90 /* SUMessageTypes.m in Sources */, + 721652621D3C44A100FD13D8 /* SUSystemAuthorization.m in Sources */, 72D954831CBAD34F006F28BD /* main.m in Sources */, 721C24621CB75C68005440CB /* SULog.m in Sources */, 72D954811CBACC35006F28BD /* InstallerProgressAppController.m in Sources */, 72EB87EA1CB8798800C37F42 /* ShowInstallerProgress.m in Sources */, 721C24611CB75C5D005440CB /* SUHost.m in Sources */, - 721C245F1CB75A6B005440CB /* SUMessageTypes.m in Sources */, 721C245E1CB757DE005440CB /* SUConstants.m in Sources */, 721C245D1CB757C4005440CB /* SUApplicationInfo.m in Sources */, 721C245C1CB7576E005440CB /* SUStatusController.m in Sources */, @@ -2775,12 +2618,12 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7214B8841D456C9500CB5CED /* SUBundleIcon.m in Sources */, + 7267E5E11D3D901600D1BF90 /* SUMessageTypes.m in Sources */, 724BB3AF1D34828A005D534A /* SUSystemAuthorization.m in Sources */, - 724BB3671D30B2C5005D534A /* SUMessageTypes.m in Sources */, - 72E641B31D0918E4000404CA /* SUFileOperationConstants.m in Sources */, 726E07C01CAF15B7001A286B /* SULog.m in Sources */, 726E07BF1CAF0C6C001A286B /* SUConstants.m in Sources */, - 726E07BE1CAF0C5C001A286B /* SUFileManager.m in Sources */, + 7267E5E81D3D90AA00D1BF90 /* SUFileManager.m in Sources */, 726E07B41CAF08D6001A286B /* main.m in Sources */, 726E07B21CAF08D6001A286B /* SUInstallerLauncher.m in Sources */, ); @@ -2818,6 +2661,44 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 72B398CE1D3D879300EE297F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7267E5D91D3D8D4B00D1BF90 /* sais.c in Sources */, + 7267E5D81D3D8D4400D1BF90 /* SUStandardVersionComparator.m in Sources */, + 7267E5D71D3D8D3F00D1BF90 /* SUHost.m in Sources */, + 7267E5D31D3D8CF200D1BF90 /* bscommon.c in Sources */, + 7267E5D41D3D8CF200D1BF90 /* bspatch.c in Sources */, + 7267E5D21D3D8CE800D1BF90 /* bsdiff.c in Sources */, + 7267E5CE1D3D8C7500D1BF90 /* SULog.m in Sources */, + 7267E5CD1D3D8C7200D1BF90 /* SUSecureCoding.m in Sources */, + 7267E5CC1D3D8C6B00D1BF90 /* SUConstants.m in Sources */, + 7267E5CB1D3D8C6400D1BF90 /* SUAppcastItem.m in Sources */, + 7267E5C31D3D8B2700D1BF90 /* SUInstaller.m in Sources */, + 7267E5AB1D3D8AA800D1BF90 /* TerminationListener.m in Sources */, + 7267E5A81D3D8A9900D1BF90 /* AgentConnection.m in Sources */, + 7267E5E71D3D90AA00D1BF90 /* SUFileManager.m in Sources */, + 7267E59C1D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m in Sources */, + 7267E5C51D3D8B2700D1BF90 /* SUPlainInstaller.m in Sources */, + 7267E5B31D3D8AD500D1BF90 /* SUMessageTypes.m in Sources */, + 7267E5881D3D89B300D1BF90 /* SUUnarchiver.m in Sources */, + 7267E5AE1D3D8AB700D1BF90 /* SUInstallationInputData.m in Sources */, + 7267E5C41D3D8B2700D1BF90 /* SUPackageInstaller.m in Sources */, + 7267E5771D3D895B00D1BF90 /* SUBinaryDeltaCommon.m in Sources */, + 7267E5871D3D89B300D1BF90 /* SUPipedUnarchiver.m in Sources */, + 7267E5751D3D895B00D1BF90 /* SUBinaryDeltaApply.m in Sources */, + 7267E59D1D3D8A5A00D1BF90 /* SUDSAVerifier.m in Sources */, + 7267E5791D3D895B00D1BF90 /* SUBinaryDeltaCreate.m in Sources */, + 7267E5C21D3D8B2700D1BF90 /* SUGuidedPackageInstaller.m in Sources */, + 7267E57F1D3D896700D1BF90 /* SUBinaryDeltaUnarchiver.m in Sources */, + 7267E59F1D3D8A6F00D1BF90 /* main.m in Sources */, + 7267E5A21D3D8A7E00D1BF90 /* AppInstaller.m in Sources */, + 7267E5861D3D89B300D1BF90 /* SUDiskImageUnarchiver.m in Sources */, + 7267E5B81D3D8AEE00D1BF90 /* SUInstallationInfo.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 72D9549A1CBB415B006F28BD /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2828,34 +2709,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 72E641971D090F1C000404CA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 72E641B21D091789000404CA /* SUConstants.m in Sources */, - 72E641B11D091781000404CA /* SUFileManager.m in Sources */, - 72E641A71D090F51000404CA /* fileop.m in Sources */, - 72E641A81D090F51000404CA /* SUFileOperationConstants.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8DC2EF540486A6940098B216 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7267E5DF1D3D8FFA00D1BF90 /* SUInstallationInputData.m in Sources */, 724BB3B01D3482BA005D534A /* SUSystemAuthorization.m in Sources */, 724BB3AA1D3347C2005D534A /* SUInstallerStatus.m in Sources */, 724BB3891D32B915005D534A /* SUInstallerConnection.m in Sources */, - 72E641AC1D090F7F000404CA /* SUFileOperationConstants.m in Sources */, 721BC20F1D1CDE55002BC71E /* SULocalCacheDirectory.m in Sources */, + 7267E5B71D3D8AEE00D1BF90 /* SUInstallationInfo.m in Sources */, 724A0A3E1CF7AF0E00D8C3D5 /* SUTemporaryDownloader.m in Sources */, 723B5DAA1CF7AB6A00365F95 /* SUPersistentDownloader.m in Sources */, 72F94F5A1CC450DE002DEE68 /* SUInstallerLauncher.m in Sources */, 724BB3A91D33461B005D534A /* SUXPCInstallerStatus.m in Sources */, 72B767E31C9CE90A00A07552 /* SUCoreBasedUpdateDriver.m in Sources */, - 7297463C1C8FF6AE00FC134E /* SUCodeSigningVerifier.m in Sources */, - 72D9547C1CBA1FFF006F28BD /* SUInstallationInfo.m in Sources */, 72B767E71C9CFD7200A07552 /* SUAutomaticUpdateDriver.m in Sources */, + 7267E5E61D3D90AA00D1BF90 /* SUFileManager.m in Sources */, 61B5FBB709C4FAFF00B25A18 /* SUAppcast.m in Sources */, 72F94F591CC44DE1002DEE68 /* SUXPCServiceInfo.m in Sources */, 726E078E1CA891E9001A286B /* SUUpdaterSettings.m in Sources */, @@ -2870,9 +2740,8 @@ 720E217C1D0D00BF003A311C /* SUUpdaterCycle.m in Sources */, 72A450541C69A68900D67EEA /* SUUpdatePermission.m in Sources */, 724BB3881D32A167005D534A /* SUXPCInstallerConnection.m in Sources */, + 7214B8821D456A8500CB5CED /* SUBundleIcon.m in Sources */, 7229E1BA1C97CC4D00CB50D0 /* SUScheduledUpdateDriver.m in Sources */, - 726E07611CA4E9A5001A286B /* SUInstallationInputData.m in Sources */, - 7275F9C21B5F1F2900B1D19E /* SUFileManager.m in Sources */, 725CB95B1C7121830064365A /* SUStandardUserDriver.m in Sources */, 61EF67560E25B58D00F754E0 /* SUHost.m in Sources */, 55C14F07136EF6DB00649790 /* SULog.m in Sources */, @@ -2885,14 +2754,14 @@ 7246E0A41C83B685003B4E75 /* SUStandardUpdaterController.m in Sources */, 725F977C1C8A896F00265BE4 /* SUUserDriverCoreComponent.m in Sources */, 61B5FCDE09C52A9F00B25A18 /* SUUpdateAlert.m in Sources */, + 7267E5FE1D3DD1B700D1BF90 /* SUDownloadedUpdate.m in Sources */, 612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */, 61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */, - 72B144511CF8826900B971EE /* SUAuthorizationEnvironment.m in Sources */, 72B767CB1C9B707000A07552 /* SUAppcastDriver.m in Sources */, 726E075D1CA3A6D6001A286B /* SUSecureCoding.m in Sources */, + 7267E5B21D3D8AD500D1BF90 /* SUMessageTypes.m in Sources */, 72B767DB1C9CD2E400A07552 /* SUUIBasedUpdateDriver.m in Sources */, 72B09CE81CE6BCBD0052EF9E /* SUURLDownload.m in Sources */, - 729746581C936D5E00FC134E /* SUMessageTypes.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2939,16 +2808,6 @@ target = 5D06E8CF0FD68C7C005AE3F6 /* BinaryDelta */; targetProxy = 14950069195FB8A600BC5B5B /* PBXContainerItemProxy */; }; - 1495006C195FB8A600BC5B5B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 55C14BB6136EEF1500649790 /* Autoupdate */; - targetProxy = 1495006B195FB8A600BC5B5B /* PBXContainerItemProxy */; - }; - 55C14F97136F044100649790 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 55C14BB6136EEF1500649790 /* Autoupdate */; - targetProxy = 55C14F96136F044100649790 /* PBXContainerItemProxy */; - }; 61B5F91C09C4CF7200B25A18 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8DC2EF4F0486A6940098B216 /* Sparkle */; @@ -2989,16 +2848,6 @@ target = 721C24441CB753E6005440CB /* Installer Progress */; targetProxy = 72D954B91CBB6E27006F28BD /* PBXContainerItemProxy */; }; - 72E641AA1D090F63000404CA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 72E6419A1D090F1C000404CA /* fileop */; - targetProxy = 72E641A91D090F63000404CA /* PBXContainerItemProxy */; - }; - 72E641AE1D090F98000404CA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 72E6419A1D090F1C000404CA /* fileop */; - targetProxy = 72E641AD1D090F98000404CA /* PBXContainerItemProxy */; - }; 72F94F621CC48669002DEE68 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 726E07AC1CAF08D6001A286B /* SparkleInstallerLauncher */; @@ -3261,13 +3110,6 @@ }; name = Coverage; }; - 149B785F1B7D398100D7D62C /* Coverage */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */; - buildSettings = { - }; - name = Coverage; - }; 149B78601B7D398100D7D62C /* Coverage */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3314,20 +3156,6 @@ }; name = Release; }; - 55C14BBB136EEF1500649790 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */; - buildSettings = { - }; - name = Debug; - }; - 55C14BBC136EEF1500649790 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */; - buildSettings = { - }; - name = Release; - }; 5D06E8D20FD68C7D005AE3F6 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D06E8F10FD68D21005AE3F6 /* ConfigBinaryDelta.xcconfig */; @@ -3563,6 +3391,34 @@ }; name = Release; }; + 72B398D71D3D879400EE297F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + 72B398D81D3D879400EE297F /* Coverage */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */; + buildSettings = { + }; + name = Coverage; + }; + 72B398D91D3D879400EE297F /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */; + buildSettings = { + }; + name = Release; + }; + 72B398DA1D3D879400EE297F /* Release-HTTP */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */; + buildSettings = { + }; + name = "Release-HTTP"; + }; 72D954AC1CBB415C006F28BD /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72D954B01CBB41E2006F28BD /* ConfigSparkleTool.xcconfig */; @@ -3587,38 +3443,6 @@ }; name = Release; }; - 72E641A01D090F1C000404CA /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72E641B01D09119F000404CA /* ConfigFileop.xcconfig */; - buildSettings = { - GCC_NO_COMMON_BLOCKS = YES; - }; - name = Debug; - }; - 72E641A11D090F1C000404CA /* Coverage */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72E641B01D09119F000404CA /* ConfigFileop.xcconfig */; - buildSettings = { - GCC_NO_COMMON_BLOCKS = YES; - }; - name = Coverage; - }; - 72E641A21D090F1C000404CA /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72E641B01D09119F000404CA /* ConfigFileop.xcconfig */; - buildSettings = { - GCC_NO_COMMON_BLOCKS = YES; - }; - name = Release; - }; - 72E641A31D090F1C000404CA /* Release-HTTP */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 72E641B01D09119F000404CA /* ConfigFileop.xcconfig */; - buildSettings = { - GCC_NO_COMMON_BLOCKS = YES; - }; - name = "Release-HTTP"; - }; 72F94E9F1CC2A23A002DEE68 /* Release-HTTP */ = { isa = XCBuildConfiguration; baseConfigurationReference = 72F94EB01CC2A865002DEE68 /* ConfigCommonReleaseHTTP.xcconfig */; @@ -3692,13 +3516,6 @@ }; name = "Release-HTTP"; }; - 72F94EAA1CC2A23A002DEE68 /* Release-HTTP */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA1941CE0D94A70100DD942E /* ConfigRelaunch.xcconfig */; - buildSettings = { - }; - name = "Release-HTTP"; - }; 72F94EAB1CC2A23A002DEE68 /* Release-HTTP */ = { isa = XCBuildConfiguration; baseConfigurationReference = 721C24571CB754E8005440CB /* ConfigInstallerProgress.xcconfig */; @@ -3790,17 +3607,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 55C14BBE136EEF1500649790 /* Build configuration list for PBXNativeTarget "Autoupdate" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 55C14BBB136EEF1500649790 /* Debug */, - 149B785F1B7D398100D7D62C /* Coverage */, - 55C14BBC136EEF1500649790 /* Release */, - 72F94EAA1CC2A23A002DEE68 /* Release-HTTP */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 5D06E8DA0FD68C95005AE3F6 /* Build configuration list for PBXNativeTarget "BinaryDelta" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -3854,6 +3660,7 @@ 724BB37C1D31D0B7005D534A /* Release-HTTP */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 724BB39F1D333832005D534A /* Build configuration list for PBXNativeTarget "SparkleInstallerStatus" */ = { isa = XCConfigurationList; @@ -3864,6 +3671,7 @@ 724BB3A31D333832005D534A /* Release-HTTP */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 726B2B671C645FC900388755 /* Build configuration list for PBXNativeTarget "UI Tests" */ = { isa = XCConfigurationList; @@ -3920,6 +3728,17 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 72B398D61D3D879400EE297F /* Build configuration list for PBXNativeTarget "Autoupdate" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 72B398D71D3D879400EE297F /* Debug */, + 72B398D81D3D879400EE297F /* Coverage */, + 72B398D91D3D879400EE297F /* Release */, + 72B398DA1D3D879400EE297F /* Release-HTTP */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 72D954AF1CBB415C006F28BD /* Build configuration list for PBXNativeTarget "sparkle-cli" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -3931,17 +3750,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 72E6419F1D090F1C000404CA /* Build configuration list for PBXNativeTarget "fileop" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 72E641A01D090F1C000404CA /* Debug */, - 72E641A11D090F1C000404CA /* Coverage */, - 72E641A21D090F1C000404CA /* Release */, - 72E641A31D090F1C000404CA /* Release-HTTP */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 0867D690FE84028FC02AAC07 /* Project object */; diff --git a/Sparkle/Autoupdate/Autoupdate-Info.plist b/Sparkle/Autoupdate/Autoupdate-Info.plist deleted file mode 100644 index f5a076f7..00000000 --- a/Sparkle/Autoupdate/Autoupdate-Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleShortVersionString - ${CURRENT_PROJECT_VERSION} - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - LSBackgroundOnly - 1 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - LSUIElement - 1 - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/Sparkle/InstallerProgress/InstallerProgress-Info.plist b/Sparkle/InstallerProgress/InstallerProgress-Info.plist index 6f42e62b..a4b82eaa 100644 --- a/Sparkle/InstallerProgress/InstallerProgress-Info.plist +++ b/Sparkle/InstallerProgress/InstallerProgress-Info.plist @@ -26,5 +26,9 @@ $(MACOSX_DEPLOYMENT_TARGET) NSPrincipalClass NSApplication + LSBackgroundOnly + 1 + LSUIElement + 1 diff --git a/Sparkle/InstallerProgress/InstallerProgressAppController.h b/Sparkle/InstallerProgress/InstallerProgressAppController.h index f91aa592..b60cef6d 100644 --- a/Sparkle/InstallerProgress/InstallerProgressAppController.h +++ b/Sparkle/InstallerProgress/InstallerProgressAppController.h @@ -10,14 +10,16 @@ NS_ASSUME_NONNULL_BEGIN -@protocol InstallerProgressAppControllerDelegate; +@protocol InstallerProgressDelegate; @interface InstallerProgressAppController : NSObject -- (instancetype)initWithApplication:(NSApplication *)application arguments:(NSArray *)arguments delegate:(id)delegate; +- (instancetype)initWithApplication:(NSApplication *)application arguments:(NSArray *)arguments delegate:(id)delegate; - (void)run; +- (void)cleanupAndExitWithStatus:(int)status __attribute__((noreturn)); + @end NS_ASSUME_NONNULL_END diff --git a/Sparkle/InstallerProgress/InstallerProgressAppController.m b/Sparkle/InstallerProgress/InstallerProgressAppController.m index 5ee37200..2468a913 100644 --- a/Sparkle/InstallerProgress/InstallerProgressAppController.m +++ b/Sparkle/InstallerProgress/InstallerProgressAppController.m @@ -7,11 +7,14 @@ // #import "InstallerProgressAppController.h" -#import "InstallerProgressAppControllerDelegate.h" -#import "SUInstallerStatus.h" +#import "InstallerProgressDelegate.h" #import "SUMessageTypes.h" #import "SULog.h" #import "SUApplicationInfo.h" +#import "SUInstallerAgentProtocol.h" +#import "SUInstallerAgentInitiationProtocol.h" +#import "StatusInfo.h" +#import /*! * Terminate the application after a delay from launching the new update to avoid OS activation issues @@ -20,59 +23,92 @@ */ static const NSTimeInterval SUTerminationTimeDelay = 0.3; -@interface InstallerProgressAppController () +@interface InstallerProgressAppController () @property (nonatomic, readonly) NSApplication *application; -@property (nonatomic, readonly) NSBundle *bundle; -@property (nonatomic, readonly, weak) id delegate; -@property (nonatomic, readonly) id statusInfo; +@property (nonatomic, weak) id delegate; +@property (nonatomic, readonly) NSXPCConnection *connection; +@property (nonatomic) BOOL connected; +@property (nonatomic) BOOL repliedToRegistration; +@property (nonatomic, readonly) NSBundle *hostBundle; +@property (nonatomic) StatusInfo *statusInfo; +@property (nonatomic) BOOL submittedLauncherJob; @end +#define CONNECTION_ACKNOWLEDGEMENT_TIMEOUT 7ull + @implementation InstallerProgressAppController @synthesize application = _application; -@synthesize bundle = _bundle; @synthesize delegate = _delegate; +@synthesize connection = _connection; +@synthesize connected = _connected; +@synthesize repliedToRegistration = _repliedToRegistration; +@synthesize hostBundle = _hostBundle; @synthesize statusInfo = _statusInfo; +@synthesize submittedLauncherJob = _submittedLauncherJob; -- (instancetype)initWithApplication:(NSApplication *)application arguments:(NSArray *)arguments delegate:(id)delegate +- (instancetype)initWithApplication:(NSApplication *)application arguments:(NSArray *)arguments delegate:(id)delegate { self = [super init]; if (self != nil) { - if (arguments.count != 2) { - exit(EXIT_FAILURE); + if (arguments.count != 3) { + SULog(@"Error: Invalid number of arguments supplied: %@", arguments); + [self cleanupAndExitWithStatus:EXIT_FAILURE]; } NSString *hostBundlePath = arguments[1]; - NSBundle *bundle = [NSBundle bundleWithPath:hostBundlePath]; - if (bundle == nil) { - SULog(@"Error: bundle at %@ is nil", hostBundlePath); - exit(EXIT_FAILURE); + if (hostBundlePath.length == 0) { + SULog(@"Error: Host bundle path length is 0"); + [self cleanupAndExitWithStatus:EXIT_FAILURE]; } - NSString *bundleIdentifier = bundle.bundleIdentifier; - if (bundleIdentifier == nil) { - SULog(@"Error: Bundle Identifier for target is nil"); - exit(EXIT_FAILURE); + _hostBundle = [NSBundle bundleWithPath:hostBundlePath]; + if (_hostBundle == nil) { + SULog(@"Error: Host bundle for target is nil"); + [self cleanupAndExitWithStatus:EXIT_FAILURE]; } - application.applicationIconImage = [SUApplicationInfo bestIconForBundle:bundle]; - + NSString *hostBundleIdentifier = _hostBundle.bundleIdentifier; + if (hostBundleIdentifier == nil) { + SULog(@"Error: Host bundle identifier for target is nil"); + [self cleanupAndExitWithStatus:EXIT_FAILURE]; + } + + BOOL systemDomain = arguments[2].boolValue; + NSXPCConnectionOptions connectionOptions = systemDomain ? NSXPCConnectionPrivileged : 0; + _connection = [[NSXPCConnection alloc] initWithMachServiceName:SUProgressAgentServiceNameForBundleIdentifier(hostBundleIdentifier) options:connectionOptions]; + + _statusInfo = [[StatusInfo alloc] initWithHostBundleIdentifier:hostBundleIdentifier]; + application.delegate = self; _application = application; _delegate = delegate; - _bundle = bundle; - _statusInfo = [[SUInstallerStatus alloc] init]; - [_statusInfo setInvalidationHandler:^{ + _connection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerAgentProtocol)]; + _connection.exportedObject = self; + + _connection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerAgentInitiationProtocol)]; + + __weak InstallerProgressAppController *weakSelf = self; + _connection.interruptionHandler = ^{ + [weakSelf.connection invalidate]; + }; + + _connection.invalidationHandler = ^{ dispatch_async(dispatch_get_main_queue(), ^{ - [application terminate:nil]; + InstallerProgressAppController *strongSelf = weakSelf; + if (strongSelf != nil) { + int exitStatus = (strongSelf.repliedToRegistration ? EXIT_SUCCESS : EXIT_FAILURE); + if (!strongSelf.repliedToRegistration) { + SULog(@"Error: Agent Invalidating without having the chance to reply to installer"); + } + [strongSelf cleanupAndExitWithStatus:exitStatus]; + } }); - }]; - - [_statusInfo setServiceName:SUStatusInfoServiceNameForBundleIdentifier(bundleIdentifier)]; + }; } return self; } @@ -82,16 +118,108 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; [self.application run]; } -- (void)applicationDidFinishLaunching:(NSNotification *)__unused notification +- (void)startConnection { - [self.statusInfo probeStatusConnectivityWithReply:^{ + [self.statusInfo startListener]; + + [self.connection resume]; + [self.connection.remoteObjectProxy connectionDidInitiateWithReply:^{ dispatch_async(dispatch_get_main_queue(), ^{ - [self.delegate applicationDidFinishLaunchingWithTargetBundle:self.bundle]; + self.connected = YES; }); }]; + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(CONNECTION_ACKNOWLEDGEMENT_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + if (!self.connected) { + SULog(@"Timeout error: failed to receive acknowledgement from installer"); + [self cleanupAndExitWithStatus:EXIT_FAILURE]; + } + }); } -// Close status window immediately, but delay termination for a little bit to better increase the chance +- (void)applicationDidFinishLaunching:(NSNotification *)__unused notification +{ + [self startConnection]; +} + +- (void)cleanupAndExitWithStatus:(int)status __attribute__((noreturn)) +{ + [self.statusInfo invalidate]; + [self.connection invalidate]; + + exit(status); +} + +- (void)registerRelaunchBundlePath:(NSString *)relaunchBundlePath reply:(void (^)(NSNumber *))reply +{ + dispatch_async(dispatch_get_main_queue(), ^{ + assert(relaunchBundlePath != nil); + NSBundle *relaunchBundle = [NSBundle bundleWithPath:relaunchBundlePath]; + if (relaunchBundle == nil) { + [self cleanupAndExitWithStatus:EXIT_FAILURE]; + } + + NSRunningApplication *runningApplication = [SUApplicationInfo runningApplicationWithBundle:relaunchBundle]; + NSNumber *processIdentifier = (runningApplication == nil || runningApplication.terminated) ? nil : @(runningApplication.processIdentifier); + + reply(processIdentifier); + + self.repliedToRegistration = YES; + }); +} + +- (void)registerInstallationInfoData:(NSData *)installationInfoData +{ + dispatch_async(dispatch_get_main_queue(), ^{ + if (self.statusInfo.installationInfoData == nil) { + self.statusInfo.installationInfoData = installationInfoData; + } + }); +} + +- (void)relaunchPath:(NSString *)pathToRelaunch +{ + dispatch_async(dispatch_get_main_queue(), ^{ + if (![[NSWorkspace sharedWorkspace] openFile:pathToRelaunch]) { + SULog(@"Error: Failed to relaunch bundle at %@", pathToRelaunch); + } + }); +} + +- (void)showProgress +{ + dispatch_async(dispatch_get_main_queue(), ^{ + // Show app icon in the dock + ProcessSerialNumber psn = { 0, kCurrentProcess }; + TransformProcessType(&psn, kProcessTransformToForegroundApplication); + + // Note: the application icon needs to be set after showing the icon in the dock + self.application.applicationIconImage = [SUApplicationInfo bestIconForBundle:self.hostBundle]; + + // Activate ourselves otherwise we will probably be in the background + [self.application activateIgnoringOtherApps:YES]; + + [self.delegate installerProgressShouldDisplayWithBundle:self.hostBundle]; + }); +} + +- (void)stopProgress +{ + dispatch_async(dispatch_get_main_queue(), ^{ + [self _stopProgress]; + }); +} + +- (void)_stopProgress +{ + [self.statusInfo invalidate]; + self.statusInfo = nil; + + [self.delegate installerProgressShouldStop]; + self.delegate = nil; +} + +// Dismiss any UI immediately, but delay termination for a little bit to better increase the chance // the updated application when relaunched will be the frontmost application // This is related to macOS activation issues when terminating a frontmost application happens right before // launching another app @@ -99,8 +227,11 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(SUTerminationTimeDelay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // Exit right away, don't go through the apple event process again - exit(EXIT_SUCCESS); + [self cleanupAndExitWithStatus:EXIT_SUCCESS]; }); + + [self _stopProgress]; + // Reply with a 'cancel' rather than 'later' because 'later' may make the runloop stop completely, not having the dispatch_after above invoked return NSTerminateCancel; } diff --git a/Sparkle/InstallerProgress/InstallerProgressAppControllerDelegate.h b/Sparkle/InstallerProgress/InstallerProgressAppControllerDelegate.h deleted file mode 100644 index 6782ec76..00000000 --- a/Sparkle/InstallerProgress/InstallerProgressAppControllerDelegate.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// InstallerProgressAppControllerDelegate.h -// Sparkle -// -// Created by Mayur Pawashe on 4/10/16. -// Copyright © 2016 Sparkle Project. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol InstallerProgressAppControllerDelegate - -- (void)applicationDidFinishLaunchingWithTargetBundle:(NSBundle *)bundle; -- (void)applicationWillTerminateAfterDelay; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Sparkle/InstallerProgress/InstallerProgressDelegate.h b/Sparkle/InstallerProgress/InstallerProgressDelegate.h new file mode 100644 index 00000000..9bf1d314 --- /dev/null +++ b/Sparkle/InstallerProgress/InstallerProgressDelegate.h @@ -0,0 +1,20 @@ +// +// InstallerProgressDelegate.h +// Sparkle +// +// Created by Mayur Pawashe on 4/10/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol InstallerProgressDelegate + +- (void)installerProgressShouldDisplayWithBundle:(NSBundle *)bundle; +- (void)installerProgressShouldStop; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sparkle/InstallerProgress/SUInstallerAgentInitiationProtocol.h b/Sparkle/InstallerProgress/SUInstallerAgentInitiationProtocol.h new file mode 100644 index 00000000..948e6c89 --- /dev/null +++ b/Sparkle/InstallerProgress/SUInstallerAgentInitiationProtocol.h @@ -0,0 +1,15 @@ +// +// SUInstallerAgentInitiationProtocol.h +// Sparkle +// +// Created by Mayur Pawashe on 7/17/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import + +@protocol SUInstallerAgentInitiationProtocol + +- (void)connectionDidInitiateWithReply:(void (^)(void))acknowledgement; + +@end diff --git a/Sparkle/InstallerProgress/SUInstallerAgentProtocol.h b/Sparkle/InstallerProgress/SUInstallerAgentProtocol.h new file mode 100644 index 00000000..caed5391 --- /dev/null +++ b/Sparkle/InstallerProgress/SUInstallerAgentProtocol.h @@ -0,0 +1,27 @@ +// +// SUInstallerAgentProtocol.h +// Sparkle +// +// Created by Mayur Pawashe on 7/17/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol SUInstallerAgentProtocol + +- (void)registerRelaunchBundlePath:(NSString *)relaunchBundlePath reply:(void (^)(NSNumber * _Nullable processIdentifier))reply; + +- (void)registerInstallationInfoData:(NSData *)installationInfoData; + +- (void)showProgress; + +- (void)stopProgress; + +- (void)relaunchPath:(NSString *)pathToRelaunch; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sparkle/InstallerProgress/ShowInstallerProgress.h b/Sparkle/InstallerProgress/ShowInstallerProgress.h index f7879216..62ff0419 100644 --- a/Sparkle/InstallerProgress/ShowInstallerProgress.h +++ b/Sparkle/InstallerProgress/ShowInstallerProgress.h @@ -7,11 +7,11 @@ // #import -#import "InstallerProgressAppControllerDelegate.h" +#import "InstallerProgressDelegate.h" NS_ASSUME_NONNULL_BEGIN -@interface ShowInstallerProgress : NSObject +@interface ShowInstallerProgress : NSObject @end diff --git a/Sparkle/InstallerProgress/ShowInstallerProgress.m b/Sparkle/InstallerProgress/ShowInstallerProgress.m index 30ce4908..8e4602b8 100644 --- a/Sparkle/InstallerProgress/ShowInstallerProgress.m +++ b/Sparkle/InstallerProgress/ShowInstallerProgress.m @@ -22,7 +22,7 @@ @synthesize statusController = _statusController; -- (void)applicationDidFinishLaunchingWithTargetBundle:(NSBundle *)bundle +- (void)installerProgressShouldDisplayWithBundle:(NSBundle *)bundle { SUHost *host = [[SUHost alloc] initWithBundle:bundle]; self.statusController = [[SUStatusController alloc] initWithHost:host]; @@ -32,7 +32,7 @@ [self.statusController showWindow:self]; } -- (void)applicationWillTerminateAfterDelay +- (void)installerProgressShouldStop { [self.statusController close]; self.statusController = nil; diff --git a/Sparkle/InstallerProgress/main.m b/Sparkle/InstallerProgress/main.m index 6cd99eb2..cfc7ffbc 100644 --- a/Sparkle/InstallerProgress/main.m +++ b/Sparkle/InstallerProgress/main.m @@ -14,7 +14,7 @@ int main(int __unused argc, const char __unused *argv[]) { @autoreleasepool { - ShowInstallerProgress *showInstallerProgress = [[ShowInstallerProgress alloc] init]; + id showInstallerProgress = [[ShowInstallerProgress alloc] init]; InstallerProgressAppController *appController = [[InstallerProgressAppController alloc] @@ -22,6 +22,15 @@ int main(int __unused argc, const char __unused *argv[]) arguments:[[NSProcessInfo processInfo] arguments] delegate:showInstallerProgress]; + // Ignore SIGTERM because we are going to catch it ourselves + signal(SIGTERM, SIG_IGN); + + dispatch_source_t sigtermSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM, 0, dispatch_get_main_queue()); + dispatch_source_set_event_handler(sigtermSource, ^{ + [appController cleanupAndExitWithStatus:SIGTERM]; + }); + dispatch_resume(sigtermSource); + [appController run]; } diff --git a/Sparkle/SUAppcastItem.h b/Sparkle/SUAppcastItem.h index 69fa0286..54bbf509 100644 --- a/Sparkle/SUAppcastItem.h +++ b/Sparkle/SUAppcastItem.h @@ -30,6 +30,7 @@ SU_EXPORT @interface SUAppcastItem : NSObject @property (copy, readonly) NSString *displayVersionString; @property (copy, readonly) NSDictionary *deltaUpdates; @property (strong, readonly) NSURL *infoURL; +@property (nonatomic, copy, readonly) NSString *installationType; // Initializes with data from a dictionary provided by the RSS class. - (instancetype)initWithDictionary:(NSDictionary *)dict; diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index 855e5dd3..681b8db8 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -10,6 +10,7 @@ #import "SUVersionComparisonProtocol.h" #import "SULog.h" #import "SUConstants.h" +#import "SUInstallationType.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -28,6 +29,7 @@ static NSString *SUAppcastItemReleaseNotesURLKey = @"releaseNotesURL"; static NSString *SUAppcastItemTitleKey = @"title"; static NSString *SUAppcastItemVersionStringKey = @"versionString"; static NSString *SUAppcastItemPropertiesKey = @"propertiesDictionary"; +static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationType"; @implementation SUAppcastItem @@ -45,6 +47,7 @@ static NSString *SUAppcastItemPropertiesKey = @"propertiesDictionary"; @synthesize title = _title; @synthesize versionString = _versionString; @synthesize propertiesDictionary = _propertiesDictionary; +@synthesize installationType = _installationType; + (BOOL)supportsSecureCoding { @@ -67,6 +70,11 @@ static NSString *SUAppcastItemPropertiesKey = @"propertiesDictionary"; return nil; } + _installationType = [decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemInstallationTypeKey]; + if (!SUValidInstallationType(_installationType)) { + return nil; + } + _itemDescription = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemDescriptionKey] copy]; _maximumSystemVersion = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemMaximumSystemVersionKey] copy]; _minimumSystemVersion = [[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemMinimumSystemVersionKey] copy]; @@ -130,6 +138,10 @@ static NSString *SUAppcastItemPropertiesKey = @"propertiesDictionary"; if (self.propertiesDictionary != nil) { [encoder encodeObject:self.propertiesDictionary forKey:SUAppcastItemPropertiesKey]; } + + if (self.installationType != nil) { + [encoder encodeObject:self.installationType forKey:SUAppcastItemInstallationTypeKey]; + } } - (BOOL)isDeltaUpdate @@ -263,6 +275,18 @@ static NSString *SUAppcastItemPropertiesKey = @"propertiesDictionary"; } else { _displayVersionString = [_versionString copy]; } + + _installationType = [enclosure objectForKey:SUAppcastAttributeInstallationType]; + if (_installationType == nil) { + _installationType = SUInstallationTypeDefault; + } else if (!SUValidInstallationType(_installationType)) { + if (error != NULL) { + *error = [NSString stringWithFormat:@"Feed item's enclosure lacks valid %@ (found %@)", SUAppcastAttributeInstallationType, _installationType]; + } + return nil; + } else if ([_installationType isEqualToString:SUInstallationTypePackage]) { + SULog(@"warning: '%@' for %@ is deprecated. Use '%@' instead.", SUInstallationTypePackage, SUAppcastAttributeInstallationType, SUInstallationTypeGuidedPackage); + } // Find the appropriate release notes URL. NSString *releaseNotesString = [dict objectForKey:SUAppcastElementReleaseNotesLink]; diff --git a/Sparkle/SUApplicationInfo.m b/Sparkle/SUApplicationInfo.m index dfe0e250..c0633dd3 100644 --- a/Sparkle/SUApplicationInfo.m +++ b/Sparkle/SUApplicationInfo.m @@ -7,6 +7,7 @@ // #import "SUApplicationInfo.h" +#import "SUBundleIcon.h" @implementation SUApplicationInfo @@ -17,17 +18,9 @@ + (NSImage *)bestIconForBundle:(NSBundle *)bundle { - // Cache the application icon. - NSString *iconPath = [bundle pathForResource:[bundle objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType:@"icns"]; - // According to the macOS docs, "CFBundleIconFile - This key identifies the file containing - // the icon for the bundle. The filename you specify does not need to include the .icns - // extension, although it may." - // - // However, if it *does* include the '.icns' the above method fails (tested on macOS 10.3.9) so we'll also try: - if (!iconPath) { - iconPath = [bundle pathForResource:[bundle objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType:nil]; - } - NSImage *icon = [[NSImage alloc] initWithContentsOfFile:iconPath]; + NSURL *iconURL = [SUBundleIcon iconURLForBundle:bundle]; + + NSImage *icon = (iconURL == nil) ? nil : [[NSImage alloc] initWithContentsOfURL:iconURL]; // Use a default icon if none is defined. if (!icon) { // this asumption may not be correct (eg. even though we're not the main bundle, it could be still be a regular app) diff --git a/Sparkle/SUAuthorizationEnvironment.h b/Sparkle/SUAuthorizationEnvironment.h deleted file mode 100644 index 6d8d3114..00000000 --- a/Sparkle/SUAuthorizationEnvironment.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// SUAuthorizationEnvironment.h -// Sparkle -// -// Created by Mayur Pawashe on 5/27/16. -// Copyright © 2016 Sparkle Project. All rights reserved. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * A class used for specifying an environment for an authorization request. - * This includes a prompt message and an icon image that may show up on an authorization dialog - */ -@interface SUAuthorizationEnvironment : NSObject - -/** - * Creates an authorization environment - * - * @param prompt A message that will show up in the authorization prompt dialog. The system may append a message - * to this prompt. i.e, something like "Enter your password to allow changes." Supply empty string if the prompt is not important. - * - * @param iconPath A path to a icon on disk that will be used as the icon that shows up in the authorization dialog. - * This should be a PNG image that is 32x32 in dimension. It should also be a path that is readable from anybody, - * likely in a temporary directory. - * - * @return A new authorization environment instance - */ -- (instancetype)initWithPrompt:(NSString *)prompt iconPath:(NSString *)iconPath; - -/** - * Retrieve the authorization environment struct that can be used for the Authorization Service APIs - * - * @return A authorization environment reference. Because this returns an internal pointer, this may only be valid as long as this object instance is alive. - */ -@property (nonatomic, readonly) AuthorizationEnvironment *environment NS_RETURNS_INNER_POINTER; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Sparkle/SUAuthorizationEnvironment.m b/Sparkle/SUAuthorizationEnvironment.m deleted file mode 100644 index 407fa69d..00000000 --- a/Sparkle/SUAuthorizationEnvironment.m +++ /dev/null @@ -1,48 +0,0 @@ -// -// SUAuthorizationEnvironment.m -// Sparkle -// -// Created by Mayur Pawashe on 5/27/16. -// Copyright © 2016 Sparkle Project. All rights reserved. -// - -#import "SUAuthorizationEnvironment.h" - -@implementation SUAuthorizationEnvironment -{ - // Declare data here so we won't have to do more dynamic allocations - char _prompt[1024]; - char _iconPath[PATH_MAX]; - AuthorizationItem _environmentItems[2]; - AuthorizationEnvironment _environment; -} - -- (instancetype)initWithPrompt:(NSString *)prompt iconPath:(NSString *)iconPath -{ - self = [super init]; - if (self != nil) { - if (![prompt getFileSystemRepresentation:_prompt maxLength:sizeof(_prompt)]) { - bzero(_prompt, sizeof(_prompt)); - } - - if (![iconPath getFileSystemRepresentation:_iconPath maxLength:sizeof(_iconPath)]) { - bzero(_iconPath, sizeof(_iconPath)); - } - - _environmentItems[0] = (AuthorizationItem){.name = kAuthorizationEnvironmentPrompt, .valueLength = strlen(_prompt), .value = _prompt, .flags = 0}; - _environmentItems[1] = (AuthorizationItem){.name = kAuthorizationEnvironmentIcon, .valueLength = strlen(_iconPath), .value = _iconPath, .flags = 0}; - - _environment = (AuthorizationEnvironment){.count = sizeof(_environmentItems) / sizeof(*_environmentItems), .items = _environmentItems}; - } - return self; -} - -- (AuthorizationEnvironment *)environment NS_RETURNS_INNER_POINTER -{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdirect-ivar-access" - return &_environment; -#pragma clang diagnostic pop -} - -@end diff --git a/Sparkle/SUAutomaticUpdateDriver.m b/Sparkle/SUAutomaticUpdateDriver.m index 03840c4b..75645bdc 100644 --- a/Sparkle/SUAutomaticUpdateDriver.m +++ b/Sparkle/SUAutomaticUpdateDriver.m @@ -13,6 +13,7 @@ #import "SUCoreBasedUpdateDriver.h" #import "SULog.h" #import "SUAppcastItem.h" +#import "SUErrors.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -49,13 +50,20 @@ - (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders completion:(SUUpdateDriverCompletion)completionBlock { - [self.coreDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:NO completion:completionBlock]; + [self.coreDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:NO requiresSilentInstall:YES completion:completionBlock]; } -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)__unused completionBlock __attribute__((noreturn)) +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)__unused completionBlock __attribute__((noreturn)) { // Nothing really to do here.. this shouldn't be called. - SULog(@"Error: resumeUpdateWithCompletion: called on SUAutomaticUpdateDriver"); + SULog(@"Error: resumeInstallingUpdateWithCompletion: called on SUAutomaticUpdateDriver"); + abort(); +} + +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)__unused downloadedUpdate completion:(SUUpdateDriverCompletion)__unused completionBlock __attribute__((noreturn)) +{ + // Nothing really to do here.. this shouldn't be called. + SULog(@"Error: resumeDownloadedUpdate:completion: called on SUAutomaticUpdateDriver"); abort(); } @@ -99,11 +107,6 @@ } } -- (BOOL)basicDriverShouldSignalShowingUpdateImmediately -{ - return (!self.willInstallSilently || self.updateItem.isCriticalUpdate); -} - - (void)basicDriverIsRequestingAbortUpdateWithError:(NSError *)error { [self abortUpdateWithError:error]; @@ -121,7 +124,8 @@ - (void)abortUpdateWithError:(NSError *)error { - [self.coreDriver abortUpdateWithError:error]; + BOOL showNextUpdateImmediately = (error == nil || error.code == SUInstallationAuthorizeLaterError) && (!self.willInstallSilently || self.updateItem.isCriticalUpdate); + [self.coreDriver abortUpdateAndShowNextUpdateImmediately:showNextUpdateImmediately error:error]; } @end diff --git a/Sparkle/SUBasicUpdateDriver.h b/Sparkle/SUBasicUpdateDriver.h index 6939c0a8..b17db957 100644 --- a/Sparkle/SUBasicUpdateDriver.h +++ b/Sparkle/SUBasicUpdateDriver.h @@ -20,8 +20,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error; -- (BOOL)basicDriverShouldSignalShowingUpdateImmediately; - @optional - (void)basicDriverDidFinishLoadingAppcast; @@ -34,11 +32,13 @@ NS_ASSUME_NONNULL_BEGIN - (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock; -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock; +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock; + +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock; @property (nullable, nonatomic, readonly) SUAppcastItem *nonDeltaUpdateItem; -- (void)abortUpdateWithError:(nullable NSError *)error; +- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldSignalShowingUpdate downloadedUpdate:(SUDownloadedUpdate * _Nullable)downloadedUpdate error:(nullable NSError *)error; @end diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index acedf2e8..5a667472 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -16,6 +16,7 @@ #import "SUAppcastItem.h" #import "SUProbeInstallStatus.h" #import "SUInstallationInfo.h" +#import "SUDownloadedUpdate.h" @interface SUBasicUpdateDriver () @@ -27,6 +28,8 @@ @property (nonatomic, readonly, weak) id updater; // if we didn't have legacy support, I'd remove this.. @property (nullable, nonatomic, readonly, weak) id updaterDelegate; +@property (nonatomic) BOOL aborted; + @end @implementation SUBasicUpdateDriver @@ -37,6 +40,7 @@ @synthesize delegate = _delegate; @synthesize appcastDriver = _appcastDriver; @synthesize completionBlock = _completionBlock; +@synthesize aborted = _aborted; - (instancetype)initWithHost:(SUHost *)host updater:(id)updater updaterDelegate:(id )updaterDelegate delegate:(id )delegate { @@ -64,26 +68,37 @@ } } -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock +- (void)notifyResumableUpdateItem:(SUAppcastItem *)updateItem +{ + if (updateItem == nil) { + [self.delegate basicDriverIsRequestingAbortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUResumeAppcastError userInfo:@{ NSLocalizedDescriptionKey: SULocalizedString(@"Failed to resume installing update.", nil) }]]; + } else { + // Kind of lying, but triggering the notification so drivers can know when to stop showing initial fetching progress + [self notifyFinishLoadingAppcast]; + + SUAppcastItem *nonNullUpdateItem = updateItem; + [self didFindValidUpdateWithAppcastItem:nonNullUpdateItem]; + } +} + +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock { self.completionBlock = completionBlock; [SUProbeInstallStatus probeInstallerUpdateItemForHost:self.host completion:^(SUInstallationInfo * _Nullable installationInfo) { dispatch_async(dispatch_get_main_queue(), ^{ - SUAppcastItem *updateItem = installationInfo.appcastItem; - if (updateItem == nil) { - [self.delegate basicDriverIsRequestingAbortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUResumeAppcastError userInfo:@{ NSLocalizedDescriptionKey: SULocalizedString(@"Failed to resume installing update.", nil) }]]; - } else { - // Kind of lying, but triggering the notification so drivers can know when to stop showing initial fetching progress - [self notifyFinishLoadingAppcast]; - - SUAppcastItem *nonNullUpdateItem = updateItem; - [self didFindValidUpdateWithAppcastItem:nonNullUpdateItem]; - } + [self notifyResumableUpdateItem:installationInfo.appcastItem]; }); }]; } +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock +{ + self.completionBlock = completionBlock; + + [self notifyResumableUpdateItem:downloadedUpdate.updateItem]; +} + - (SUAppcastItem *)nonDeltaUpdateItem { return self.appcastDriver.nonDeltaUpdateItem; @@ -91,7 +106,9 @@ - (void)didFailToFetchAppcastWithError:(NSError *)error { - [self.delegate basicDriverIsRequestingAbortUpdateWithError:error]; + if (!self.aborted) { + [self.delegate basicDriverIsRequestingAbortUpdateWithError:error]; + } } - (void)notifyFinishLoadingAppcast @@ -103,48 +120,56 @@ - (void)didFinishLoadingAppcast:(SUAppcast *)appcast { - if ([self.updaterDelegate respondsToSelector:@selector(updater:didFinishLoadingAppcast:)]) { - [self.updaterDelegate updater:self.updater didFinishLoadingAppcast:appcast]; + if (!self.aborted) { + if ([self.updaterDelegate respondsToSelector:@selector(updater:didFinishLoadingAppcast:)]) { + [self.updaterDelegate updater:self.updater didFinishLoadingAppcast:appcast]; + } + + [self notifyFinishLoadingAppcast]; } - - [self notifyFinishLoadingAppcast]; } - (void)didFindValidUpdateWithAppcastItem:(SUAppcastItem *)updateItem { - [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification - object:self.updater - userInfo:@{ SUUpdaterAppcastItemNotificationKey: updateItem }]; - - if ([self.updaterDelegate respondsToSelector:@selector(updater:didFindValidUpdate:)]) { - [self.updaterDelegate updater:self.updater didFindValidUpdate:updateItem]; + if (!self.aborted) { + [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification + object:self.updater + userInfo:@{ SUUpdaterAppcastItemNotificationKey: updateItem }]; + + if ([self.updaterDelegate respondsToSelector:@selector(updater:didFindValidUpdate:)]) { + [self.updaterDelegate updater:self.updater didFindValidUpdate:updateItem]; + } + + [self.delegate basicDriverDidFindUpdateWithAppcastItem:updateItem]; } - - [self.delegate basicDriverDidFindUpdateWithAppcastItem:updateItem]; } - (void)didNotFindUpdate { - if ([self.updaterDelegate respondsToSelector:@selector(updaterDidNotFindUpdate:)]) { - [self.updaterDelegate updaterDidNotFindUpdate:self.updater]; + if (!self.aborted) { + if ([self.updaterDelegate respondsToSelector:@selector(updaterDidNotFindUpdate:)]) { + [self.updaterDelegate updaterDidNotFindUpdate:self.updater]; + } + [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:self.updater]; + + NSError *notFoundError = + [NSError + errorWithDomain:SUSparkleErrorDomain + code:SUNoUpdateError + userInfo:@{ + NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", "'Error' message when the user checks for updates but is already current or the feed doesn't contain any updates. (not necessarily shown in UI)"), self.host.name] + } + ]; + [self.delegate basicDriverIsRequestingAbortUpdateWithError:notFoundError]; } - [[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:self.updater]; - - NSError *notFoundError = - [NSError - errorWithDomain:SUSparkleErrorDomain - code:SUNoUpdateError - userInfo:@{ - NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", "'Error' message when the user checks for updates but is already current or the feed doesn't contain any updates. (not necessarily shown in UI)"), self.host.name] - } - ]; - [self.delegate basicDriverIsRequestingAbortUpdateWithError:notFoundError]; } -- (void)abortUpdateWithError:(nullable NSError *)error +- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldShowUpdateImmediately downloadedUpdate:(SUDownloadedUpdate * _Nullable)downloadedUpdate error:(nullable NSError *)error { + self.aborted = YES; + if (error != nil) { - if ([error code] != SUNoUpdateError) { // Let's not bother logging this. + if (error.code != SUNoUpdateError && error.code != SUInstallationCanceledError && error.code != SUInstallationAuthorizeLaterError) { // Let's not bother logging this. NSError *errorToDisplay = error; int finiteRecursion=5; do { @@ -160,7 +185,7 @@ } if (self.completionBlock != nil) { - self.completionBlock([self.delegate basicDriverShouldSignalShowingUpdateImmediately]); + self.completionBlock(shouldShowUpdateImmediately, downloadedUpdate); self.completionBlock = nil; } } diff --git a/Sparkle/SUBundleIcon.h b/Sparkle/SUBundleIcon.h new file mode 100644 index 00000000..f42be2fd --- /dev/null +++ b/Sparkle/SUBundleIcon.h @@ -0,0 +1,19 @@ +// +// SUBundleIcon.h +// Sparkle +// +// Created by Mayur Pawashe on 7/24/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface SUBundleIcon : NSObject + ++ (NSURL * _Nullable)iconURLForBundle:(NSBundle *)bundle; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sparkle/SUBundleIcon.m b/Sparkle/SUBundleIcon.m new file mode 100644 index 00000000..30a831a8 --- /dev/null +++ b/Sparkle/SUBundleIcon.m @@ -0,0 +1,33 @@ +// +// SUBundleIcon.m +// Sparkle +// +// Created by Mayur Pawashe on 7/24/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import "SUBundleIcon.h" + +#ifdef _APPKITDEFINES_H +#error This is a "core" class and should NOT import AppKit +#endif + +@implementation SUBundleIcon + ++ (NSURL *)iconURLForBundle:(NSBundle *)bundle +{ + NSString *resource = [bundle objectForInfoDictionaryKey:@"CFBundleIconFile"]; + if (resource == nil || ![resource isKindOfClass:[NSString class]]) { + return nil; + } + + NSURL *iconURL = [bundle URLForResource:resource withExtension:@"icns"]; + + // The resource could already be containing the path extension, so try again without the extra extension + if (iconURL == nil) { + iconURL = [bundle URLForResource:resource withExtension:nil]; + } + return iconURL; +} + +@end diff --git a/Sparkle/SUConstants.h b/Sparkle/SUConstants.h index ff36ab3b..ec0bad29 100644 --- a/Sparkle/SUConstants.h +++ b/Sparkle/SUConstants.h @@ -66,6 +66,7 @@ extern NSString *const SUAppcastAttributeDeltaFrom; extern NSString *const SUAppcastAttributeDSASignature; extern NSString *const SUAppcastAttributeShortVersionString; extern NSString *const SUAppcastAttributeVersion; +extern NSString *const SUAppcastAttributeInstallationType; extern NSString *const SUAppcastElementCriticalUpdate; extern NSString *const SUAppcastElementDeltas; diff --git a/Sparkle/SUConstants.m b/Sparkle/SUConstants.m index 2c69d8ae..8e892e0e 100644 --- a/Sparkle/SUConstants.m +++ b/Sparkle/SUConstants.m @@ -64,6 +64,7 @@ NSString *const SUAppcastAttributeDeltaFrom = @"sparkle:deltaFrom"; NSString *const SUAppcastAttributeDSASignature = @"sparkle:dsaSignature"; NSString *const SUAppcastAttributeShortVersionString = @"sparkle:shortVersionString"; NSString *const SUAppcastAttributeVersion = @"sparkle:version"; +NSString *const SUAppcastAttributeInstallationType = @"sparkle:installationType"; NSString *const SUAppcastElementCriticalUpdate = @"sparkle:criticalUpdate"; NSString *const SUAppcastElementDeltas = @"sparkle:deltas"; diff --git a/Sparkle/SUCoreBasedUpdateDriver.h b/Sparkle/SUCoreBasedUpdateDriver.h index 97d4d94e..143b8e06 100644 --- a/Sparkle/SUCoreBasedUpdateDriver.h +++ b/Sparkle/SUCoreBasedUpdateDriver.h @@ -25,8 +25,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error; -- (BOOL)basicDriverShouldSignalShowingUpdateImmediately; - @optional - (void)basicDriverDidFinishLoadingAppcast; @@ -37,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)downloadDriverDidReceiveDataOfLength:(NSUInteger)length; -- (void)coreDriverDidFinishDownloadingUpdate; +- (void)coreDriverDidStartExtractingUpdate; - (void)installerDidStartInstalling; @@ -53,15 +51,21 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithHost:(SUHost *)host sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(nullable id )updaterDelegate delegate:(id)delegate; -- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock; +- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates requiresSilentInstall:(BOOL)silentInstall completion:(SUUpdateDriverCompletion)completionBlock; -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock; +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock; + +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock; - (void)downloadUpdateFromAppcastItem:(SUAppcastItem *)updateItem; +- (void)extractDownloadedUpdate; + +- (void)clearDownloadedUpdate; + - (void)finishInstallationWithResponse:(SUInstallUpdateStatus)installUpdateStatus displayingUserInterface:(BOOL)displayingUserInterface; -- (void)abortUpdateWithError:(nullable NSError *)error; +- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldShowUpdateImmediately error:(nullable NSError *)error; @end diff --git a/Sparkle/SUCoreBasedUpdateDriver.m b/Sparkle/SUCoreBasedUpdateDriver.m index 4fe5d179..371e923f 100644 --- a/Sparkle/SUCoreBasedUpdateDriver.m +++ b/Sparkle/SUCoreBasedUpdateDriver.m @@ -14,6 +14,8 @@ #import "SUDownloadDriver.h" #import "SULocalCacheDirectory.h" #import "SULog.h" +#import "SUErrors.h" +#import "SUDownloadedUpdate.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -26,9 +28,11 @@ @property (nonatomic, readonly) SUInstallerDriver *installerDriver; @property (nonatomic, weak, readonly) id delegate; @property (nonatomic) SUAppcastItem *updateItem; +@property (nonatomic) SUDownloadedUpdate *downloadedUpdate; @property (nonatomic, readonly) SUHost *host; -@property (nonatomic) BOOL resumingUpdate; +@property (nonatomic) BOOL resumingInstallingUpdate; +@property (nonatomic) BOOL silentInstall; @property (nonatomic, readonly, weak) id updater; // if we didn't have legacy support, I'd remove this.. @property (nullable, nonatomic, readonly, weak) id updaterDelegate; @property (nonatomic) NSString *userAgent; @@ -43,10 +47,12 @@ @synthesize delegate = _delegate; @synthesize updateItem = _updateItem; @synthesize host = _host; -@synthesize resumingUpdate = _resumingUpdate; +@synthesize resumingInstallingUpdate = _resumingInstallingUpdate; +@synthesize silentInstall = _silentInstall; @synthesize updater = _updater; @synthesize updaterDelegate = _updaterDelegate; @synthesize userAgent = _userAgent; +@synthesize downloadedUpdate = _downloadedUpdate; - (instancetype)initWithHost:(SUHost *)host sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(nullable id )updaterDelegate delegate:(id)delegate { @@ -68,17 +74,28 @@ return self; } -- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock +- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates requiresSilentInstall:(BOOL)silentInstall completion:(SUUpdateDriverCompletion)completionBlock { self.userAgent = userAgent; + self.silentInstall = silentInstall; [self.basicDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:includesSkippedUpdates completion:completionBlock]; } -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock { - self.resumingUpdate = YES; - [self.basicDriver resumeUpdateWithCompletion:completionBlock]; + self.resumingInstallingUpdate = YES; + self.silentInstall = NO; + + [self.basicDriver resumeInstallingUpdateWithCompletion:completionBlock]; +} + +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock +{ + self.downloadedUpdate = downloadedUpdate; + self.silentInstall = NO; + + [self.basicDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; } - (void)basicDriverDidFinishLoadingAppcast @@ -92,8 +109,8 @@ { self.updateItem = updateItem; - if (self.resumingUpdate) { - [self.installerDriver resumeUpdateWithUpdateItem:updateItem]; + if (self.resumingInstallingUpdate) { + [self.installerDriver resumeInstallingUpdateWithUpdateItem:updateItem]; } [self.delegate basicDriverDidFindUpdateWithAppcastItem:updateItem]; @@ -133,22 +150,37 @@ } } -- (void)downloadDriverDidDownloadUpdate +- (void)downloadDriverDidDownloadUpdate:(SUDownloadedUpdate *)downloadedUpdate +{ + self.downloadedUpdate = downloadedUpdate; + [self extractUpdate:downloadedUpdate]; +} + +- (void)extractDownloadedUpdate +{ + assert(self.downloadedUpdate != nil); + [self extractUpdate:self.downloadedUpdate]; +} + +- (void)clearDownloadedUpdate +{ + self.downloadedUpdate = nil; +} + +- (void)extractUpdate:(SUDownloadedUpdate *)downloadedUpdate { // Now we have to extract the downloaded archive. - if ([self.delegate respondsToSelector:@selector(coreDriverDidFinishDownloadingUpdate)]) { - [self.delegate coreDriverDidFinishDownloadingUpdate]; + if ([self.delegate respondsToSelector:@selector(coreDriverDidStartExtractingUpdate)]) { + [self.delegate coreDriverDidStartExtractingUpdate]; } - NSString *downloadName = self.downloadDriver.downloadName; - assert(downloadName != nil); - - NSString *temporaryDirectory = self.downloadDriver.temporaryDirectory; - assert(temporaryDirectory != nil); - - [self.installerDriver extractDownloadName:downloadName withUpdateItem:self.updateItem temporaryDirectory:temporaryDirectory completion:^(NSError * _Nullable error) { + [self.installerDriver extractDownloadedUpdate:downloadedUpdate silently:self.silentInstall completion:^(NSError * _Nullable error) { if (error != nil) { [self.delegate coreDriverIsRequestingAbortUpdateWithError:error]; + } else { + // If the installer started properly, we can't use the downloaded update archive anymore + // Especially if the installer fails later and we try resuming the update with a missing archive file + [self clearDownloadedUpdate]; } }]; } @@ -243,21 +275,20 @@ SUAppcastItem *nonDeltaUpdateItem = self.basicDriver.nonDeltaUpdateItem; assert(nonDeltaUpdateItem != nil); + [self clearDownloadedUpdate]; + // Fall back to the non-delta update. Note that we don't want to trigger another update was found event. self.updateItem = nonDeltaUpdateItem; [self downloadUpdateFromAppcastItem:nonDeltaUpdateItem]; } -- (BOOL)basicDriverShouldSignalShowingUpdateImmediately -{ - return [self.delegate basicDriverShouldSignalShowingUpdateImmediately]; -} - -- (void)abortUpdateWithError:(nullable NSError *)error +- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldShowUpdateImmediately error:(nullable NSError *)error { [self.installerDriver abortInstall]; [self.downloadDriver cleanup]; - [self.basicDriver abortUpdateWithError:error]; + + SUDownloadedUpdate *downloadedUpdate = (error == nil || error.code == SUInstallationAuthorizeLaterError) ? self.downloadedUpdate : nil; + [self.basicDriver abortUpdateAndShowNextUpdateImmediately:shouldShowUpdateImmediately downloadedUpdate:downloadedUpdate error:error]; } @end diff --git a/Sparkle/SUDownloadDriver.h b/Sparkle/SUDownloadDriver.h index cecc3a11..a38c0867 100644 --- a/Sparkle/SUDownloadDriver.h +++ b/Sparkle/SUDownloadDriver.h @@ -10,6 +10,8 @@ NS_ASSUME_NONNULL_BEGIN +@class SUAppcastItem, SUHost, SUDownloadedUpdate; + @protocol SUDownloadDriverDelegate - (void)downloadDriverWillBeginDownload; @@ -18,14 +20,12 @@ NS_ASSUME_NONNULL_BEGIN - (void)downloadDriverDidReceiveDataOfLength:(NSUInteger)length; -- (void)downloadDriverDidDownloadUpdate; +- (void)downloadDriverDidDownloadUpdate:(SUDownloadedUpdate *)downloadedUpdate; - (void)downloadDriverDidFailToDownloadUpdateWithError:(NSError *)error; @end -@class SUAppcastItem, SUHost; - @interface SUDownloadDriver : NSObject - (instancetype)initWithUpdateItem:(SUAppcastItem *)updateItem host:(SUHost *)host userAgent:(NSString *)userAgent delegate:(id)delegate; @@ -33,8 +33,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)downloadUpdate; @property (nonatomic, readonly) NSMutableURLRequest *request; -@property (nullable, nonatomic, readonly, copy) NSString *temporaryDirectory; -@property (nullable, nonatomic, readonly, copy) NSString *downloadName; - (void)cleanup; diff --git a/Sparkle/SUDownloadDriver.m b/Sparkle/SUDownloadDriver.m index 531202f2..06971194 100644 --- a/Sparkle/SUDownloadDriver.m +++ b/Sparkle/SUDownloadDriver.m @@ -17,6 +17,7 @@ #import "SULog.h" #import "SUErrors.h" #import "SUURLRequest.h" +#import "SUDownloadedUpdate.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -34,6 +35,7 @@ @property (nonatomic) BOOL retrievedDownloadResult; @property (nonatomic) BOOL retrievedDownloadResponse; @property (nonatomic) NSUInteger expectedContentLength; +@property (nonatomic) BOOL cleaningUp; @end @@ -50,6 +52,7 @@ @synthesize retrievedDownloadResult = _retrievedDownloadResult; @synthesize retrievedDownloadResponse = _retrievedDownloadResponse; @synthesize expectedContentLength = _expectedContentLength; +@synthesize cleaningUp = _cleaningUp; - (instancetype)initWithUpdateItem:(SUAppcastItem *)updateItem host:(SUHost *)host userAgent:(NSString *)userAgent delegate:(id)delegate { @@ -97,7 +100,7 @@ self.connection.invalidationHandler = ^{ dispatch_async(dispatch_get_main_queue(), ^{ SUDownloadDriver *strongSelf = weakSelf; - if (strongSelf != nil && !strongSelf.retrievedDownloadResult) { + if (strongSelf != nil && !strongSelf.retrievedDownloadResult && !strongSelf.cleaningUp) { SULog(@"Connection to update downloader was invalidated"); NSDictionary *userInfo = @@ -118,15 +121,14 @@ [self.downloader startDownloadWithRequest:[SUURLRequest URLRequestWithRequest:self.request] bundleIdentifier:bundleIdentifier desiredFilename:desiredFilename]; } -- (void)dealloc -{ - [self cleanup]; -} - - (void)cleanup { // It's very crucial to wait until they are done with completion before invalidating our XPC connection (if there is one) // Otherwise we can run into some unfortunate crashes + // Edit: I think this was an issue because -dealloc was implemented to invoke this method. I have since removed -dealloc + // Will have to test around with this later + self.cleaningUp = YES; + [self.downloader cleanupWithCompletion:^{ dispatch_async(dispatch_get_main_queue(), ^{ if (self.connection != nil) { @@ -148,7 +150,9 @@ SULog(@"Warning: Downloader's expected content length (%lu) != Appcast item's length (%lu)", self.expectedContentLength, self.updateItem.contentLength); } - [self.delegate downloadDriverDidDownloadUpdate]; + SUDownloadedUpdate *downloadedUpdate = [[SUDownloadedUpdate alloc] initWithAppcastItem:self.updateItem downloadName:self.downloadName temporaryDirectory:self.temporaryDirectory]; + + [self.delegate downloadDriverDidDownloadUpdate:downloadedUpdate]; [self cleanup]; }); } diff --git a/Sparkle/SUDownloadedUpdate.h b/Sparkle/SUDownloadedUpdate.h new file mode 100644 index 00000000..fd729dae --- /dev/null +++ b/Sparkle/SUDownloadedUpdate.h @@ -0,0 +1,25 @@ +// +// SUDownloadedUpdate.h +// Sparkle +// +// Created by Mayur Pawashe on 7/18/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class SUAppcastItem; + +@interface SUDownloadedUpdate : NSObject + +- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem downloadName:(NSString *)downloadName temporaryDirectory:(NSString *)temporaryDirectory; + +@property (nonatomic, readonly) SUAppcastItem *updateItem; +@property (nonatomic, copy, readonly) NSString *downloadName; +@property (nonatomic, copy, readonly) NSString *temporaryDirectory; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sparkle/SUDownloadedUpdate.m b/Sparkle/SUDownloadedUpdate.m new file mode 100644 index 00000000..2d7577bb --- /dev/null +++ b/Sparkle/SUDownloadedUpdate.m @@ -0,0 +1,28 @@ +// +// SUDownloadedUpdate.m +// Sparkle +// +// Created by Mayur Pawashe on 7/18/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import "SUDownloadedUpdate.h" + +@implementation SUDownloadedUpdate + +@synthesize updateItem = _updateItem; +@synthesize downloadName = _downloadName; +@synthesize temporaryDirectory = _temporaryDirectory; + +- (instancetype)initWithAppcastItem:(SUAppcastItem *)updateItem downloadName:(NSString *)downloadName temporaryDirectory:(NSString *)temporaryDirectory +{ + self = [super init]; + if (self != nil) { + _updateItem = updateItem; + _downloadName = [downloadName copy]; + _temporaryDirectory = [temporaryDirectory copy]; + } + return self; +} + +@end diff --git a/Sparkle/SUErrors.h b/Sparkle/SUErrors.h index cbcb70f5..aae5ca7b 100644 --- a/Sparkle/SUErrors.h +++ b/Sparkle/SUErrors.h @@ -54,7 +54,8 @@ typedef NS_ENUM(OSStatus, SUError) { SURelaunchError = 4004, SUInstallationError = 4005, SUDowngradeError = 4006, - SUInstallationCancelledError = 4007 + SUInstallationCanceledError = 4007, + SUInstallationAuthorizeLaterError = 4008 }; #endif diff --git a/Sparkle/SUFileManager.h b/Sparkle/SUFileManager.h index 552e8e5d..9ab64a22 100644 --- a/Sparkle/SUFileManager.h +++ b/Sparkle/SUFileManager.h @@ -9,8 +9,6 @@ #import #import "SUExport.h" -@class SUAuthorizationEnvironment; - NS_ASSUME_NONNULL_BEGIN /** @@ -27,37 +25,6 @@ NS_ASSUME_NONNULL_BEGIN */ + (instancetype)defaultManager; -/** - * Creates a file manager that allows authorizing for file operations - * @param authorizationToolPath Specifies the path to the tool that can perform file operations and be run as root. - * This tool will be invoked when read or write access is denied when attempting ordinary file operations. See the `fileop` tool included in Sparkle. - * @param environment Specifies the authorization environment used when making an authorization request. Pass nil to use a default environment. - * @return A new file manager instance - * - * This method just creates the file manager. It doesn't acquire authorization immediately or if it doesn't need to. - */ -+ (instancetype)fileManagerWithAuthorizationToolPath:(NSString *)authorizationToolPath environment:(SUAuthorizationEnvironment * _Nullable)environment; - -/** - * Returns a file manager that allows or disallows authorizing for file operations based on the current file manager - * @return A file manager instance that can perform authorized operations if the current file manager has already performed them. - * If the current file manager instance hasn't yet performed authorized operations, then neither can the instance returned by this method - * - * This may return a newly created file manager or re-use the existing file manager depending on the current authorization rights. - */ -- (instancetype)fileManagerByPreservingAuthorizationRights; - -/** - * Requests and grants authorization for performing authorized operations. - * - * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. An error code of SUInstallationCancelledError is returned if an authorization prompt occurs and the user decides to cancel the request. - * @return YES on success otherwise returns NO - * - * This will prompt the user for an authorization dialog if the user's permission is needed to perform authorized operations. - * If the process is running as root already, no authorization prompt is made. - */ -- (BOOL)grantAuthorizationPrivilegesWithError:(NSError * __autoreleasing *)error; - /** * Creates a temporary directory on the same volume as a provided URL * @param preferredName A name that may be used when creating the temporary directory. Note that in the uncothirdStageErrormmon case this name is used, the temporary directory will be created inside the directory pointed by appropriateURL @@ -188,18 +155,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)releaseItemFromQuarantineAtRootURL:(NSURL *)rootURL error:(NSError **)error; -/** - * Runs an installer package (pkg) in a headless mode using /usr/sbin/installer - * @param packageURL A URL pointing to the package to execute. The item at this URL must exist. - * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. - * @return YES if the installer ran the package successfully, otherwise NO with a populated error object - * - * This method uses the system wide installer tool to run the provided package. This process does not show any UI, except for - * an initial authorization prompt if the calling process does not have root privileges. In other words, root privileges are required to use this method, and the file manager instance must have been created by allowing authorization. - * An error can occur if the package is unable to be ran by the installer, or if the installer reports a non-zero exit status code. - */ -- (BOOL)executePackageAtURL:(NSURL *)packageURL error:(NSError **)error; - @end NS_ASSUME_NONNULL_END diff --git a/Sparkle/SUFileManager.m b/Sparkle/SUFileManager.m index 63c1e294..09907295 100644 --- a/Sparkle/SUFileManager.m +++ b/Sparkle/SUFileManager.m @@ -7,10 +7,7 @@ // #import "SUFileManager.h" -#import "SUAuthorizationEnvironment.h" -#import #import "SUErrors.h" -#import "SUFileOperationConstants.h" #include #include @@ -46,179 +43,27 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return YES; } -// Used to indicate if the type of NSError requires us to attempt to peform the same operation again except with authentication -// To be safe, both read and write permission denied's are included because Cocoa's error methods are not very well documented -// and at least one case is caused from lack of read permissions (-[NSURL setResourceValue:forKey:error:]) -#define NS_HAS_PERMISSION_ERROR(error) (error.code == NSFileReadNoPermissionError || error.code == NSFileWriteNoPermissionError) - #pragma clang diagnostic push // Use direct access because it's easier, clearer, and faster #pragma clang diagnostic ignored "-Wdirect-ivar-access" @implementation SUFileManager { - AuthorizationRef _auth; NSFileManager *_fileManager; - NSString *_authorizationToolPath; - SUAuthorizationEnvironment *_environment; } -- (instancetype)initWithAuthorizationToolPath:(NSString *)authorizationToolPath environment:(SUAuthorizationEnvironment *)environment +- (instancetype)init { self = [super init]; if (self != nil) { _fileManager = [[NSFileManager alloc] init]; - _authorizationToolPath = [authorizationToolPath copy]; - _environment = environment; } return self; } + (instancetype)defaultManager { - return [[self alloc] initWithAuthorizationToolPath:nil environment:nil]; -} - -+ (instancetype)fileManagerWithAuthorizationToolPath:(NSString *)authorizationToolPath environment:(SUAuthorizationEnvironment * _Nullable)environment -{ - return [[self alloc] initWithAuthorizationToolPath:authorizationToolPath environment:environment]; -} - -- (instancetype)fileManagerByPreservingAuthorizationRights -{ - // Check if we don't allow authorization, or that we haven't needed to authorize yet, to create or re-use a - // file manager instance with these restrictions - return (_authorizationToolPath != nil && _auth != NULL) ? self : [SUFileManager defaultManager]; -} - -// Acquires an authorization reference with root privileges which is intended to be used for authorized file operations -- (BOOL)_acquireAuthorizationWithError:(NSError *__autoreleasing *)error -{ - // No need to continue if we already acquired an authorization reference - if (_auth != NULL) { - return YES; - } - - if (_authorizationToolPath == nil) { - if (error != NULL) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey: @"Unable to grant authorization to perform action because it is explicitly turned off" }]; - } - return NO; - } - - // This should almost always succeed, fail in unusual/rare cases - OSStatus createStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &_auth); - if (createStatus != errAuthorizationSuccess) { - if (error != NULL) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed creating authorization reference with status code %d.", createStatus] }]; - } - _auth = NULL; - return NO; - } - - AuthorizationItem rightItems[] = { - // The right that allows us to run tools as root user - {.name = kAuthorizationRightExecute, .valueLength = 0, .value = NULL, .flags = 0} - }; - - AuthorizationRights rights = { - .count = sizeof(rightItems) / sizeof(*rightItems), - .items = rightItems - }; - - AuthorizationFlags flags = - (AuthorizationFlags)(kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagExtendRights | kAuthorizationFlagPreAuthorize); - - // This will test if we can gain authorization for running utlities as root - OSStatus copyStatus = AuthorizationCopyRights(_auth, &rights, (_environment != nil ? _environment.environment : kAuthorizationEmptyEnvironment), flags, NULL); - if (copyStatus != errAuthorizationSuccess) { - if (error != NULL) { - if (copyStatus == errAuthorizationCanceled) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationCancelledError userInfo:@{ NSLocalizedDescriptionKey: @"Authorization access was cancelled by the user." }]; - } else { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed granting authorization rights with status code %d.", copyStatus] }]; - } - } - - AuthorizationFree(_auth, kAuthorizationFlagDefaults); - _auth = NULL; - - return NO; - } - - return YES; -} - -- (BOOL)_authorizeAndExecuteCommand:(char *)command sourcePath:(char *)sourcePath destinationPath:(char *)destinationPath error:(NSError * __autoreleasing *)error -{ - NSError *acquireError = nil; - if (![self _acquireAuthorizationWithError:&acquireError]) { - if (error != NULL) { - *error = acquireError; - } - return NO; - } - - char *arguments[] = { command, sourcePath, destinationPath, NULL }; - - char toolPath[PATH_MAX] = {0}; - if (![_authorizationToolPath getFileSystemRepresentation:toolPath maxLength:sizeof(toolPath)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Authorization tool (%@) cannot be represented as a valid file name.", _authorizationToolPath.lastPathComponent] }]; - } - return NO; - } - - FILE *pipe = NULL; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - if (AuthorizationExecuteWithPrivileges(_auth, toolPath, kAuthorizationFlagDefaults, arguments, &pipe) != errAuthorizationSuccess) { -#pragma clang diagnostic pop - if (error != NULL) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:@"Failed to run authorization tool." }]; - } - return NO; - } - - uint32_t pidData = 0; - if (fread(&pidData, sizeof(pidData), 1, pipe) < 1) { - if (error != NULL) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:@"Failed to retrieve authorized executable process identifier." }]; - } - fclose(pipe); - return NO; - } - - pid_t childPid = (int32_t)CFSwapInt32LittleToHost(pidData); - int status = 0; - - pid_t waitResult; - do { - waitResult = waitpid(childPid, &status, 0); - } while (waitResult == -1 && errno == EINTR); - - fclose(pipe); - - if (waitResult == -1 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) { - if (error != NULL) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed to execute authorized executable with result %d and status (%d, %d, %d).", waitResult, status, WIFEXITED(status), WEXITSTATUS(status)] }]; - } - return NO; - } - - return YES; -} - -- (void)dealloc -{ - if (_auth != NULL) { - AuthorizationFree(_auth, kAuthorizationFlagDefaults); - } -} - -- (BOOL)grantAuthorizationPrivilegesWithError:(NSError * __autoreleasing *)error -{ - return [self _acquireAuthorizationWithError:error]; + return [[self alloc] init]; } // -[NSFileManager attributesOfItemAtPath:error:] won't follow symbolic links @@ -275,36 +120,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return removexattr(path, attr, options); } -#define XATTR_UTILITY_PATH "/usr/bin/xattr" -// Recursively remove an xattr at a specified root URL with authentication -- (BOOL)_removeQuarantineWithAuthenticationAtRootURL:(NSURL *)rootURL error:(NSError *__autoreleasing *)error -{ - // Because this is a system utility, it's fine to follow the symbolic link if one exists - if (![_fileManager fileExistsAtPath:@(XATTR_UTILITY_PATH)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileNoSuchFileError userInfo:@{ NSLocalizedDescriptionKey: @"xattr utility does not exist on this system." }]; - } - return NO; - } - - char path[PATH_MAX] = {0}; - if (![rootURL.path getFileSystemRepresentation:path maxLength:sizeof(path)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"File to remove (%@) cannot be represented as a valid file name.", rootURL.path.lastPathComponent] }]; - } - return NO; - } - - NSError *executeError = nil; - BOOL success = [self _authorizeAndExecuteCommand:SUFileOpRemoveQuarantineCommand sourcePath:path destinationPath:NULL error:&executeError]; - if (!success && error != NULL) { - *error = executeError; - } - - return success; -} - -- (BOOL)_releaseItemFromQuarantineAtRootURL:(NSURL *)rootURL withQuarantineRetrieval:(BOOL (^)(NSURL *))quarantineRetrieval quarantineRemoval:(BOOL (^)(NSURL *, NSError * __autoreleasing *))quarantineRemoval isAccessError:(BOOL (^)(NSError *))isAccessError error:(NSError * __autoreleasing *)error +- (BOOL)_releaseItemFromQuarantineAtRootURL:(NSURL *)rootURL withQuarantineRetrieval:(BOOL (^)(NSURL *))quarantineRetrieval quarantineRemoval:(BOOL (^)(NSURL *, NSError * __autoreleasing *))quarantineRemoval error:(NSError * __autoreleasing *)error { if (![self _itemExistsAtURL:rootURL]) { if (error != NULL) { @@ -322,18 +138,13 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { if (quarantineRemoval(fileURL, &removalError)) { removedQuarantine = YES; } else { - if (isAccessError(removalError)) { - removedQuarantine = [self _removeQuarantineWithAuthenticationAtRootURL:rootURL error:error]; - attemptedAuthentication = YES; - } else { - if (success != NULL) { - // Make sure we haven't already run into an error - if (*success && error != NULL) { - *error = removalError; - } - // Fail, but still try to release other items from quarantine - *success = NO; + if (success != NULL) { + // Make sure we haven't already run into an error + if (*success && error != NULL) { + *error = removalError; } + // Fail, but still try to release other items from quarantine + *success = NO; } } } @@ -400,6 +211,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { { static const int removeXAttrOptions = XATTR_NOFOLLOW; +#warning this code is over complicated now, needs to be rewritten return [self _releaseItemFromQuarantineAtRootURL:rootURL @@ -413,9 +225,6 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { } return removedQuarantine; } - isAccessError:^BOOL(NSError *removalError) { - return (removalError.code == EACCES); - } error:error]; } @@ -464,43 +273,13 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { #pragma clang diagnostic ignored "-Wdeprecated-declarations" OSStatus copyResult = FSCopyObjectSync(&sourceRef, &destinationParentRef, (__bridge CFStringRef)(destinationURL.lastPathComponent), NULL, kFSFileOperationDefaultOptions); #pragma clang diagnostic pop - if (copyResult == noErr) { - return YES; - } - - // Note: I have received afpAccessDenied error in testing even when not copying from/to an AFP mount, - // when the error should have been a normal permission denied one - if (copyResult != permErr && copyResult != afpAccessDenied) { + + if (copyResult != noErr) { if (error != NULL) { *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:copyResult userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to copy file (%@)", sourceURL.lastPathComponent] }]; } - return NO; - } - - char sourcePath[PATH_MAX] = {0}; - if (![sourceURL.path getFileSystemRepresentation:sourcePath maxLength:sizeof(sourcePath)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Destination to copy file to (%@) cannot be represented as a valid file name.", sourceURL.lastPathComponent] }]; - } - return NO; - } - - char destinationPath[PATH_MAX] = {0}; - if (![destinationURL.path getFileSystemRepresentation:destinationPath maxLength:sizeof(destinationPath)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Destination to copy file to (%@) cannot be represented as a valid file name.", destinationURL.lastPathComponent] }]; - } - return NO; } - NSError *executeError = nil; - if (![self _authorizeAndExecuteCommand:SUFileOpCopyCommand sourcePath:sourcePath destinationPath:destinationPath error:&executeError]) { - if (error != NULL) { - *error = executeError; - } - return NO; - } - return YES; } @@ -572,48 +351,11 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { if (foundSourceVolume && foundDestinationVolume && sourceVolume != destinationVolume) { return ([self copyItemAtURL:sourceURL toURL:destinationURL error:error] && [self removeItemAtURL:sourceURL error:error]); } - - NSError *moveError = nil; - if ([_fileManager moveItemAtURL:sourceURL toURL:destinationURL error:&moveError]) { - return YES; - } - - if (!NS_HAS_PERMISSION_ERROR(moveError)) { - if (error != NULL) { - *error = moveError; - } - return NO; - } - - char sourcePath[PATH_MAX] = {0}; - if (![sourceURL.path getFileSystemRepresentation:sourcePath maxLength:sizeof(sourcePath)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"File to move (%@) cannot be represented as a valid file name.", sourceURL.path.lastPathComponent] }]; - } - return NO; - } - - char destinationPath[PATH_MAX] = {0}; - if (![destinationURL.path getFileSystemRepresentation:destinationPath maxLength:sizeof(destinationPath)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Destination (%@) cannot be represented as a valid file name.", destinationURL.path.lastPathComponent] }]; - } - return NO; - } - NSError *executeError = nil; - if (![self _authorizeAndExecuteCommand:SUFileOpMoveCommand sourcePath:sourcePath destinationPath:destinationPath error:&executeError]) { - if (error != NULL) { - NSString *errorMessage = [NSString stringWithFormat:@"Failed to perform authorized file move for %@.", sourceURL.lastPathComponent]; - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:errorMessage, NSUnderlyingErrorKey: executeError }]; - } - return NO; - } - - return YES; + return [_fileManager moveItemAtURL:sourceURL toURL:destinationURL error:error]; } -- (BOOL)_changeOwnerAndGroupOfItemAtURL:(NSURL *)targetURL ownerID:(NSNumber *)ownerID groupID:(NSNumber *)groupID needsAuth:(BOOL *)needsAuth error:(NSError * __autoreleasing *)error +- (BOOL)_changeOwnerAndGroupOfItemAtURL:(NSURL *)targetURL ownerID:(NSNumber *)ownerID groupID:(NSNumber *)groupID error:(NSError * __autoreleasing *)error { char path[PATH_MAX] = {0}; if (![targetURL.path getFileSystemRepresentation:path maxLength:sizeof(path)]) { @@ -632,23 +374,16 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { } // We use fchown instead of chown because the latter can follow symbolic links - BOOL success = fchown(fileDescriptor, ownerID.unsignedIntValue, groupID.unsignedIntValue) == 0; + BOOL success = (fchown(fileDescriptor, ownerID.unsignedIntValue, groupID.unsignedIntValue) == 0); close(fileDescriptor); if (!success) { - if (errno == EPERM) { - if (needsAuth != NULL) { - *needsAuth = YES; - } - } else { - if (error != NULL) { - *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to change owner & group for %@ with owner ID %u and group ID %u.", targetURL.path.lastPathComponent, ownerID.unsignedIntValue, groupID.unsignedIntValue] }]; - } - return NO; + if (error != NULL) { + *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to change owner & group for %@ with owner ID %u and group ID %u.", targetURL.path.lastPathComponent, ownerID.unsignedIntValue, groupID.unsignedIntValue] }]; } } - return YES; + return success; } - (BOOL)changeOwnerAndGroupOfItemAtRootURL:(NSURL *)targetURL toMatchURL:(NSURL *)matchURL error:(NSError * __autoreleasing *)error @@ -715,53 +450,20 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return YES; } - BOOL needsAuth = NO; - - if (![self _changeOwnerAndGroupOfItemAtURL:targetURL ownerID:ownerID groupID:groupID needsAuth:&needsAuth error:error]) { + if (![self _changeOwnerAndGroupOfItemAtURL:targetURL ownerID:ownerID groupID:groupID error:error]) { return NO; } if (isTargetADirectory) { NSDirectoryEnumerator *directoryEnumerator = [_fileManager enumeratorAtURL:targetURL includingPropertiesForKeys:nil options:(NSDirectoryEnumerationOptions)0 errorHandler:nil]; for (NSURL *url in directoryEnumerator) { - if (![self _changeOwnerAndGroupOfItemAtURL:url ownerID:ownerID groupID:groupID needsAuth:&needsAuth error:error]) { + if (![self _changeOwnerAndGroupOfItemAtURL:url ownerID:ownerID groupID:groupID error:error]) { return NO; } - - if (needsAuth) { - break; - } } } - - if (!needsAuth) { - return YES; - } - - char targetPath[PATH_MAX] = {0}; - if (![targetURL.path getFileSystemRepresentation:targetPath maxLength:sizeof(targetPath)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Target file (%@) cannot be represented as a valid file name.", targetURL.path.lastPathComponent] }]; - } - return NO; - } - char matchPath[PATH_MAX] = {0}; - if (![matchURLPath getFileSystemRepresentation:matchPath maxLength:sizeof(matchPath)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Match file (%@) cannot be represented as a valid file name.", matchURL.path.lastPathComponent] }]; - } - return NO; - } - - NSError *executeError = nil; - BOOL success = [self _authorizeAndExecuteCommand:SUFileOpChangeOwnerAndGroupCommand sourcePath:targetPath destinationPath:matchPath error:&executeError]; - if (!success && error != NULL) { - NSString *errorMessage = [NSString stringWithFormat:@"Failed to change owner & group on %@ to match %@ with authorization.", targetURL.path.lastPathComponent, matchURLPath.lastPathComponent]; - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey: errorMessage, NSUnderlyingErrorKey: executeError }]; - } - - return success; + return YES; } - (BOOL)_updateItemAtURL:(NSURL *)targetURL withAccessTime:(struct timeval)accessTime error:(NSError * __autoreleasing *)error @@ -859,7 +561,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { // The document says LSRegisterURL() can be used as well but this hasn't worked out well for me in practice // Anyway, updating the modification time of the application is important because the system will be aware a new version of your app is available, // Finder will report the correct file size and other metadata for it, URL schemes your app may register will be updated, etc. -// Behind the scenes, touch calls to utimes() which is what we use here - unless we need to authenticate +// Behind the scenes, touch calls to utimes() which is what we use here - (BOOL)updateModificationAndAccessTimeOfItemAtURL:(NSURL *)targetURL error:(NSError * __autoreleasing *)error { if (![self _itemExistsAtURL:targetURL]) { @@ -887,28 +589,15 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { // Using futimes() because utimes() follows symbolic links BOOL updatedTime = (futimes(fileDescriptor, NULL) == 0); - close(fileDescriptor); - if (updatedTime) { - return YES; - } - - if (errno != EACCES) { + if (!updatedTime) { if (error != NULL) { *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to update modification & access time for %@", targetURL.path.lastPathComponent] }]; } - return NO; } - NSError *executeError = nil; - BOOL success = [self _authorizeAndExecuteCommand:SUFileOpUpdateModificationAndAccessTimeCommand sourcePath:path destinationPath:NULL error:&executeError]; - if (!success && error != NULL) { - NSString *errorMessage = [NSString stringWithFormat:@"Failed to update modification & access time on %@ with authorization.", targetURL.path.lastPathComponent]; - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey: errorMessage, NSUnderlyingErrorKey: executeError }]; - } - - return success; + return updatedTime; } // Creates a directory at the item pointed by url @@ -932,35 +621,14 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { } NSError *createDirectoryError = nil; - if ([_fileManager createDirectoryAtURL:url withIntermediateDirectories:NO attributes:nil error:&createDirectoryError]) { - return YES; - } - - if (!NS_HAS_PERMISSION_ERROR(createDirectoryError)) { + if (![_fileManager createDirectoryAtURL:url withIntermediateDirectories:NO attributes:nil error:&createDirectoryError]) { if (error != NULL) { *error = createDirectoryError; } return NO; } - - char path[PATH_MAX] = {0}; - if (![url.path getFileSystemRepresentation:path maxLength:sizeof(path)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Directory to create (%@) cannot be represented as a valid file name.", url.path.lastPathComponent] }]; - } - return NO; - } - NSError *executeError = nil; - BOOL success = [self _authorizeAndExecuteCommand:SUFileOpMakeDirectoryCommand sourcePath:path destinationPath:NULL error:&executeError]; - if (!success) { - if (error != NULL) { - NSString *errorMessage = [NSString stringWithFormat:@"Failed to make directory %@ with authorization.", url.path.lastPathComponent]; - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey: errorMessage, NSUnderlyingErrorKey: executeError }]; - } - } - - return success; + return YES; } - (NSURL *)makeTemporaryDirectoryWithPreferredName:(NSString *)preferredName appropriateForDirectoryURL:(NSURL *)directoryURL error:(NSError * __autoreleasing *)error @@ -994,33 +662,14 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { } NSError *removeError = nil; - if ([_fileManager removeItemAtURL:url error:&removeError]) { - return YES; - } - - if (!NS_HAS_PERMISSION_ERROR(removeError)) { + if (![_fileManager removeItemAtURL:url error:&removeError]) { if (error != NULL) { *error = removeError; } return NO; } - - char path[PATH_MAX] = {0}; - if (![url.path getFileSystemRepresentation:path maxLength:sizeof(path)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"File to remove (%@) cannot be represented as a valid file name.", url.path.lastPathComponent] }]; - } - return NO; - } - NSError *executeError = nil; - BOOL success = [self _authorizeAndExecuteCommand:SUFileOpRemoveCommand sourcePath:path destinationPath:NULL error:&executeError]; - - if (!success && error != NULL) { - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to remove %@ with authentication.", url.path.lastPathComponent], NSUnderlyingErrorKey: executeError }]; - } - - return success; + return YES; } - (BOOL)moveItemAtURLToTrash:(NSURL *)url error:(NSError *__autoreleasing *)error @@ -1077,34 +726,6 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { return success; } -// Unlike other methods, authorization is required to execute this method successfully -- (BOOL)executePackageAtURL:(NSURL *)packageURL error:(NSError * __autoreleasing *)error -{ - if (![self _itemExistsAtURL:packageURL]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileNoSuchFileError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to execute package %@ because the file does not exist.", packageURL.path.lastPathComponent] }]; - } - return NO; - } - - char path[PATH_MAX] = {0}; - if (![packageURL.path getFileSystemRepresentation:path maxLength:sizeof(path)]) { - if (error != NULL) { - *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Package to execute (%@) cannot be represented as a valid file name.", packageURL.path.lastPathComponent] }]; - } - return NO; - } - - NSError *executeError = nil; - BOOL success = [self _authorizeAndExecuteCommand:SUFileOpInstallCommand sourcePath:path destinationPath:NULL error:&executeError]; - - if (!success && error != NULL) { - NSString* errorMessage = @"Failed to execute package installer."; - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{NSLocalizedDescriptionKey: errorMessage, NSUnderlyingErrorKey: executeError}]; - } - return success; -} - @end #pragma clang diagnostic pop diff --git a/Sparkle/SUInstallationType.h b/Sparkle/SUInstallationType.h new file mode 100644 index 00000000..e8830951 --- /dev/null +++ b/Sparkle/SUInstallationType.h @@ -0,0 +1,20 @@ +// +// SUInstallationType.h +// Sparkle +// +// Created by Mayur Pawashe on 7/24/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#ifndef SUInstallationType_h +#define SUInstallationType_h + +#define SUInstallationTypeApplication @"application" // the default installation type for ordinary application updates +#define SUInstallationTypeGuidedPackage @"guided-package" // the preferred installation type for package installations +#define SUInstallationTypePackage @"package" // the deprecated installation type; use guided package instead + +#define SUInstallationTypeDefault SUInstallationTypeApplication +#define SUInstallationTypesArray (@[SUInstallationTypeApplication, SUInstallationTypeGuidedPackage, SUInstallationTypePackage]) +#define SUValidInstallationType(x) ((x != nil) && [SUInstallationTypesArray containsObject:x]) + +#endif /* SUInstallationType_h */ diff --git a/Sparkle/SUInstallerDriver.h b/Sparkle/SUInstallerDriver.h index f0fd63fe..8b1d1583 100644 --- a/Sparkle/SUInstallerDriver.h +++ b/Sparkle/SUInstallerDriver.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol SUUpdaterDelegate; -@class SUHost, SUAppcastItem; +@class SUHost, SUAppcastItem, SUDownloadedUpdate; @protocol SUInstallerDriverDelegate @@ -31,9 +31,9 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithHost:(SUHost *)host cachePath:(NSString *)cachePath sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(nullable id)updaterDelegate delegate:(nullable id)delegate; -- (void)resumeUpdateWithUpdateItem:(SUAppcastItem *)updateItem; +- (void)resumeInstallingUpdateWithUpdateItem:(SUAppcastItem *)updateItem; -- (void)extractDownloadName:(NSString *)downloadName withUpdateItem:(SUAppcastItem *)updateItem temporaryDirectory:(NSString *)temporaryDirectory completion:(void (^)(NSError * _Nullable))completionHandler; +- (void)extractDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently completion:(void (^)(NSError * _Nullable))completionHandler; - (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI; diff --git a/Sparkle/SUInstallerDriver.m b/Sparkle/SUInstallerDriver.m index 1566b7b5..3aeed79d 100644 --- a/Sparkle/SUInstallerDriver.m +++ b/Sparkle/SUInstallerDriver.m @@ -24,6 +24,7 @@ #import "SUInstallerConnection.h" #import "SUInstallerConnectionProtocol.h" #import "SUXPCInstallerConnection.h" +#import "SUDownloadedUpdate.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -52,6 +53,8 @@ @property (nonatomic, copy) NSString *downloadName; @property (nonatomic, copy) NSString *temporaryDirectory; +@property (nonatomic) BOOL aborted; + @end @implementation SUInstallerDriver @@ -71,6 +74,7 @@ @synthesize updateItem = _updateItem; @synthesize downloadName = _downloadName; @synthesize temporaryDirectory = _temporaryDirectory; +@synthesize aborted = _aborted; - (instancetype)initWithHost:(SUHost *)host cachePath:(NSString *)cachePath sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(id)updaterDelegate delegate:(nullable id)delegate { @@ -105,7 +109,7 @@ [self.installerConnection setInvalidationHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ SUInstallerDriver *strongSelf = weakSelf; - if (strongSelf.installerConnection != nil) { + if (strongSelf.installerConnection != nil && !strongSelf.aborted) { NSError *remoteError = [NSError errorWithDomain:SUSparkleErrorDomain @@ -121,23 +125,25 @@ }]; NSString *serviceName = SUInstallerServiceNameForBundleIdentifier(hostBundleIdentifier); + NSString *installationType = self.updateItem.installationType; + assert(installationType != nil); - [self.installerConnection setServiceName:serviceName]; + [self.installerConnection setServiceName:serviceName hostPath:self.host.bundlePath installationType:installationType]; [self sendInstallationData]; } // This can be called multiple times (eg: if a delta update fails, this may be called again with a regular update item) -- (void)extractDownloadName:(NSString *)downloadName withUpdateItem:(SUAppcastItem *)updateItem temporaryDirectory:(NSString *)temporaryDirectory completion:(void (^)(NSError * _Nullable))completionHandler +- (void)extractDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently completion:(void (^)(NSError * _Nullable))completionHandler { - self.updateItem = updateItem; - self.temporaryDirectory = temporaryDirectory; - self.downloadName = downloadName; + self.updateItem = downloadedUpdate.updateItem; + self.temporaryDirectory = downloadedUpdate.temporaryDirectory; + self.downloadName = downloadedUpdate.downloadName; self.currentStage = SUInstallerNotStarted; if (self.installerConnection == nil) { - [self launchAutoUpdateWithCompletion:completionHandler]; + [self launchAutoUpdateSilently:silently completion:completionHandler]; } else { // The Install tool is already alive; just send out installation input data again [self sendInstallationData]; @@ -145,7 +151,7 @@ } } -- (void)resumeUpdateWithUpdateItem:(SUAppcastItem *)updateItem +- (void)resumeInstallingUpdateWithUpdateItem:(SUAppcastItem *)updateItem { self.updateItem = updateItem; } @@ -164,18 +170,7 @@ decryptionPassword = [self.updaterDelegate decryptionPasswordForUpdater:self.updater]; } - NSString *localProgressToolPath = [self.sparkleBundle pathForResource:@""SPARKLE_INSTALLER_PROGRESS_TOOL_NAME ofType:@"app"]; - if (localProgressToolPath == nil) { - SULog(@"Error: Failed to find installer progress tool: %@", localProgressToolPath); - } - - NSError *progressToolError = nil; - NSString *progressToolPath = [self copyPathToCacheDirectory:localProgressToolPath error:&progressToolError]; - if (progressToolPath == nil) { - SULog(@"Error: Failed to copy or find installer progress tool: %@", progressToolError); - } - - SUInstallationInputData *installationData = [[SUInstallationInputData alloc] initWithRelaunchPath:pathToRelaunch progressToolPath:progressToolPath hostBundlePath:self.host.bundlePath updateDirectoryPath:self.temporaryDirectory downloadName:self.downloadName dsaSignature:dsaSignature decryptionPassword:decryptionPassword]; + SUInstallationInputData *installationData = [[SUInstallationInputData alloc] initWithRelaunchPath:pathToRelaunch hostBundlePath:self.host.bundlePath updateDirectoryPath:self.temporaryDirectory downloadName:self.downloadName installationType:self.updateItem.installationType dsaSignature:dsaSignature decryptionPassword:decryptionPassword]; NSData *archivedData = SUArchiveRootObjectSecurely(installationData); if (archivedData == nil) { @@ -268,12 +263,12 @@ } else if (identifier == SUInstallationFinishedStage2) { self.currentStage = identifier; - BOOL cancelledInstallation = NO; + BOOL canceledInstallation = NO; if (data.length >= sizeof(uint8_t)) { - cancelledInstallation = (*(const uint8_t *)data.bytes == 0x1); + canceledInstallation = (*(const uint8_t *)data.bytes == 0x1); } - if (cancelledInstallation) { + if (canceledInstallation) { [self.delegate installerIsRequestingAbortInstallWithError:nil]; } else { if (!self.startedInstalling) { @@ -381,23 +376,22 @@ return cachePath; } -- (void)launchAutoUpdateWithCompletion:(void (^)(NSError *_Nullable))completionHandler +- (void)launchAutoUpdateSilently:(BOOL)silently completion:(void (^)(NSError *_Nullable))completionHandler { // Copy the relauncher into a temporary directory so we can get to it after the new version's installed. // Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems. NSError *relaunchError = nil; - NSString *relaunchToolPath = [self copyPathToCacheDirectory:[self.sparkleBundle pathForResource:@""SPARKLE_RELAUNCH_TOOL_NAME ofType:@"app"] error:&relaunchError]; + NSString *relaunchToolPath = [self copyPathToCacheDirectory:[self.sparkleBundle pathForResource:@""SPARKLE_RELAUNCH_TOOL_NAME ofType:@""] error:&relaunchError]; if (relaunchToolPath == nil) { completionHandler(relaunchError); return; } - NSString *hostBundleIdentifier = self.host.bundle.bundleIdentifier; - if (hostBundleIdentifier == nil) { - NSError *error = - [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey:SULocalizedString(@"An error occurred while finding the application's bundle identifier. Please try again later.", nil) }]; - - completionHandler(error); + // Copy the progress tool as well + NSError *progressToolError = nil; + NSString *progressToolPath = [self copyPathToCacheDirectory:[self.sparkleBundle pathForResource:@""SPARKLE_INSTALLER_PROGRESS_TOOL_NAME ofType:@"app"] error:&progressToolError]; + if (progressToolPath == nil) { + completionHandler(progressToolError); return; } @@ -412,6 +406,7 @@ launcherConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerLauncherProtocol)]; [launcherConnection resume]; +#warning revisit weak connection __weak NSXPCConnection *weakConnection = launcherConnection; launcherConnection.interruptionHandler = ^{ dispatch_async(dispatch_get_main_queue(), ^{ @@ -435,25 +430,39 @@ installerLauncher = launcherConnection.remoteObjectProxy; } - BOOL shouldAllowInstallerInteraction = YES; +#warning review this... + BOOL shouldAllowInstallerInteraction = !silently; if ([self.updaterDelegate respondsToSelector:@selector(updaterShouldAllowInstallerInteraction:)]) { shouldAllowInstallerInteraction = [self.updaterDelegate updaterShouldAllowInstallerInteraction:self.updater]; } - [installerLauncher launchInstallerAtPath:relaunchToolPath withHostBundleIdentifier:hostBundleIdentifier allowingInteraction:shouldAllowInstallerInteraction completion:^(BOOL success) { + NSString *hostBundlePath = self.host.bundle.bundlePath; + assert(hostBundlePath != nil); + + NSString *installationType = self.updateItem.installationType; + assert(installationType != nil); + + // The installer launcher could be in a XPC service, so we don't want to do localization in there + NSString *authorizationPrompt = [NSString stringWithFormat:SULocalizedString(@"%1$@ wants to update.", nil), self.host.name]; + [installerLauncher launchInstallerAtPath:relaunchToolPath progressToolPath:progressToolPath withHostBundlePath:hostBundlePath authorizationPrompt:authorizationPrompt installationType:installationType allowingInteraction:shouldAllowInstallerInteraction completion:^(SUAuthorizationReply result) { dispatch_async(dispatch_get_main_queue(), ^{ retrievedLaunchStatus = YES; [launcherConnection invalidate]; - if (!success) { - NSError *error = - [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey:SULocalizedString(@"An error occurred while launching the installer. Please try again later.", nil) }]; - - completionHandler(error); - } else { - [self setUpConnection]; - - completionHandler(nil); + switch (result) { + case SUAuthorizationReplyFailure: + completionHandler([NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey:SULocalizedString(@"An error occurred while launching the installer. Please try again later.", nil) }]); + break; + case SUAuthorizationReplyCanceled: + completionHandler([NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationCanceledError userInfo:nil]); + break; + case SUAuthorizationReplyAuthorizeLater: + completionHandler([NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationAuthorizeLaterError userInfo:nil]); + break; + case SUAuthorizationReplySuccess: + [self setUpConnection]; + completionHandler(nil); + break; } }); }]; @@ -524,6 +533,7 @@ - (void)abortInstall { + self.aborted = YES; if (self.installerConnection != nil) { [self.installerConnection invalidate]; self.installerConnection = nil; diff --git a/Sparkle/SUProbingUpdateDriver.m b/Sparkle/SUProbingUpdateDriver.m index 422fccb8..f1c891ea 100644 --- a/Sparkle/SUProbingUpdateDriver.m +++ b/Sparkle/SUProbingUpdateDriver.m @@ -16,12 +16,14 @@ @interface SUProbingUpdateDriver () @property (nonatomic, readonly) SUBasicUpdateDriver *basicDriver; +@property (nonatomic) SUDownloadedUpdate *downloadedUpdate; @end @implementation SUProbingUpdateDriver @synthesize basicDriver = _basicDriver; +@synthesize downloadedUpdate = _downloadedUpdate; - (instancetype)initWithHost:(SUHost *)host updater:(id)updater updaterDelegate:(id )updaterDelegate { @@ -37,14 +39,16 @@ [self.basicDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:NO completion:completionBlock]; } -- (BOOL)basicDriverShouldSignalShowingUpdateImmediately +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock { - return NO; + [self.basicDriver resumeInstallingUpdateWithCompletion:completionBlock]; } -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock { - [self.basicDriver resumeUpdateWithCompletion:completionBlock]; + self.downloadedUpdate = downloadedUpdate; + + [self.basicDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; } - (void)basicDriverDidFindUpdateWithAppcastItem:(SUAppcastItem *)__unused appcastItem @@ -55,9 +59,7 @@ - (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error { - [self abortUpdateWithError:error]; - } - (void)abortUpdate @@ -67,7 +69,7 @@ - (void)abortUpdateWithError:(nullable NSError *)error { - [self.basicDriver abortUpdateWithError:error]; + [self.basicDriver abortUpdateAndShowNextUpdateImmediately:NO downloadedUpdate:self.downloadedUpdate error:error]; } @end diff --git a/Sparkle/SUScheduledUpdateDriver.m b/Sparkle/SUScheduledUpdateDriver.m index 6bc7483d..92f83908 100644 --- a/Sparkle/SUScheduledUpdateDriver.m +++ b/Sparkle/SUScheduledUpdateDriver.m @@ -40,9 +40,14 @@ [self.uiDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:NO completion:completionBlock]; } -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock { - [self.uiDriver resumeUpdateWithCompletion:completionBlock]; + [self.uiDriver resumeInstallingUpdateWithCompletion:completionBlock]; +} + +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock +{ + [self.uiDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; } - (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)__unused error diff --git a/Sparkle/SUStandardUserDriver.m b/Sparkle/SUStandardUserDriver.m index b0f250fe..93f53703 100644 --- a/Sparkle/SUStandardUserDriver.m +++ b/Sparkle/SUStandardUserDriver.m @@ -162,7 +162,17 @@ - (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUUpdateAlertChoice))reply { [self showUpdateFoundWithAlertHandler:^SUUpdateAlert *(SUStandardUserDriver *weakSelf, SUHost *host, id versionDisplayer) { - return [[SUUpdateAlert alloc] initWithAppcastItem:appcastItem host:host versionDisplayer:versionDisplayer completionBlock:^(SUUpdateAlertChoice choice) { + return [[SUUpdateAlert alloc] initWithAppcastItem:appcastItem alreadyDownloaded:NO host:host versionDisplayer:versionDisplayer completionBlock:^(SUUpdateAlertChoice choice) { + reply(choice); + weakSelf.activeUpdateAlert = nil; + }]; + }]; +} + +- (void)showDownloadedUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUUpdateAlertChoice))reply +{ + [self showUpdateFoundWithAlertHandler:^SUUpdateAlert *(SUStandardUserDriver *weakSelf, SUHost *host, id versionDisplayer) { + return [[SUUpdateAlert alloc] initWithAppcastItem:appcastItem alreadyDownloaded:YES host:host versionDisplayer:versionDisplayer completionBlock:^(SUUpdateAlertChoice choice) { reply(choice); weakSelf.activeUpdateAlert = nil; }]; @@ -318,15 +328,22 @@ #pragma mark Download & Install Updates +- (void)showStatusController +{ + if (self.statusController == nil) { + self.statusController = [[SUStatusController alloc] initWithHost:self.host]; + [self.statusController showWindow:self]; + } +} + - (void)showDownloadInitiatedWithCompletion:(void (^)(SUDownloadUpdateStatus))downloadUpdateStatusCompletion { dispatch_async(dispatch_get_main_queue(), ^{ [self.coreComponent registerDownloadStatusHandler:downloadUpdateStatusCompletion]; - self.statusController = [[SUStatusController alloc] initWithHost:self.host]; + [self showStatusController]; [self.statusController beginActionWithTitle:SULocalizedString(@"Downloading update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil]; [self.statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelDownload:) isDefault:NO]; - [self.statusController showWindow:self]; }); } @@ -359,12 +376,14 @@ }); } -- (void)showDownloadFinishedAndStartedExtractingUpdate +- (void)showDownloadDidStartExtractingUpdate { dispatch_async(dispatch_get_main_queue(), ^{ [self.coreComponent completeDownloadStatus]; + [self showStatusController]; [self.statusController beginActionWithTitle:SULocalizedString(@"Extracting update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil]; + [self.statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:nil action:nil isDefault:NO]; [self.statusController setButtonEnabled:NO]; }); } diff --git a/Sparkle/SUStatusCompletionResults.h b/Sparkle/SUStatusCompletionResults.h index c92a4d27..ee7a81fa 100644 --- a/Sparkle/SUStatusCompletionResults.h +++ b/Sparkle/SUStatusCompletionResults.h @@ -18,12 +18,12 @@ typedef NS_ENUM(NSUInteger, SUUpdateCheckTimerStatus) { typedef NS_ENUM(NSUInteger, SUUserInitiatedCheckStatus) { SUUserInitiatedCheckDone, - SUUserInitiatedCheckCancelled + SUUserInitiatedCheckCanceled }; typedef NS_ENUM(NSUInteger, SUDownloadUpdateStatus) { SUDownloadUpdateDone, - SUDownloadUpdateCancelled + SUDownloadUpdateCanceled }; typedef NS_ENUM(NSUInteger, SUInstallUpdateStatus) { diff --git a/Sparkle/SUSystemAuthorization.h b/Sparkle/SUSystemAuthorization.h index a9f1a57e..6e9232ce 100644 --- a/Sparkle/SUSystemAuthorization.h +++ b/Sparkle/SUSystemAuthorization.h @@ -11,9 +11,6 @@ NS_ASSUME_NONNULL_BEGIN -// Must free authorization ref later -AuthorizationRef SUCreateAuthorization(BOOL * _Nullable grantedSystemPrivilege); - -BOOL SUGrantsSystemAuthorizationAccess(void); +BOOL SUNeedsSystemAuthorizationAccess(NSString *path, NSString *installationType, BOOL * _Nullable preflighted); NS_ASSUME_NONNULL_END diff --git a/Sparkle/SUSystemAuthorization.m b/Sparkle/SUSystemAuthorization.m index 2f53ca24..0b5a87e7 100644 --- a/Sparkle/SUSystemAuthorization.m +++ b/Sparkle/SUSystemAuthorization.m @@ -8,45 +8,53 @@ #import "SUSystemAuthorization.h" #import +#import "SUInstallationType.h" -AuthorizationRef SUCreateAuthorization(BOOL * _Nullable grantedSystemPrivilege) +static BOOL SUPreflightSystemAuthorization(void) { // This should almost always succeed, fail in unusual/rare cases AuthorizationRef auth = NULL; OSStatus createStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth); if (createStatus != errAuthorizationSuccess) { - auth = NULL; - if (grantedSystemPrivilege != NULL) { - *grantedSystemPrivilege = NO; - } - } else { - AuthorizationItem rightItems[] = { - { .name = kSMRightModifySystemDaemons, .valueLength = 0, .value = NULL, .flags = 0} - }; - - AuthorizationRights rights = { - .count = sizeof(rightItems) / sizeof(*rightItems), - .items = rightItems, - }; - - AuthorizationFlags flags = - (AuthorizationFlags)(kAuthorizationFlagExtendRights | kAuthorizationFlagPreAuthorize); - - // This will test if we can gain authorization for running utlities as root - OSStatus copyStatus = AuthorizationCopyRights(auth, &rights, kAuthorizationEmptyEnvironment, flags, NULL); - if (grantedSystemPrivilege != NULL) { - *grantedSystemPrivilege = (copyStatus == errAuthorizationSuccess); - } + return NO; } - return auth; -} - -BOOL SUGrantsSystemAuthorizationAccess(void) -{ - BOOL grantedSystemPrivilege = NO; - AuthorizationRef auth = SUCreateAuthorization(&grantedSystemPrivilege); + AuthorizationItem rightItems[] = { + { .name = kSMRightModifySystemDaemons, .valueLength = 0, .value = NULL, .flags = 0} + }; + + AuthorizationRights rights = { + .count = sizeof(rightItems) / sizeof(*rightItems), + .items = rightItems, + }; + + AuthorizationFlags flags = + (AuthorizationFlags)(kAuthorizationFlagExtendRights | kAuthorizationFlagPreAuthorize); + + // This will test if we can gain authorization for running utlities as root + OSStatus copyStatus = AuthorizationCopyRights(auth, &rights, kAuthorizationEmptyEnvironment, flags, NULL); + AuthorizationFree(auth, kAuthorizationFlagDefaults); - return grantedSystemPrivilege; + return (copyStatus == errAuthorizationSuccess); +} + +BOOL SUNeedsSystemAuthorizationAccess(NSString *path, NSString *installationType, BOOL * _Nullable preflighted) +{ + BOOL result; + if (SUPreflightSystemAuthorization()) { + if (preflighted != NULL) { + *preflighted = YES; + } + result = YES; + } else if ([installationType isEqualToString:SUInstallationTypeGuidedPackage]) { + result = YES; + } else if ([installationType isEqualToString:SUInstallationTypePackage]) { + result = NO; + } else { +#warning what about symbolic links? + NSFileManager *fileManager = [NSFileManager defaultManager]; + result = ![fileManager isWritableFileAtPath:path] || ![fileManager isWritableFileAtPath:[path stringByDeletingLastPathComponent]]; + } + return result; } diff --git a/Sparkle/SUUIBasedUpdateDriver.h b/Sparkle/SUUIBasedUpdateDriver.h index 443352df..a4a3bca0 100644 --- a/Sparkle/SUUIBasedUpdateDriver.h +++ b/Sparkle/SUUIBasedUpdateDriver.h @@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@class SUHost; +@class SUHost, SUDownloadedUpdate; @protocol SUUserDriver, SUUpdaterDelegate; @interface SUUIBasedUpdateDriver : NSObject @@ -31,7 +31,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock; -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock; +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock; + +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock; - (void)abortUpdateWithError:(nullable NSError *)error; diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index 8a4d61f7..e124be4b 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -28,7 +28,8 @@ @property (weak, nonatomic, readonly) id updaterDelegate; @property (nonatomic, weak, readonly) id delegate; @property (nonatomic, readonly) id userDriver; -@property (nonatomic) BOOL resumingUpdate; +@property (nonatomic) BOOL resumingInstallingUpdate; +@property (nonatomic) BOOL resumingDownloadedUpdate; @end @@ -40,7 +41,8 @@ @synthesize updaterDelegate = _updaterDelegate; @synthesize userDriver = _userDriver; @synthesize delegate = _delegate; -@synthesize resumingUpdate = _resumingUpdate; +@synthesize resumingInstallingUpdate = _resumingInstallingUpdate; +@synthesize resumingDownloadedUpdate = _resumingDownloadedUpdate; - (instancetype)initWithHost:(SUHost *)host sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id )userDriver updaterDelegate:(nullable id )updaterDelegate delegate:(id)delegate { @@ -59,13 +61,19 @@ - (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock { - [self.coreDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:includesSkippedUpdates completion:completionBlock]; + [self.coreDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:includesSkippedUpdates requiresSilentInstall:NO completion:completionBlock]; } -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock { - self.resumingUpdate = YES; - [self.coreDriver resumeUpdateWithCompletion:completionBlock]; + self.resumingInstallingUpdate = YES; + [self.coreDriver resumeInstallingUpdateWithCompletion:completionBlock]; +} + +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock +{ + self.resumingDownloadedUpdate = YES; + [self.coreDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; } - (void)basicDriverDidFinishLoadingAppcast @@ -77,7 +85,25 @@ - (void)basicDriverDidFindUpdateWithAppcastItem:(SUAppcastItem *)updateItem { - if (!self.resumingUpdate) { + if (self.resumingDownloadedUpdate) { + [self.userDriver showDownloadedUpdateFoundWithAppcastItem:updateItem reply:^(SUUpdateAlertChoice choice) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self.host setObject:nil forUserDefaultsKey:SUSkippedVersionKey]; + switch (choice) { + case SUInstallUpdateChoice: + [self.coreDriver extractDownloadedUpdate]; + break; + case SUSkipThisVersionChoice: + [self.coreDriver clearDownloadedUpdate]; + [self.host setObject:[updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey]; + // Fall through + case SUInstallLaterChoice: + [self.delegate uiDriverIsRequestingAbortUpdateWithError:nil]; + break; + } + }); + }]; + } else if (!self.resumingInstallingUpdate) { [self.userDriver showUpdateFoundWithAppcastItem:updateItem reply:^(SUUpdateAlertChoice choice) { dispatch_async(dispatch_get_main_queue(), ^{ [self.host setObject:nil forUserDefaultsKey:SUSkippedVersionKey]; @@ -124,7 +150,7 @@ switch (downloadCompletionStatus) { case SUDownloadUpdateDone: break; - case SUDownloadUpdateCancelled: + case SUDownloadUpdateCanceled: dispatch_async(dispatch_get_main_queue(), ^{ if ([self.updaterDelegate respondsToSelector:@selector(userDidCancelDownload:)]) { [self.updaterDelegate userDidCancelDownload:self.updater]; @@ -147,9 +173,9 @@ [self.userDriver showDownloadDidReceiveDataOfLength:length]; } -- (void)coreDriverDidFinishDownloadingUpdate +- (void)coreDriverDidStartExtractingUpdate { - [self.userDriver showDownloadFinishedAndStartedExtractingUpdate]; + [self.userDriver showDownloadDidStartExtractingUpdate]; } - (void)installerDidStartInstalling @@ -183,11 +209,6 @@ [self.userDriver showUpdateInstallationDidFinish]; } -- (BOOL)basicDriverShouldSignalShowingUpdateImmediately -{ - return NO; -} - - (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error { // A delegate may want to handle this type of error specially @@ -203,7 +224,7 @@ { void (^abortUpdate)(void) = ^{ [self.userDriver dismissUpdateInstallation]; - [self.coreDriver abortUpdateWithError:error]; + [self.coreDriver abortUpdateAndShowNextUpdateImmediately:NO error:error]; }; if (error != nil) { @@ -215,6 +236,8 @@ abortUpdate(); }); }]; + } else if (error.code == SUInstallationCanceledError || error.code == SUInstallationAuthorizeLaterError) { + abortUpdate(); } else { [self.userDriver showUpdaterError:nonNullError acknowledgement:^{ dispatch_async(dispatch_get_main_queue(), ^{ diff --git a/Sparkle/SUURLDownload.m b/Sparkle/SUURLDownload.m index 43596a51..5be3578f 100644 --- a/Sparkle/SUURLDownload.m +++ b/Sparkle/SUURLDownload.m @@ -25,6 +25,7 @@ void SUDownloadURLWithRequest(NSURLRequest * request, void (^completionBlock)(NS connection = [[NSXPCConnection alloc] initWithServiceName:@TEMPORARY_DOWNLOADER_BUNDLE_ID]; connection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUTemporaryDownloaderProtocol)]; +#warning revisit connection weak reference __weak NSXPCConnection *weakConnection = connection; connection.interruptionHandler = ^{ dispatch_async(dispatch_get_main_queue(), ^{ diff --git a/Sparkle/SUUpdateAlert.h b/Sparkle/SUUpdateAlert.h index 428fad0a..63325b05 100644 --- a/Sparkle/SUUpdateAlert.h +++ b/Sparkle/SUUpdateAlert.h @@ -20,7 +20,7 @@ @property (nonatomic, weak, readonly) id versionDisplayer; -- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost versionDisplayer:(id )aVersionDisplayer completionBlock:(void (^)(SUUpdateAlertChoice))block; +- (instancetype)initWithAppcastItem:(SUAppcastItem *)item alreadyDownloaded:(BOOL)alreadyDownloaded host:(SUHost *)aHost versionDisplayer:(id )aVersionDisplayer completionBlock:(void (^)(SUUpdateAlertChoice))block; - (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost versionDisplayer:(id )aVersionDisplayer resumableCompletionBlock:(void (^)(SUInstallUpdateStatus))block; diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 16405c63..488f699d 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -34,6 +34,7 @@ @interface SUUpdateAlert () @property (strong) SUAppcastItem *updateItem; +@property (nonatomic) BOOL alreadyDownloaded; @property (strong) SUHost *host; @property (nonatomic) BOOL allowsAutomaticUpdates; @property (nonatomic, copy, nullable) void(^completionBlock)(SUUpdateAlertChoice); @@ -55,6 +56,7 @@ @implementation SUUpdateAlert @synthesize completionBlock = _completionBlock; +@synthesize alreadyDownloaded = _alreadyDownloaded; @synthesize resumableCompletionBlock = _resumableCompletionBlock; @synthesize versionDisplayer; @@ -93,12 +95,13 @@ return self; } -- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost versionDisplayer:(id )aVersionDisplayer completionBlock:(void (^)(SUUpdateAlertChoice))block +- (instancetype)initWithAppcastItem:(SUAppcastItem *)item alreadyDownloaded:(BOOL)alreadyDownloaded host:(SUHost *)aHost versionDisplayer:(id )aVersionDisplayer completionBlock:(void (^)(SUUpdateAlertChoice))block { self = [self initWithAppcastItem:item host:aHost versionDisplayer:aVersionDisplayer]; if (self != nil) { _completionBlock = [block copy]; + _alreadyDownloaded = alreadyDownloaded; } return self; } @@ -109,6 +112,7 @@ if (self != nil) { _resumableCompletionBlock = [block copy]; + _alreadyDownloaded = YES; } return self; } @@ -264,9 +268,9 @@ [self.automaticallyInstallUpdatesButton removeFromSuperview]; } - BOOL alreadyDownloaded = (self.resumableCompletionBlock != nil); - if (alreadyDownloaded) { - // Should we hide the button or disable the button if the update has already been downloaded? + BOOL startedInstalling = (self.resumableCompletionBlock != nil); + if (startedInstalling) { + // Should we hide the button or disable the button if the update has already started installing? // Personally I think it looks better when the button is visible on the window... // Anyway an already downloaded update can't be skipped self.skipButton.enabled = NO; @@ -315,8 +319,6 @@ } else { [self.versionDisplayer formatVersion:&updateItemVersion andVersion:&hostVersion]; } - - BOOL alreadyDownloaded = (self.resumableCompletionBlock != nil); // We display a different summary depending on if it's an "info-only" item, or a "critical update" item, or if we've already downloaded the update and just need to relaunch NSString *finalString = nil; @@ -324,13 +326,13 @@ if (self.updateItem.isInformationOnlyUpdate) { finalString = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available--you have %@. Would you like to learn more about this update on the web?", @"Description text for SUUpdateAlert when the update informational with no download."), self.host.name, updateItemVersion, hostVersion]; } else if ([self.updateItem isCriticalUpdate]) { - if (!alreadyDownloaded) { + if (!self.alreadyDownloaded) { finalString = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available--you have %@. This is an important update; would you like to download it now?", @"Description text for SUUpdateAlert when the critical update is downloadable."), self.host.name, updateItemVersion, hostVersion]; } else { finalString = [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?", @"Description text for SUUpdateAlert when the critical update has already been downloaded and ready to install."), self.host.name, updateItemVersion]; } } else { - if (!alreadyDownloaded) { + if (!self.alreadyDownloaded) { finalString = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available--you have %@. Would you like to download it now?", @"Description text for SUUpdateAlert when the update is downloadable."), self.host.name, updateItemVersion, hostVersion]; } else { finalString = [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?", @"Description text for SUUpdateAlert when the update has already been downloaded and ready to install."), self.host.name, updateItemVersion]; diff --git a/Sparkle/SUUpdateDriver.h b/Sparkle/SUUpdateDriver.h index 8c925404..aadce8b9 100644 --- a/Sparkle/SUUpdateDriver.h +++ b/Sparkle/SUUpdateDriver.h @@ -8,13 +8,17 @@ NS_ASSUME_NONNULL_BEGIN -typedef void (^SUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately); +@class SUDownloadedUpdate; + +typedef void (^SUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, SUDownloadedUpdate * _Nullable resumableUpdate); @protocol SUUpdateDriver - (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders completion:(SUUpdateDriverCompletion)completionBlock; -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock; +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock; + +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock; - (void)abortUpdate; diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index f614acad..645a98b3 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -27,6 +27,7 @@ #import "SUErrors.h" #import "SUXPCServiceInfo.h" #import "SUUpdaterCycle.h" +#import "SUDownloadedUpdate.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit @@ -49,6 +50,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification @property (nonatomic, readonly) SUUpdaterCycle *updaterCycle; @property (nonatomic) BOOL startedUpdater; @property (nonatomic, copy) void (^preStartedScheduledUpdateBlock)(void); +@property (nonatomic, nullable) SUDownloadedUpdate *resumableUpdate; @end @@ -65,6 +67,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification @synthesize sparkleBundle = _sparkleBundle; @synthesize startedUpdater = _startedUpdater; @synthesize preStartedScheduledUpdateBlock = _preStartedScheduledUpdateBlock; +@synthesize resumableUpdate = _resumableUpdate; #ifdef DEBUG + (void)load @@ -376,7 +379,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification } id updateDriver; - if (!installerIsRunning && [strongSelf automaticallyDownloadsUpdates] && [strongSelf allowsAutomaticUpdates]) { + if (!installerIsRunning && [strongSelf automaticallyDownloadsUpdates] && [strongSelf allowsAutomaticUpdates] && strongSelf.resumableUpdate == nil) { updateDriver = [[SUAutomaticUpdateDriver alloc] initWithHost:strongSelf.host @@ -479,9 +482,10 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification // Use a NIL URL to cancel quietly. if (theFeedURL) { __weak SUUpdater *weakSelf = self; - SUUpdateDriverCompletion completionBlock = ^(BOOL shouldShowUpdateImmediately) { + SUUpdateDriverCompletion completionBlock = ^(BOOL shouldShowUpdateImmediately, SUDownloadedUpdate * _Nullable resumableUpdate) { SUUpdater *strongSelf = weakSelf; if (strongSelf != nil) { + strongSelf.resumableUpdate = resumableUpdate; strongSelf.driver = nil; [strongSelf updateLastUpdateCheckDate]; [strongSelf scheduleNextUpdateCheckFiringImmediately:shouldShowUpdateImmediately]; @@ -490,10 +494,12 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification [self.userDriver showCanCheckForUpdates:NO]; - if (!installerInProgress) { - [self.driver checkForUpdatesAtAppcastURL:theFeedURL withUserAgent:[self userAgentString] httpHeaders:[self httpHeaders] completion:completionBlock]; + if (installerInProgress) { + [self.driver resumeInstallingUpdateWithCompletion:completionBlock]; + } else if (self.resumableUpdate != nil) { + [self.driver resumeDownloadedUpdate:(SUDownloadedUpdate * _Nonnull)self.resumableUpdate completion:completionBlock]; } else { - [self.driver resumeUpdateWithCompletion:completionBlock]; + [self.driver checkForUpdatesAtAppcastURL:theFeedURL withUserAgent:[self userAgentString] httpHeaders:[self httpHeaders] completion:completionBlock]; } } else { [self.driver abortUpdate]; diff --git a/Sparkle/SUUserDriver.h b/Sparkle/SUUserDriver.h index 3e68fdd3..e710f2e4 100644 --- a/Sparkle/SUUserDriver.h +++ b/Sparkle/SUUserDriver.h @@ -92,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN * * Respond to the user initiating an update check. Sparkle uses this to show the user a window with an indeterminate progress bar. * - * @param updateCheckStatusCompletion A reply indicating whether the initiated update check is done or cancelled. + * @param updateCheckStatusCompletion A reply indicating whether the initiated update check is done or canceled. * Attempts to canceling can be made before -dismissUserInitiatedUpdateCheck is invoked. Replying with SUUserInitiatedCheckDone * on the other hand should not be done until -dismissUserInitiatedUpdateCheck is invoked. * @@ -130,16 +130,24 @@ NS_ASSUME_NONNULL_BEGIN - (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUUpdateAlertChoice))reply; /*! - * Show the user a downloaded update can be resumed and installed immediately + * Show the user a new update has been downloaded and can be installed * - * Let the user know a downloaded update can be installed ask them what they want to do. + * This method behaves just like -showUpdateFoundWithAppcastItem:reply: except the update has already been downloaded. + */ +- (void)showDownloadedUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUUpdateAlertChoice))reply; + +/*! + * Show the user an update that has started installing can be resumed and installed immediately + * + * Let the user know an update that has already been downloaded and started installing can be resumed. + * Note at this point the update cannot be canceled. * * @param appcastItem The Appcast Item containing information that reflects the new update * * @param reply A reply of SUInstallAndRelaunchUpdateNow installs the update immediately and relaunches the new update. - * A reply of SUInstallUpdateNow installes the update immediately but does not relaunch the new update. - * A reply of SUDismissUpdateInstallation dismisses the update installation. Note the update may still be installed after - * the application terminates, however there is not a strong guarantee that this will happen. + * A reply of SUInstallUpdateNow installs the update immediately but does not relaunch the new update. + * A reply of SUDismissUpdateInstallation dismisses the update installation. Note the update will attempt to finish installation + * after the application terminates. * * This can be called from any thread */ @@ -199,10 +207,10 @@ NS_ASSUME_NONNULL_BEGIN * * Let the user know that downloading the new update started. * - * @param downloadUpdateStatusCompletion A reply of SUDownloadUpdateCancelled can be used to cancel - * the download at any point before -showDownloadFinishedAndStartedExtractingUpdate is invoked. + * @param downloadUpdateStatusCompletion A reply of SUDownloadUpdateCanceled can be used to cancel + * the download at any point before -showDownloadDidStartExtractingUpdate is invoked. * A reply of SUDownloadUpdateDone signifies that the download is done, which should not be invoked until - * -showDownloadFinishedAndStartedExtractingUpdate + * -showDownloadDidStartExtractingUpdate * * This can be called from any thread */ @@ -233,9 +241,12 @@ NS_ASSUME_NONNULL_BEGIN * This is an appropriate time to reply with SUDownloadUpdateDone if not done so already * Sparkle uses this to show an indeterminate progress bar. * + * Note that an update can resume at this point after having been downloaded before, + * so this may be called without any of the download callbacks being invoked prior. + * * This can be called from any thread */ -- (void)showDownloadFinishedAndStartedExtractingUpdate; +- (void)showDownloadDidStartExtractingUpdate; /*! * Show the user that the update is extracting with progress diff --git a/Sparkle/SUUserDriverCoreComponent.m b/Sparkle/SUUserDriverCoreComponent.m index 7ea17068..2711c379 100644 --- a/Sparkle/SUUserDriverCoreComponent.m +++ b/Sparkle/SUUserDriverCoreComponent.m @@ -155,7 +155,7 @@ - (void)cancelUpdateCheckStatus { if (self.updateCheckStatusCompletion != nil) { - self.updateCheckStatusCompletion(SUUserInitiatedCheckCancelled); + self.updateCheckStatusCompletion(SUUserInitiatedCheckCanceled); self.updateCheckStatusCompletion = nil; } } @@ -178,7 +178,7 @@ - (void)cancelDownloadStatus { if (self.downloadStatusCompletion != nil) { - self.downloadStatusCompletion(SUDownloadUpdateCancelled); + self.downloadStatusCompletion(SUDownloadUpdateCanceled); self.downloadStatusCompletion = nil; } } diff --git a/Sparkle/SUUserInitiatedUpdateDriver.m b/Sparkle/SUUserInitiatedUpdateDriver.m index 21b9b586..4c2c3c12 100644 --- a/Sparkle/SUUserInitiatedUpdateDriver.m +++ b/Sparkle/SUUserInitiatedUpdateDriver.m @@ -19,7 +19,6 @@ @property (nonatomic, readonly) SUUIBasedUpdateDriver *uiDriver; @property (nonatomic, readonly) id userDriver; @property (nonatomic) BOOL showingUserInitiatedProgress; -@property (nonatomic) BOOL canceledCheckForUpdates; @end @@ -28,7 +27,6 @@ @synthesize uiDriver = _uiDriver; @synthesize userDriver = _userDriver; @synthesize showingUserInitiatedProgress = _showingUserInitiatedProgress; -@synthesize canceledCheckForUpdates = _canceledCheckForUpdates; - (instancetype)initWithHost:(SUHost *)host sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id )userDriver updaterDelegate:(nullable id )updaterDelegate { @@ -48,10 +46,11 @@ switch (completionStatus) { case SUUserInitiatedCheckDone: break; - case SUUserInitiatedCheckCancelled: + case SUUserInitiatedCheckCanceled: dispatch_async(dispatch_get_main_queue(), ^{ - self.canceledCheckForUpdates = YES; - [self.userDriver dismissUserInitiatedUpdateCheck]; + if (self.showingUserInitiatedProgress) { + [self abortUpdate]; + } }); break; } @@ -60,9 +59,14 @@ [self.uiDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:YES completion:completionBlock]; } -- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock +- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock { - [self.uiDriver resumeUpdateWithCompletion:completionBlock]; + [self.uiDriver resumeInstallingUpdateWithCompletion:completionBlock]; +} + +- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock +{ + [self.uiDriver resumeDownloadedUpdate:downloadedUpdate completion:completionBlock]; } - (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error @@ -77,9 +81,7 @@ - (void)basicDriverDidFinishLoadingAppcast { - if (self.canceledCheckForUpdates) { - [self abortUpdate]; - } else if (self.showingUserInitiatedProgress) { + if (self.showingUserInitiatedProgress) { self.showingUserInitiatedProgress = NO; [self.userDriver dismissUserInitiatedUpdateCheck]; } @@ -94,6 +96,7 @@ { if (self.showingUserInitiatedProgress) { [self.userDriver dismissUserInitiatedUpdateCheck]; + self.showingUserInitiatedProgress = NO; } [self.uiDriver abortUpdateWithError:error]; } diff --git a/TestAppHelper/Info.plist b/TestAppHelper/Info.plist index 4ffe10a2..1f0842ff 100644 --- a/TestAppHelper/Info.plist +++ b/TestAppHelper/Info.plist @@ -30,6 +30,8 @@ NSRunLoop ServiceType Application + JoinExistingSession + NSAppTransportSecurity diff --git a/TestApplication/SUInstallUpdateViewController.h b/TestApplication/SUInstallUpdateViewController.h index 15e82bb9..aaa862e2 100644 --- a/TestApplication/SUInstallUpdateViewController.h +++ b/TestApplication/SUInstallUpdateViewController.h @@ -13,6 +13,6 @@ @interface SUInstallUpdateViewController : NSViewController -- (instancetype)initWithAppcastItem:(SUAppcastItem *)appcastItem alreadyDownloaded:(BOOL)alreadyDownloaded reply:(void (^)(SUUpdateAlertChoice))reply; +- (instancetype)initWithAppcastItem:(SUAppcastItem *)appcastItem skippable:(BOOL)skippable reply:(void (^)(SUUpdateAlertChoice))reply; @end diff --git a/TestApplication/SUInstallUpdateViewController.m b/TestApplication/SUInstallUpdateViewController.m index b080272d..42d417b4 100644 --- a/TestApplication/SUInstallUpdateViewController.m +++ b/TestApplication/SUInstallUpdateViewController.m @@ -15,7 +15,7 @@ @property (nonatomic) IBOutlet NSTextView *textView; @property (nonatomic, readonly) SUAppcastItem *appcastItem; @property (nonatomic, copy) void (^reply)(SUUpdateAlertChoice); -@property (nonatomic, readonly) BOOL alreadyDownloaded; +@property (nonatomic, readonly) BOOL skippable; @end @@ -25,14 +25,14 @@ @synthesize textView = _textView; @synthesize appcastItem = _appcastItem; @synthesize reply = _reply; -@synthesize alreadyDownloaded = _alreadyDownloaded; +@synthesize skippable = _skippable; -- (instancetype)initWithAppcastItem:(SUAppcastItem *)appcastItem alreadyDownloaded:(BOOL)alreadyDownloaded reply:(void (^)(SUUpdateAlertChoice))reply +- (instancetype)initWithAppcastItem:(SUAppcastItem *)appcastItem skippable:(BOOL)skippable reply:(void (^)(SUUpdateAlertChoice))reply { self = [super initWithNibName:@"SUInstallUpdateViewController" bundle:nil]; if (self != nil) { _appcastItem = appcastItem; - _alreadyDownloaded = alreadyDownloaded; + _skippable = skippable; self.reply = reply; } return self; @@ -42,7 +42,7 @@ { [super viewDidLoad]; - self.skipUpdatesButton.enabled = !self.alreadyDownloaded; + self.skipUpdatesButton.enabled = self.skippable; [[self.textView enclosingScrollView] setDrawsBackground:NO]; [self.textView setDrawsBackground:NO]; diff --git a/TestApplication/SUPopUpTitlebarUserDriver.m b/TestApplication/SUPopUpTitlebarUserDriver.m index 4f5d345c..5dcea2dc 100644 --- a/TestApplication/SUPopUpTitlebarUserDriver.m +++ b/TestApplication/SUPopUpTitlebarUserDriver.m @@ -160,14 +160,14 @@ #pragma mark Update Found -- (void)showUpdateWithAppcastItem:(SUAppcastItem *)appcastItem alreadyDownloaded:(BOOL)alreadyDownloaded reply:(void (^)(SUUpdateAlertChoice))reply +- (void)showUpdateWithAppcastItem:(SUAppcastItem *)appcastItem skippable:(BOOL)skippable reply:(void (^)(SUUpdateAlertChoice))reply { NSPopover *popover = [[NSPopover alloc] init]; popover.behavior = NSPopoverBehaviorTransient; [self addUpdateButtonWithTitle:@"Update Available" action:^(NSButton *button) { if (popover.contentViewController == nil) { - popover.contentViewController = [[SUInstallUpdateViewController alloc] initWithAppcastItem:appcastItem alreadyDownloaded:alreadyDownloaded reply:^(SUUpdateAlertChoice choice) { + popover.contentViewController = [[SUInstallUpdateViewController alloc] initWithAppcastItem:appcastItem skippable:skippable reply:^(SUUpdateAlertChoice choice) { reply(choice); [popover close]; @@ -182,14 +182,21 @@ - (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUUpdateAlertChoice))reply { dispatch_async(dispatch_get_main_queue(), ^{ - [self showUpdateWithAppcastItem:appcastItem alreadyDownloaded:NO reply:reply]; + [self showUpdateWithAppcastItem:appcastItem skippable:YES reply:reply]; + }); +} + +- (void)showDownloadedUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUUpdateAlertChoice))reply +{ + dispatch_async(dispatch_get_main_queue(), ^{ + [self showUpdateWithAppcastItem:appcastItem skippable:YES reply:reply]; }); } - (void)showResumableUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUInstallUpdateStatus))reply { dispatch_async(dispatch_get_main_queue(), ^{ - [self showUpdateWithAppcastItem:appcastItem alreadyDownloaded:YES reply:^(SUUpdateAlertChoice choice) { + [self showUpdateWithAppcastItem:appcastItem skippable:NO reply:^(SUUpdateAlertChoice choice) { switch (choice) { case SUInstallUpdateChoice: reply(SUInstallAndRelaunchUpdateNow); @@ -304,7 +311,7 @@ }); } -- (void)showDownloadFinishedAndStartedExtractingUpdate +- (void)showDownloadDidStartExtractingUpdate { dispatch_async(dispatch_get_main_queue(), ^{ [self.coreComponent completeDownloadStatus]; diff --git a/Tests/SUFileManagerTest.swift b/Tests/SUFileManagerTest.swift index 3d9dbe7a..26fcf4d7 100644 --- a/Tests/SUFileManagerTest.swift +++ b/Tests/SUFileManagerTest.swift @@ -355,10 +355,4 @@ class SUFileManagerTest: XCTestCase XCTAssertNil(try? fileManager.makeDirectoryAtURL(validSymlinkURL)) } } - - func testAcquireBadAuthorization() - { - let fileManager = SUFileManager.defaultManager() - XCTAssertNil(try? fileManager._acquireAuthorization()) - } } diff --git a/Tests/SUInstallerTest.m b/Tests/SUInstallerTest.m index 8eee10c2..50c5f3b4 100644 --- a/Tests/SUInstallerTest.m +++ b/Tests/SUInstallerTest.m @@ -12,6 +12,7 @@ #import "SUInstaller.h" #import "SUInstallerProtocol.h" #import "SUStandardVersionComparator.h" +#import "SUInstallationType.h" #import @interface SUInstallerTest : XCTestCase @@ -39,7 +40,7 @@ if (uid) { NSLog(@"Test must be run as root: sudo xctest -XCTest SUInstallerTest 'Sparkle Unit Tests.xctest'"); - return; // or just comment this line out and enter password when the auth. prompt comes up + return; } NSString *expectedDestination = @"/tmp/sparklepkgtest.app"; @@ -54,7 +55,7 @@ SUHost *host = [[SUHost alloc] initWithBundle:bundle]; NSError *installerError = nil; - id installer = [SUInstaller installerForHost:host updateDirectory:[path stringByDeletingLastPathComponent] allowingInteraction:NO versionComparator:[SUStandardVersionComparator standardVersionComparator] error:&installerError]; + id installer = [SUInstaller installerForHost:host expectedInstallationType:SUInstallationTypeGuidedPackage updateDirectory:[path stringByDeletingLastPathComponent] allowingInteraction:NO versionComparator:[SUStandardVersionComparator standardVersionComparator] error:&installerError]; if (installer == nil) { XCTFail(@"Installer is nil with error: %@", installerError); @@ -67,11 +68,8 @@ return; } - NSString *fileOperationToolPath = [bundle pathForResource:@""SPARKLE_FILEOP_TOOL_NAME ofType:@""]; - XCTAssertNotNil(fileOperationToolPath); - NSError *secondStageError = nil; - if (![installer performSecondStageAllowingAuthorization:YES fileOperationToolPath:fileOperationToolPath environment:nil allowingUI:YES error:&secondStageError]) { + if (![installer performSecondStageAllowingUI:YES error:&secondStageError]) { NSLog(@"Underlying error: %@", [secondStageError.userInfo objectForKey:NSUnderlyingErrorKey]); XCTFail(@"Second Stage failed with error: %@", secondStageError); return; diff --git a/Tests/SUUpdaterTest.m b/Tests/SUUpdaterTest.m index 2927701f..6c731e68 100644 --- a/Tests/SUUpdaterTest.m +++ b/Tests/SUUpdaterTest.m @@ -35,6 +35,8 @@ - (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)__unused appcastItem reply:(void (^)(SUUpdateAlertChoice))__unused reply {} +- (void)showDownloadedUpdateFoundWithAppcastItem:(SUAppcastItem *)__unused appcastItem reply:(void (^)(SUUpdateAlertChoice))__unused reply {} + - (void)showResumableUpdateFoundWithAppcastItem:(SUAppcastItem *)__unused appcastItem reply:(void (^)(SUInstallUpdateStatus))__unused reply {} - (void)showUpdateReleaseNotes:(NSData *)__unused releaseNotes {} @@ -51,7 +53,7 @@ - (void)showDownloadDidReceiveDataOfLength:(NSUInteger)__unused length {} -- (void)showDownloadFinishedAndStartedExtractingUpdate {} +- (void)showDownloadDidStartExtractingUpdate {} - (void)showExtractionReceivedProgress:(double)__unused progress {} diff --git a/fileop/SUFileOperationConstants.h b/fileop/SUFileOperationConstants.h deleted file mode 100644 index 9f4ba685..00000000 --- a/fileop/SUFileOperationConstants.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// SUFileOperationConstants.h -// Sparkle -// -// Created by Mayur Pawashe on 6/5/16. -// Copyright © 2016 Sparkle Project. All rights reserved. -// - -extern char * const SUFileOpRemoveQuarantineCommand; -extern char * const SUFileOpCopyCommand; -extern char * const SUFileOpMoveCommand; -extern char * const SUFileOpChangeOwnerAndGroupCommand; -extern char * const SUFileOpUpdateModificationAndAccessTimeCommand; -extern char * const SUFileOpMakeDirectoryCommand; -extern char * const SUFileOpRemoveCommand; -extern char * const SUFileOpInstallCommand; diff --git a/fileop/SUFileOperationConstants.m b/fileop/SUFileOperationConstants.m deleted file mode 100644 index 5ece5917..00000000 --- a/fileop/SUFileOperationConstants.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// SUFileOperationConstants.m -// Sparkle -// -// Created by Mayur Pawashe on 6/5/16. -// Copyright © 2016 Sparkle Project. All rights reserved. -// - -#import "SUFileOperationConstants.h" - -char * const SUFileOpRemoveQuarantineCommand = "xattr-d-apple-quarantine"; -char * const SUFileOpCopyCommand = "cp"; -char * const SUFileOpMoveCommand = "mv"; -char * const SUFileOpChangeOwnerAndGroupCommand = "chown"; -char * const SUFileOpUpdateModificationAndAccessTimeCommand = "touch"; -char * const SUFileOpMakeDirectoryCommand = "mkdir"; -char * const SUFileOpRemoveCommand = "rm"; -char * const SUFileOpInstallCommand = "installer"; diff --git a/fileop/fileop.m b/fileop/fileop.m deleted file mode 100644 index 044f2abc..00000000 --- a/fileop/fileop.m +++ /dev/null @@ -1,151 +0,0 @@ -// -// fileop.m -// fileop -// -// Created by Mayur Pawashe on 6/5/16. -// Copyright © 2016 Sparkle Project. All rights reserved. -// - -#import -#import "SUFileManager.h" -#import "SUFileOperationConstants.h" - -// If we fail, we exit with a unique status code -// We don't try to NSLog because the logs can't be seen anywhere, -// and we don't want to log to a file irresponsibly (especially as root), -// nor want to communicate to the parent forcing the parent to read from the stdout pipe -// (allowing us to avoid any sort of potential blocking issues?) -typedef NS_ENUM(uint8_t, SUFileOpError) -{ - SUWritePIDFailure = 0x02, - SUFlushFailure = 0x03, - SUInsufficientNumberOfArguments = 0x04, - SUCommandNameUTF8ParseFailure = 0x05, - SUPathUTF8ParseFailure = 0x06, - SUQuarantineRemovalFailure = 0x07, - SUCopyFailure = 0x08, - SUMoveFailure = 0x09, - SUChangeOwnerAndGroupFailure = 0x0A, - SUTouchFailure = 0x0B, - SUMakeDirectoryFailure = 0x0C, - SURemoveFailure = 0x0D, - SUPackageFailureStatusCode = 0x0E, - SUPackageRaisedExceptionFailure = 0x0F, - SUInvalidCommandFailure = 0x10, - // This code can be OR'd with another one to produce a unique combination - SUInvalidOrNoDestination = 0x80 -}; - -int main(int argc, const char *argv[]) -{ - @autoreleasepool { - // Before we do anything, we should let the parent know our pid so they can wait() on us - // We do this because AuthorizationExecuteWithPrivileges() has no way of reporting back the child pid, - // but it does give us a communication pipe - uint32_t pid = CFSwapInt32HostToLittle((uint32_t)getpid()); - if (fwrite(&pid, sizeof(pid), 1, stdout) < 1) { - exit(SUWritePIDFailure); - } - - if (fflush(stdout) != 0) { - exit(SUFlushFailure); - } - - // At least we need the command name and file path arguments - if (argc < 3) { - exit(SUInsufficientNumberOfArguments); - } - - NSString *command = [[NSString alloc] initWithUTF8String:argv[1]]; - if (command == nil) { - exit(SUCommandNameUTF8ParseFailure); - } - - NSString *filepath = [[NSString alloc] initWithUTF8String:argv[2]]; - if (filepath == nil) { - exit(SUPathUTF8ParseFailure); - } - - NSURL *fileURL = [NSURL fileURLWithPath:filepath]; - if (fileURL == nil) { - exit(SUPathUTF8ParseFailure); - } - - NSURL *destinationURL = nil; - if (argc >= 4) { - NSString *destinationPath = [[NSString alloc] initWithUTF8String:argv[3]]; - if (destinationPath != nil) { - destinationURL = [NSURL fileURLWithPath:destinationPath]; - } - } - - // This tool should be executed as root, so we should not try to authorize - SUFileManager *fileManager = [SUFileManager defaultManager]; - - if ([command isEqualToString:@(SUFileOpRemoveQuarantineCommand)]) { - if (![fileManager releaseItemFromQuarantineAtRootURL:fileURL error:NULL]) { - exit(SUQuarantineRemovalFailure); - } - } else if ([command isEqualToString:@(SUFileOpCopyCommand)]) { - if (destinationURL != nil) { - if (![fileManager copyItemAtURL:fileURL toURL:destinationURL error:NULL]) { - exit(SUCopyFailure); - } - } else { - exit(SUInvalidOrNoDestination | SUCopyFailure); - } - } else if ([command isEqualToString:@(SUFileOpMoveCommand)]) { - if (destinationURL != nil) { - if (![fileManager moveItemAtURL:fileURL toURL:destinationURL error:NULL]) { - exit(SUMoveFailure); - } - } else { - exit(SUInvalidOrNoDestination | SUMoveFailure); - } - } else if ([command isEqualToString:@(SUFileOpChangeOwnerAndGroupCommand)]) { - if (destinationURL != nil) { - if (![fileManager changeOwnerAndGroupOfItemAtRootURL:fileURL toMatchURL:destinationURL error:NULL]) { - exit(SUChangeOwnerAndGroupFailure); - } - } else { - exit(SUInvalidOrNoDestination | SUChangeOwnerAndGroupFailure); - } - } else if ([command isEqualToString:@(SUFileOpUpdateModificationAndAccessTimeCommand)]) { - if (![fileManager updateModificationAndAccessTimeOfItemAtURL:fileURL error:NULL]) { - exit(SUTouchFailure); - } - } else if ([command isEqualToString:@(SUFileOpMakeDirectoryCommand)]) { - if (![fileManager makeDirectoryAtURL:fileURL error:NULL]) { - exit(SUMakeDirectoryFailure); - } - } else if ([command isEqualToString:@(SUFileOpRemoveCommand)]) { - if (![fileManager removeItemAtURL:fileURL error:NULL]) { - exit(SURemoveFailure); - } - } else if ([command isEqualToString:@(SUFileOpInstallCommand)]) { - // The one command that can *only* be run as the root user - NSString *installerPath = @"/usr/sbin/installer"; - - NSTask *task = [[NSTask alloc] init]; - task.launchPath = installerPath; - task.arguments = @[@"-pkg", filepath, @"-target", @"/"]; - // Output won't show up anyway, so we may as well ignore it - task.standardError = [NSPipe pipe]; - task.standardOutput = [NSPipe pipe]; - - @try { - [task launch]; - [task waitUntilExit]; - if (task.terminationStatus != EXIT_SUCCESS) { - exit(SUPackageFailureStatusCode); - } - } @catch (NSException *) { - exit(SUPackageRaisedExceptionFailure); - } - } else { - exit(SUInvalidCommandFailure); - } - - return EXIT_SUCCESS; - } -} diff --git a/sparkle-cli/SUCommandLineUserDriver.m b/sparkle-cli/SUCommandLineUserDriver.m index b1892560..fbf05d9b 100644 --- a/sparkle-cli/SUCommandLineUserDriver.m +++ b/sparkle-cli/SUCommandLineUserDriver.m @@ -149,6 +149,14 @@ }); } +- (void)showDownloadedUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUUpdateAlertChoice))reply +{ + dispatch_async(dispatch_get_main_queue(), ^{ + [self showUpdateWithAppcastItem:appcastItem updateAdjective:@"downloaded"]; + reply(SUInstallUpdateChoice); + }); +} + - (void)showResumableUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUInstallUpdateStatus))reply { dispatch_async(dispatch_get_main_queue(), ^{ @@ -234,7 +242,7 @@ }); } -- (void)showDownloadFinishedAndStartedExtractingUpdate +- (void)showDownloadDidStartExtractingUpdate { dispatch_async(dispatch_get_main_queue(), ^{ [self.coreComponent completeDownloadStatus];