Temporarily disabled adjust process priority on Windows
This commit is contained in:
@@ -221,7 +221,7 @@ public class GameCrashWindow extends Stage {
|
|||||||
LogWindow logWindow = new LogWindow();
|
LogWindow logWindow = new LogWindow();
|
||||||
|
|
||||||
logWindow.logLine("Command: " + new CommandBuilder().addAll(managedProcess.getCommands()).toString(), Log4jLevel.INFO);
|
logWindow.logLine("Command: " + new CommandBuilder().addAll(managedProcess.getCommands()).toString(), Log4jLevel.INFO);
|
||||||
logWindow.logLine("ClassPath: " + managedProcess.getClasspath(), Log4jLevel.INFO);
|
if (managedProcess.getClasspath() != null) logWindow.logLine("ClassPath: " + managedProcess.getClasspath(), Log4jLevel.INFO);
|
||||||
for (Map.Entry<String, Log4jLevel> entry : logs)
|
for (Map.Entry<String, Log4jLevel> entry : logs)
|
||||||
logWindow.logLine(entry.getKey(), entry.getValue());
|
logWindow.logLine(entry.getKey(), entry.getValue());
|
||||||
|
|
||||||
|
|||||||
@@ -74,14 +74,14 @@ public class DefaultLauncher extends Launcher {
|
|||||||
switch (options.getProcessPriority()) {
|
switch (options.getProcessPriority()) {
|
||||||
case HIGH:
|
case HIGH:
|
||||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
||||||
res.add("cmd", "/C", "start", "unused title", "/B", "/high");
|
// res.add("cmd", "/C", "start", "unused title", "/B", "/high");
|
||||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||||
res.add("nice", "-n", "-5");
|
res.add("nice", "-n", "-5");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABOVE_NORMAL:
|
case ABOVE_NORMAL:
|
||||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
||||||
res.add("cmd", "/C", "start", "unused title", "/B", "/abovenormal");
|
// res.add("cmd", "/C", "start", "unused title", "/B", "/abovenormal");
|
||||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||||
res.add("nice", "-n", "-1");
|
res.add("nice", "-n", "-1");
|
||||||
}
|
}
|
||||||
@@ -91,14 +91,14 @@ public class DefaultLauncher extends Launcher {
|
|||||||
break;
|
break;
|
||||||
case BELOW_NORMAL:
|
case BELOW_NORMAL:
|
||||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
||||||
res.add("cmd", "/C", "start", "unused title", "/B", "/belownormal");
|
// res.add("cmd", "/C", "start", "unused title", "/B", "/belownormal");
|
||||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||||
res.add("nice", "-n", "1");
|
res.add("nice", "-n", "1");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LOW:
|
case LOW:
|
||||||
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
|
||||||
res.add("cmd", "/C", "start", "unused title", "/B", "/low");
|
// res.add("cmd", "/C", "start", "unused title", "/B", "/low");
|
||||||
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX || OperatingSystem.CURRENT_OS == OperatingSystem.OSX) {
|
||||||
res.add("nice", "-n", "5");
|
res.add("nice", "-n", "5");
|
||||||
}
|
}
|
||||||
@@ -450,15 +450,7 @@ public class DefaultLauncher extends Launcher {
|
|||||||
final Command command = generateCommandLine(nativeFolder);
|
final Command command = generateCommandLine(nativeFolder);
|
||||||
|
|
||||||
// To guarantee that when failed to generate launch command line, we will not call pre-launch command
|
// To guarantee that when failed to generate launch command line, we will not call pre-launch command
|
||||||
List<String> rawCommandLine = command.commandLine.asMutableList();
|
List<String> rawCommandLine = command.commandLine.asList();
|
||||||
|
|
||||||
// Pass classpath using the environment variable, to reduce the command length
|
|
||||||
String classpath = null;
|
|
||||||
final int cpIndex = rawCommandLine.indexOf("-cp");
|
|
||||||
if (cpIndex >= 0 && cpIndex < rawCommandLine.size() - 1) {
|
|
||||||
rawCommandLine.remove(cpIndex); // remove "-cp"
|
|
||||||
classpath = rawCommandLine.remove(cpIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (command.tempNativeFolder != null) {
|
if (command.tempNativeFolder != null) {
|
||||||
Files.deleteIfExists(command.tempNativeFolder);
|
Files.deleteIfExists(command.tempNativeFolder);
|
||||||
@@ -496,19 +488,14 @@ public class DefaultLauncher extends Launcher {
|
|||||||
}
|
}
|
||||||
String appdata = options.getGameDir().getAbsoluteFile().getParent();
|
String appdata = options.getGameDir().getAbsoluteFile().getParent();
|
||||||
if (appdata != null) builder.environment().put("APPDATA", appdata);
|
if (appdata != null) builder.environment().put("APPDATA", appdata);
|
||||||
if (classpath != null) {
|
|
||||||
builder.environment().put("CLASSPATH", classpath);
|
|
||||||
// Fix #1153: On Windows, the 'classpath' environment variable in the context overrides the 'CLASSPATH'
|
|
||||||
// Environment variables on Windows are not case-sensitive; The lowercase 'classpath' overwrites any other case.
|
|
||||||
builder.environment().put("classpath", classpath);
|
|
||||||
}
|
|
||||||
builder.environment().putAll(getEnvVars());
|
builder.environment().putAll(getEnvVars());
|
||||||
process = builder.start();
|
process = builder.start();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ProcessCreationException(e);
|
throw new ProcessCreationException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
ManagedProcess p = new ManagedProcess(process, rawCommandLine, classpath);
|
ManagedProcess p = new ManagedProcess(process, rawCommandLine);
|
||||||
if (listener != null)
|
if (listener != null)
|
||||||
startMonitors(p, listener, command.encoding, daemon);
|
startMonitors(p, listener, command.encoding, daemon);
|
||||||
return p;
|
return p;
|
||||||
|
|||||||
Reference in New Issue
Block a user