diff --git a/OpenRA.Launcher.Mac/Controller.m b/OpenRA.Launcher.Mac/Controller.m index f22ab95e4c..9a5cfee9b7 100644 --- a/OpenRA.Launcher.Mac/Controller.m +++ b/OpenRA.Launcher.Mac/Controller.m @@ -74,7 +74,6 @@ extern char **environ; NSMutableArray *taskArgs = [NSMutableArray arrayWithObjects:@"OpenRA.Utility.exe", @"--settings-value", - [@"~/Library/Application Support/OpenRA" stringByExpandingTildeInPath], @"Graphics.Mode", nil]; [task setCurrentDirectoryPath:gamePath]; @@ -91,7 +90,7 @@ extern char **environ; defaultButton:@"Quit" alternateButton:nil otherButton:nil - informativeTextWithFormat:@"OpenRA.Utility.exe returned an error and cannot continue."]; + informativeTextWithFormat:@"OpenRA.Utility returned an error and cannot continue.\n\nA log has been saved to ~/Library/Application Support/OpenRA/Logs/utility.log"]; [alert runModal]; [[NSApplication sharedApplication] terminate:self]; @@ -115,7 +114,6 @@ extern char **environ; gamePath, monoPath, [NSString stringWithFormat:@"UtilityPath=%@", [[NSBundle mainBundle] executablePath]], - [NSString stringWithFormat:@"SupportDir=%@",[@"~/Library/Application Support/OpenRA" stringByExpandingTildeInPath]], nil]; FSRef appRef; CFURLGetFSRef((CFURLRef)[NSURL URLWithString:[[[NSBundle mainBundle] executablePath] stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]], &appRef); diff --git a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA index 8855166ff2..b9b0a89b45 100755 Binary files a/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA and b/OpenRA.Launcher.Mac/build/Release/OpenRA.app/Contents/MacOS/OpenRA differ diff --git a/OpenRA.Launcher.Mac/main.m b/OpenRA.Launcher.Mac/main.m index 0c84cb1c01..27f8b253da 100644 --- a/OpenRA.Launcher.Mac/main.m +++ b/OpenRA.Launcher.Mac/main.m @@ -13,7 +13,7 @@ int main(int argc, char *argv[]) { /* When launching a mod, the arguments are of the form * --launch */ - if (argc >= 7 && strcmp(argv[1], "--launch") == 0) + if (argc >= 6 && strcmp(argv[1], "--launch") == 0) { /* Change into the game dir */ chdir(argv[3]); @@ -24,7 +24,6 @@ int main(int argc, char *argv[]) "--debug", "OpenRA.Game.exe", argv[5], - argv[6], NULL }; diff --git a/OpenRA.Utility/Command.cs b/OpenRA.Utility/Command.cs index 7d75ec66da..df8c67c88f 100644 --- a/OpenRA.Utility/Command.cs +++ b/OpenRA.Utility/Command.cs @@ -39,16 +39,15 @@ namespace OpenRA.Utility public static void Settings(string[] args) { - if (args.Length < 3) + if (args.Length < 2) { Console.WriteLine("Error: Invalid syntax"); return; } - - var section = args[2].Split('.')[0]; - var field = args[2].Split('.')[1]; - string expandedPath = args[1].Replace("~", Environment.GetFolderPath(Environment.SpecialFolder.Personal)); - var settings = new Settings(Path.Combine(expandedPath,"settings.yaml"), Arguments.Empty); + + var section = args[1].Split('.')[0]; + var field = args[1].Split('.')[1]; + var settings = new Settings(Platform.SupportDir + "settings.yaml", Arguments.Empty); var result = settings.Sections[section].GetType().GetField(field).GetValue(settings.Sections[section]); Console.WriteLine(result); } diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 91a13d19a4..6c76c17d8a 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -30,9 +30,7 @@ namespace OpenRA.Utility if (args.Length == 0) { PrintUsage(); return; } - var supportDir = GetNamedArg(args, "--SupportDir"); - if (supportDir != null) - Log.LogPath = Path.Combine(supportDir.Replace("\"", ""), "Logs"); + Log.LogPath = Platform.SupportDir + "Logs" + Path.DirectorySeparatorChar; try { @@ -57,7 +55,7 @@ namespace OpenRA.Utility { Console.WriteLine("Usage: OpenRA.Utility.exe [OPTION] [ARGS]"); Console.WriteLine(); - Console.WriteLine(" --settings-value SUPPORTDIR KEY Get value of KEY in SUPPORTDIR/settings.yaml"); + Console.WriteLine(" --settings-value KEY Get value of KEY from settings.yaml"); Console.WriteLine(" --shp PNGFILE FRAMEWIDTH Convert a PNG containing one or more frames to a SHP"); Console.WriteLine(" --png SHPFILE PALETTE Convert a SHP to a PNG containing all of its frames"); }