diff --git a/OpenRA.Launcher.Mac/Controller.m b/OpenRA.Launcher.Mac/Controller.m index 06752f500a..d8bdd9e30c 100644 --- a/OpenRA.Launcher.Mac/Controller.m +++ b/OpenRA.Launcher.Mac/Controller.m @@ -29,7 +29,7 @@ { NSString *gamePath = [[NSUserDefaults standardUserDefaults] stringForKey:@"gamepath"]; - game = [[GameInstall alloc] initWithURL:[NSURL URLWithString:gamePath]]; + game = [[GameInstall alloc] initWithPath:gamePath]; [[JSBridge sharedInstance] setController:self]; downloads = [[NSMutableDictionary alloc] init]; hasMono = [self hasSupportedMono]; @@ -138,7 +138,8 @@ id aMod = [allMods objectForKey:key]; if ([aMod standalone]) { - id child = [SidebarEntry entryWithMod:aMod allMods:allMods baseURL:[[game gameURL] URLByAppendingPathComponent:@"mods"]]; + id path = [[game gamePath] stringByAppendingPathComponent:@"mods"]; + id child = [SidebarEntry entryWithMod:aMod allMods:allMods baseURL:[NSURL URLWithString:path]]; [rootItem addChild:child]; } } @@ -176,7 +177,7 @@ } #pragma mark Sidebar Datasource and Delegate -- (int)outlineView:(NSOutlineView *)anOutlineView numberOfChildrenOfItem:(id)item +- (NSInteger)outlineView:(NSOutlineView *)anOutlineView numberOfChildrenOfItem:(id)item { // Can be called before awakeFromNib; return nothing if (sidebarItems == nil) @@ -195,7 +196,7 @@ } - (id)outlineView:(NSOutlineView *)outlineView - child:(int)index + child:(NSInteger)index ofItem:(id)item { if (item == nil) @@ -271,10 +272,10 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn NSString *format = count == 1 ? @"1 download is" : [NSString stringWithFormat:@"%d downloads are",count]; NSAlert *alert = [NSAlert alertWithMessageText:@"Are you sure you want to quit?" - defaultButton:@"Cancel" + defaultButton:@"Wait" alternateButton:@"Quit" otherButton:nil - informativeTextWithFormat:@"%@ in progress and will be cancelled.", format]; + informativeTextWithFormat:@"%@ in progress and will be cancelled if you quit.", format]; [alert beginSheetModalForWindow:window modalDelegate:self didEndSelector:@selector(quitAlertEnded:code:context:) contextInfo:NULL]; return NSTerminateLater; diff --git a/OpenRA.Launcher.Mac/GameInstall.h b/OpenRA.Launcher.Mac/GameInstall.h index 1a6f219c88..d5ecae003f 100644 --- a/OpenRA.Launcher.Mac/GameInstall.h +++ b/OpenRA.Launcher.Mac/GameInstall.h @@ -11,13 +11,13 @@ @class Mod; @class Controller; @interface GameInstall : NSObject { - NSURL *gameURL; + NSString *gamePath; Controller *controller; NSMutableDictionary *downloadTasks; } -@property(readonly) NSURL *gameURL; +@property(readonly) NSString *gamePath; --(id)initWithURL:(NSURL *)path; +-(id)initWithPath:(NSString *)path; -(void)launchMod:(NSString *)mod; - (NSString *)runUtilityQuery:(NSString *)arg; - (NSArray *)installedMods; diff --git a/OpenRA.Launcher.Mac/GameInstall.m b/OpenRA.Launcher.Mac/GameInstall.m index f58be97fb6..6a3b7a59c2 100644 --- a/OpenRA.Launcher.Mac/GameInstall.m +++ b/OpenRA.Launcher.Mac/GameInstall.m @@ -11,14 +11,14 @@ #import "Mod.h" @implementation GameInstall -@synthesize gameURL; +@synthesize gamePath; --(id)initWithURL:(NSURL *)url +-(id)initWithPath:(NSString *)path { self = [super init]; if (self != nil) { - gameURL = [url retain]; + gamePath = [path retain]; downloadTasks = [[NSMutableDictionary alloc] init]; } return self; @@ -26,7 +26,7 @@ - (void)dealloc { - [gameURL release]; gameURL = nil; + [gamePath release]; gamePath = nil; [downloadTasks release]; downloadTasks = nil; [super dealloc]; } @@ -70,8 +70,8 @@ // Commit prev mod if (current != nil) { - id url = [gameURL URLByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]]; - [ret setObject:[Mod modWithId:current fields:fields baseURL:url] forKey:current]; + id path = [gamePath stringByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]]; + [ret setObject:[Mod modWithId:current fields:fields baseURL:[NSURL URLWithString:path]] forKey:current]; } NSLog(@"Parsing mod %@",value); current = value; @@ -84,8 +84,8 @@ } if (current != nil) { - id url = [gameURL URLByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]]; - [ret setObject:[Mod modWithId:current fields:fields baseURL:url] forKey:current]; + id path = [gamePath stringByAppendingPathComponent:[NSString stringWithFormat:@"mods/%@",current]]; + [ret setObject:[Mod modWithId:current fields:fields baseURL:[NSURL URLWithString:path]] forKey:current]; } return ret; @@ -99,7 +99,7 @@ // First argument is the directory to run in // Second...Nth arguments are passed to OpenRA.Game.exe // Launcher wrapper sets mono --debug, gl renderer and support dir. - NSArray *args = [NSArray arrayWithObjects:[gameURL absoluteString], + NSArray *args = [NSArray arrayWithObjects:gamePath, [NSString stringWithFormat:@"Game.Mods=%@",mod], nil]; @@ -131,7 +131,7 @@ [taskArgs addObject:arg]; NSTask *task = [[NSTask alloc] init]; - [task setCurrentDirectoryPath:[gameURL absoluteString]]; + [task setCurrentDirectoryPath:gamePath]; [task setLaunchPath:@"/Library/Frameworks/Mono.framework/Commands/mono"]; [task setArguments:taskArgs]; [task setStandardOutput:outPipe]; @@ -155,7 +155,7 @@ NSMutableArray *taskArgs = [NSMutableArray arrayWithObject:@"OpenRA.Utility.exe"]; [taskArgs addObject:arg]; - [task setCurrentDirectoryPath:[gameURL absoluteString]]; + [task setCurrentDirectoryPath:gamePath]; [task setLaunchPath:@"/Library/Frameworks/Mono.framework/Commands/mono"]; [task setArguments:taskArgs]; [task setStandardOutput:pipe]; diff --git a/OpenRA.Launcher.Mac/Mod.h b/OpenRA.Launcher.Mac/Mod.h index 58d34c503b..0383e5e6f8 100644 --- a/OpenRA.Launcher.Mac/Mod.h +++ b/OpenRA.Launcher.Mac/Mod.h @@ -15,6 +15,7 @@ NSString *version; NSString *author; NSString *requires; + NSString *description; BOOL standalone; } diff --git a/OpenRA.Launcher.Mac/OpenRA.app/Contents/MacOS/OpenRA b/OpenRA.Launcher.Mac/OpenRA.app/Contents/MacOS/OpenRA index 6915a4f6dd..ba2bea6897 100755 --- a/OpenRA.Launcher.Mac/OpenRA.app/Contents/MacOS/OpenRA +++ b/OpenRA.Launcher.Mac/OpenRA.app/Contents/MacOS/OpenRA @@ -5,6 +5,7 @@ # as published by the Free Software Foundation. For more information, # see LICENSE. +export DYLD_LIBRARY_PATH="$1:$DYLD_LIBRARY_PATH" echo "Launching OpenRA from $1" cd $1 mono --debug OpenRA.Game.exe SupportDir=~/Library/"Application Support"/OpenRA ${@:2} \ No newline at end of file diff --git a/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj b/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj index 0691b0418f..099271307a 100644 --- a/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj +++ b/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj @@ -21,6 +21,7 @@ DA9292C81291DF2D00EDB02E /* OpenRA.app in Resources */ = {isa = PBXBuildFile; fileRef = DA9292C71291DF2D00EDB02E /* OpenRA.app */; }; DA9295A712921DF900EDB02E /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA9295A612921DF900EDB02E /* WebKit.framework */; }; DA9296901292328200EDB02E /* SidebarEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = DA92968F1292328200EDB02E /* SidebarEntry.m */; }; + DAB887F5129E5D6C00C99407 /* SDL in Resources */ = {isa = PBXBuildFile; fileRef = DAB887EE129E5D6100C99407 /* SDL */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -50,6 +51,7 @@ DA9295A612921DF900EDB02E /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; DA92968E1292328200EDB02E /* SidebarEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SidebarEntry.h; sourceTree = ""; }; DA92968F1292328200EDB02E /* SidebarEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SidebarEntry.m; sourceTree = ""; }; + DAB887EE129E5D6100C99407 /* SDL */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = SDL; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -136,6 +138,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + DAB887EE129E5D6100C99407 /* SDL */, DA9292C71291DF2D00EDB02E /* OpenRA.app */, DA81FBDB12910E4900C48F2F /* OpenRA.icns */, 8D1107310486CEB800E47090 /* OpenRA-Info.plist */, @@ -180,6 +183,9 @@ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; + attributes = { + ORGANIZATIONNAME = OpenRA; + }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OpenRA" */; compatibilityVersion = "Xcode 3.1"; developmentRegion = English; @@ -204,6 +210,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + DAB887F5129E5D6C00C99407 /* SDL in Resources */, 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, DA81FBDC12910E4900C48F2F /* OpenRA.icns in Resources */, @@ -264,6 +271,10 @@ GCC_PREFIX_HEADER = OpenRA_Prefix.pch; INFOPLIST_FILE = "OpenRA-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)\"", + ); PRODUCT_NAME = OpenRA; }; name = Debug; @@ -278,6 +289,10 @@ GCC_PREFIX_HEADER = OpenRA_Prefix.pch; INFOPLIST_FILE = "OpenRA-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)\"", + ); PRODUCT_NAME = OpenRA; }; name = Release; @@ -292,7 +307,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; - SDKROOT = macosx10.6; + SDKROOT = macosx10.5; }; name = Debug; }; @@ -303,8 +318,9 @@ GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; - SDKROOT = macosx10.6; + SDKROOT = macosx10.5; }; name = Release; }; diff --git a/OpenRA.Launcher.Mac/SDL b/OpenRA.Launcher.Mac/SDL new file mode 100755 index 0000000000..2ccf7d95db Binary files /dev/null and b/OpenRA.Launcher.Mac/SDL differ diff --git a/OpenRA.Launcher.Mac/SidebarEntry.m b/OpenRA.Launcher.Mac/SidebarEntry.m index ad2a088275..3d3955007b 100644 --- a/OpenRA.Launcher.Mac/SidebarEntry.m +++ b/OpenRA.Launcher.Mac/SidebarEntry.m @@ -35,10 +35,8 @@ // Temporary hack until mods define an icon NSString* imageName = [[NSBundle mainBundle] pathForResource:@"OpenRA" ofType:@"icns"]; id icon = [[[NSImage alloc] initWithContentsOfFile:imageName] autorelease]; - id url = [[baseURL URLByAppendingPathComponent:[baseMod mod]] - URLByAppendingPathComponent:@"mod.html"]; - - id ret = [SidebarEntry entryWithTitle:[baseMod title] url:url icon:icon]; + id path = [[[baseURL absoluteString] stringByAppendingPathComponent:[baseMod mod]] stringByAppendingPathComponent:@"mod.html"]; + id ret = [SidebarEntry entryWithTitle:[baseMod title] url:[NSURL URLWithString:path] icon:icon]; for (id key in allMods) { diff --git a/packaging/osx/launcher/OpenRA-Info.plist b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Info.plist similarity index 81% rename from packaging/osx/launcher/OpenRA-Info.plist rename to OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Info.plist index 659d3b4322..8b9cbfdac4 100644 --- a/packaging/osx/launcher/OpenRA-Info.plist +++ b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Info.plist @@ -4,26 +4,28 @@ CFBundleDevelopmentRegion English + CFBundleDisplayName + OpenRA Launcher CFBundleExecutable - ${EXECUTABLE_NAME} + OpenRA CFBundleIconFile OpenRA.icns CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:rfc1034identifier} + org.open-ra.launcher CFBundleInfoDictionaryVersion 6.0 CFBundleName - ${PRODUCT_NAME} + OpenRA Launcher CFBundlePackageType APPL - CFBundleSignature - ???? CFBundleShortVersionString 1.0 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} + CFBundleSignature + ???? CFBundleVersion 1 + LSMinimumSystemVersion + 10.5 NSMainNibFile MainMenu NSPrincipalClass diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA new file mode 100755 index 0000000000..819af600b1 Binary files /dev/null and b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA differ diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/PkgInfo b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/PkgInfo new file mode 100644 index 0000000000..bd04210fb4 --- /dev/null +++ b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/English.lproj/InfoPlist.strings b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000..dea12de4ca Binary files /dev/null and b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/English.lproj/InfoPlist.strings differ diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/English.lproj/MainMenu.nib b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/English.lproj/MainMenu.nib new file mode 100644 index 0000000000..036262f521 Binary files /dev/null and b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/English.lproj/MainMenu.nib differ diff --git a/packaging/osx/launcher/OpenRA.app/Contents/Info.plist b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.app/Contents/Info.plist old mode 100644 new mode 100755 similarity index 100% rename from packaging/osx/launcher/OpenRA.app/Contents/Info.plist rename to OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.app/Contents/Info.plist diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.app/Contents/MacOS/OpenRA b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.app/Contents/MacOS/OpenRA new file mode 100755 index 0000000000..ba2bea6897 --- /dev/null +++ b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.app/Contents/MacOS/OpenRA @@ -0,0 +1,11 @@ +#!/bin/bash +# Copyright 2007-2010 The OpenRA Developers (see AUTHORS) +# This file is part of OpenRA, which is free software. It is made +# available to you under the terms of the GNU General Public License +# as published by the Free Software Foundation. For more information, +# see LICENSE. + +export DYLD_LIBRARY_PATH="$1:$DYLD_LIBRARY_PATH" +echo "Launching OpenRA from $1" +cd $1 +mono --debug OpenRA.Game.exe SupportDir=~/Library/"Application Support"/OpenRA ${@:2} \ No newline at end of file diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.app/Contents/Resources/OpenRA.icns b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.app/Contents/Resources/OpenRA.icns new file mode 120000 index 0000000000..5b28bc3de3 --- /dev/null +++ b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.app/Contents/Resources/OpenRA.icns @@ -0,0 +1 @@ +../../../OpenRA.icns \ No newline at end of file diff --git a/packaging/osx/launcher/OpenRA.app/Contents/Resources/OpenRA.icns b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.icns old mode 100644 new mode 100755 similarity index 100% rename from packaging/osx/launcher/OpenRA.app/Contents/Resources/OpenRA.icns rename to OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/OpenRA.icns diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/SDL b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/SDL new file mode 100755 index 0000000000..2ccf7d95db Binary files /dev/null and b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/Resources/SDL differ diff --git a/mods/cnc/mod.html b/mods/cnc/mod.html index 99abf38818..8de7422dea 100644 --- a/mods/cnc/mod.html +++ b/mods/cnc/mod.html @@ -107,7 +107,7 @@ function download() { - document.getElementById("download-status").value = "Initializing..." + document.getElementById("download-status").value = "Connecting..." window.external.startDownload("cnc-packages"); } @@ -232,7 +232,7 @@