Use preprocessor config instead of cflags

Newer terminology for relaunch.
Fail if finish_install tool name not defined.
This commit is contained in:
Kornel Lesiński committed 2014-02-02 17:30:49 +00:00
1 parent d34d2853f6
commit 01e9bd82be
4 files changed
+16 -10

No files matched your search

+2 -2
View File
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -1,4 +1,4 @@
// Relaunch Tool only
PRODUCT_NAME = $(RELAUNCH_TOOL_PRODUCT_NAME)
PRODUCT_NAME = $(FINISH_INSTALL_TOOL_NAME)
SKIP_INSTALL = YES
+12 -6
View File
@@ -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 () <NSURLDownloadDelegate>; @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,