diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index 8a1d4062..aee99818 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -1,13 +1,13 @@ // Common -RELAUNCH_TOOL_PRODUCT_NAME = Autoupdate +FINISH_INSTALL_TOOL_NAME = Autoupdate CURRENT_PROJECT_VERSION = 1.6 GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_PREFIX_HEADER = $(SDKROOT)/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h ARCHS = i386 x86_64 -SPARKLE_COMMON_CFLAGS = -DRELAUNCH_TOOL_PRODUCT_NAME=$(RELAUNCH_TOOL_PRODUCT_NAME) +GCC_PREPROCESSOR_DEFINITIONS = FINISH_INSTALL_TOOL_NAME=$(FINISH_INSTALL_TOOL_NAME) // Enable warnings GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES diff --git a/Configurations/ConfigCommonDebug.xcconfig b/Configurations/ConfigCommonDebug.xcconfig index f190a761..c5f70898 100644 --- a/Configurations/ConfigCommonDebug.xcconfig +++ b/Configurations/ConfigCommonDebug.xcconfig @@ -4,5 +4,5 @@ GCC_OPTIMIZATION_LEVEL = 0 DEBUG_INFORMATION_FORMAT = dwarf GCC_GENERATE_DEBUGGING_SYMBOLS = YES SPARKLE_EXTRA_DEBUG = -DDEBUG -OTHER_CFLAGS = $(SPARKLE_COMMON_CFLAGS) $(SPARKLE_EXTRA_DEBUG) +OTHER_CFLAGS = $(SPARKLE_EXTRA_DEBUG) diff --git a/Configurations/ConfigRelaunch.xcconfig b/Configurations/ConfigRelaunch.xcconfig index b56a3f31..d7e0db00 100644 --- a/Configurations/ConfigRelaunch.xcconfig +++ b/Configurations/ConfigRelaunch.xcconfig @@ -1,4 +1,4 @@ // Relaunch Tool only -PRODUCT_NAME = $(RELAUNCH_TOOL_PRODUCT_NAME) +PRODUCT_NAME = $(FINISH_INSTALL_TOOL_NAME) SKIP_INSTALL = YES diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index 231c1ec5..3a060b11 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -21,6 +21,15 @@ #import "SUCodeSigningVerifier.h" #import "SUUpdater_Private.h" +#ifdef FINISH_INSTALL_TOOL_NAME + // FINISH_INSTALL_TOOL_NAME expands to unquoted finish_install + #define QUOTE_NS_STRING2(str) @"" #str + #define QUOTE_NS_STRING1(str) QUOTE_NS_STRING2(str) + #define FINISH_INSTALL_TOOL_NAME_STRING QUOTE_NS_STRING1(FINISH_INSTALL_TOOL_NAME) +#else + #error FINISH_INSTALL_TOOL_NAME not defined +#endif + @interface SUBasicUpdateDriver () ; @end @@ -325,14 +334,11 @@ if ([[updater delegate] respondsToSelector:@selector(updater:willInstallUpdate:)]) [[updater delegate] updater:updater willInstallUpdate:updateItem]; - // RELAUNCH_TOOL_PRODUCT_NAME expands to unquoted finish_install - #define NS_STRING_FROM_MACRO(s) NS_STRING_FROM_MACRO_QUOTE_(s) - #define NS_STRING_FROM_MACRO_QUOTE_(s) @"" #s - NSString *relaunchName = NS_STRING_FROM_MACRO(RELAUNCH_TOOL_PRODUCT_NAME); + NSString *const finishInstallToolName = FINISH_INSTALL_TOOL_NAME_STRING; // 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. - NSString *relaunchPathToCopy = [SPARKLE_BUNDLE pathForResource:relaunchName ofType:@"app"]; + NSString *relaunchPathToCopy = [SPARKLE_BUNDLE pathForResource:finishInstallToolName ofType:@"app"]; if (relaunchPathToCopy != nil) { NSString *targetPath = [[host appSupportPath] stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]]; @@ -361,7 +367,7 @@ NSString *pathToRelaunch = [host bundlePath]; if ([[updater delegate] respondsToSelector:@selector(pathToRelaunchForUpdater:)]) pathToRelaunch = [[updater delegate] pathToRelaunchForUpdater:updater]; - NSString *relaunchToolPath = [[relaunchPath stringByAppendingPathComponent: @"/Contents/MacOS"] stringByAppendingPathComponent: relaunchName]; + NSString *relaunchToolPath = [[relaunchPath stringByAppendingPathComponent: @"/Contents/MacOS"] stringByAppendingPathComponent: finishInstallToolName]; [NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:[NSArray arrayWithObjects: [host bundlePath], pathToRelaunch,