From bcb8daba84f16fe4f9dc8281396982bf2150bcf4 Mon Sep 17 00:00:00 2001 From: Alexandre Oliveira Date: Sat, 30 Jan 2016 16:26:21 -0200 Subject: [PATCH] Wrap OpenRA arguments in quotes On Windows, if the path to the replay contained spaces, it wouldn't be parsed correctly and would crash the game. --- OpenRA.GameMonitor/GameMonitor.cs | 3 ++- packaging/windows/OpenRA.nsi | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRA.GameMonitor/GameMonitor.cs b/OpenRA.GameMonitor/GameMonitor.cs index 8d648ee3b2..e97ce778ad 100644 --- a/OpenRA.GameMonitor/GameMonitor.cs +++ b/OpenRA.GameMonitor/GameMonitor.cs @@ -12,6 +12,7 @@ using System; using System.Diagnostics; using System.Drawing; using System.IO; +using System.Linq; using System.Media; using System.Reflection; using System.Windows.Forms; @@ -30,7 +31,7 @@ namespace OpenRA Directory.SetCurrentDirectory(executableDirectory); - var psi = new ProcessStartInfo(processName, string.Join(" ", args)); + var psi = new ProcessStartInfo(processName, string.Join(" ", args.Select(arg => "\"" + arg + "\""))); try { diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index 5af1886c19..87c7c7aef1 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -59,7 +59,7 @@ Section "-Reg" Reg ; Replay file association WriteRegStr HKLM "Software\Classes\.orarep" "" "OpenRA_replay" WriteRegStr HKLM "Software\Classes\OpenRA_replay\DefaultIcon" "" "$INSTDIR\OpenRA.ico,0" - WriteRegStr HKLM "Software\Classes\OpenRA_replay\Shell\Open\Command" "" "$INSTDIR\OpenRA.exe Launch.Replay=%1" + WriteRegStr HKLM "Software\Classes\OpenRA_replay\Shell\Open\Command" "" "$INSTDIR\OpenRA.exe Launch.Replay=$\"%1$\"" ; OpenRA URL Scheme WriteRegStr HKLM "Software\Classes\openra" "" "URL:OpenRA scheme"