diff --git a/Autoupdate/SPUMessageTypes.h b/Autoupdate/SPUMessageTypes.h index 9f6d244c..8b69a006 100644 --- a/Autoupdate/SPUMessageTypes.h +++ b/Autoupdate/SPUMessageTypes.h @@ -38,11 +38,6 @@ typedef NS_ENUM(int32_t, SPUUpdaterMessageType) SPUUpdaterAlivePong = 3 }; -typedef NS_ENUM(int32_t, SPUAgentMessageType) -{ - SPUAgentError = 100 -}; - BOOL SPUInstallerMessageTypeIsLegal(SPUInstallerMessageType oldMessageType, SPUInstallerMessageType newMessageType); NSString *SPUInstallerServiceNameForBundleIdentifier(NSString *bundleIdentifier); diff --git a/Sparkle/InstallerProgress/InstallerProgressAppController.m b/Sparkle/InstallerProgress/InstallerProgressAppController.m index ad3d6f61..75cac324 100644 --- a/Sparkle/InstallerProgress/InstallerProgressAppController.m +++ b/Sparkle/InstallerProgress/InstallerProgressAppController.m @@ -115,7 +115,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; int exitStatus = (strongSelf.repliedToRegistration ? EXIT_SUCCESS : EXIT_FAILURE); NSError *registrationError; if (!strongSelf.repliedToRegistration) { - registrationError = [NSError errorWithDomain:SUSparkleErrorDomain code:SPUAgentError userInfo:@{ NSLocalizedDescriptionKey: @"Error: Agent Invalidating without having the chance to reply to installer" }]; + registrationError = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAgentInvalidationError userInfo:@{ NSLocalizedDescriptionKey: @"Error: Agent Invalidating without having the chance to reply to installer" }]; } else { registrationError = nil; } @@ -215,7 +215,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; if (applicationBundlePath != nil && !self.willTerminate) { NSBundle *applicationBundle = [NSBundle bundleWithPath:applicationBundlePath]; if (applicationBundle == nil) { - [self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUAgentError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Error: Encountered invalid path for waiting termination: %@", applicationBundlePath] }]]; + [self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAgentInvalidationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Error: Encountered invalid path for waiting termination: %@", applicationBundlePath] }]]; } NSArray *runningApplications = [self runningApplicationsWithBundle:applicationBundle]; @@ -275,7 +275,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; // We should at least make sure we're opening a bundle however NSBundle *relaunchBundle = [NSBundle bundleWithPath:pathToRelaunch]; if (relaunchBundle == nil) { - [self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUAgentError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Error: Encountered invalid path to relaunch: %@", pathToRelaunch] }]]; + [self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAgentInvalidationError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Error: Encountered invalid path to relaunch: %@", pathToRelaunch] }]]; } // We only launch applications, but I'm not sure how reliable -launchApplicationAtURL:options:config: is so we're not using it diff --git a/Sparkle/SUErrors.h b/Sparkle/SUErrors.h index da9580e7..81c329c4 100644 --- a/Sparkle/SUErrors.h +++ b/Sparkle/SUErrors.h @@ -62,6 +62,7 @@ typedef NS_ENUM(OSStatus, SUError) { SUInstallationCanceledError = 4007, SUInstallationAuthorizeLaterError = 4008, SUNotAllowedInteractionError = 4009, + SUAgentInvalidationError = 4010, // API misuse errors. SUIncorrectAPIUsageError = 5000