One more fix #254

This commit is contained in:
Namhyeon Go 2025-05-17 14:14:15 +09:00
parent f60754d9d4
commit b2db6a4b0a

View File

@ -194,14 +194,8 @@ namespace WelsonJS.Launcher
{ {
int exitCode = -1; int exitCode = -1;
string fileName = execFilePath; string fileName = useCmd ? "cmd.exe" : execFilePath;
string adjustedArguments = arguments; string adjustedArguments = useCmd ? $"/c \"{execFilePath}\" {arguments}" : arguments;
if (useCmd && !String.IsNullOrEmpty(workingDirectory))
{
fileName = "cmd.exe";
adjustedArguments = $"/c cd /d \"{workingDirectory}\" && \"{execFilePath}\" {arguments}";
}
var psi = new ProcessStartInfo var psi = new ProcessStartInfo
{ {
@ -222,13 +216,9 @@ namespace WelsonJS.Launcher
} }
if (exitCode != 0) if (exitCode != 0)
{
Trace.TraceWarning($"{fileName} exit with code {exitCode}"); Trace.TraceWarning($"{fileName} exit with code {exitCode}");
}
else else
{
Trace.TraceInformation($"{fileName} finished successfully"); Trace.TraceInformation($"{fileName} finished successfully");
}
return exitCode == 0; return exitCode == 0;
} }