Skip to content

Commit 6cd3c6c

Browse files
Support being ran from paths with spaces
1 parent 0bde62a commit 6cd3c6c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

MoonlightTVLauncher/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ void EndSession()
8787
{
8888
RunCommand("/c ares-launch -d tv --close com.limelight.webos");
8989
RunCommand("/c explorer.exe");
90-
RunCommand(@"/c " + Environment.CurrentDirectory + @"\Dependencies\ChangeScreenResolution.exe /w=" + configuration.OriginalResolutionX + " /h=" + configuration.OriginalResolutionY + " /f=" + configuration.OriginalResolutionHz + " /d=0");
90+
RunCommand("/c \"" + Environment.CurrentDirectory + "\"" + @"\Dependencies\ChangeScreenResolution.exe /w=" + configuration.OriginalResolutionX + " /h=" + configuration.OriginalResolutionY + " /f=" + configuration.OriginalResolutionHz + " /d=0");
9191
RunCommand("/c taskkill /F /IM " + configuration.PcApplicationUsedForStreaming);
9292
RunCommand("/c taskkill /IM " + configuration.PcApplicationBeingLaunched);
9393
moonlightTvStreamActive = false;
9494
//Wait for explorer to start up again before switching back to main desktop
9595
Thread.Sleep(5000);
96-
RunCommand("/c " + Environment.CurrentDirectory + @"\Dependencies\nircmdc sendkeypress rwin+ctrl+left");
96+
RunCommand("/c \"" + Environment.CurrentDirectory + "\"" + @"\Dependencies\nircmdc sendkeypress rwin+ctrl+left");
9797
}
9898

9999
bool StartStream()
@@ -105,15 +105,15 @@ bool StartStream()
105105
WakeOnLan.Wake(configuration.TvMacAddress);
106106
}
107107

108-
RunCommand("/c" + Environment.CurrentDirectory + @"\Dependencies\nircmdc sendkeypress rwin+ctrl+right");
108+
RunCommand("/c \"" + Environment.CurrentDirectory + "\"" + @"\Dependencies\nircmdc sendkeypress rwin+ctrl+right");
109109
//Wait for desktop to switch BEFORE killing explorer
110110
Thread.Sleep(1000);
111111
RunCommand("/c taskkill /F /IM explorer.exe");
112-
RunCommand(@"/c " + Environment.CurrentDirectory + @"\Dependencies\ChangeScreenResolution.exe /w=" + configuration.StreamResolutionX + " /h=" + configuration.StreamResolutionY + " /f=" + configuration.StreamResolutionHz + " /d=0");
112+
RunCommand("/c \"" + Environment.CurrentDirectory + "\"" + @"\Dependencies\ChangeScreenResolution.exe /w=" + configuration.StreamResolutionX + " /h=" + configuration.StreamResolutionY + " /f=" + configuration.StreamResolutionHz + " /d=0");
113113
RunCommand("/c ares-launch -d tv com.limelight.webos");
114114
//Give TV some time to open the MoonlightTV app before attempting TV input
115115
Thread.Sleep(3000);
116-
RunCommand("/c py " + Environment.CurrentDirectory + @"\Scripts\MoonlightTVAutoConnect.py" + " " + configuration.TvIpAddress + " " + configuration.TvClientKey + " " + configuration.TvMoonlightGameIndex);
116+
RunCommand("/c py \"" + Environment.CurrentDirectory + "\"" + @"\Scripts\MoonlightTVAutoConnect.py" + " " + configuration.TvIpAddress + " " + configuration.TvClientKey + " " + configuration.TvMoonlightGameIndex);
117117
}
118118

119119
Console.WriteLine("Streaming application started (" + configuration.PcApplicationUsedForStreaming + "). Output should be appearing on your TV now.");

0 commit comments

Comments
 (0)