fix: try to fix blocking game running when launcher visibility was set to close after game started.

This commit is contained in:
huanghongxun
2020-09-04 00:38:38 +08:00
parent 674dfca34d
commit f4f1850271

View File

@@ -323,6 +323,9 @@ public class DefaultLauncher extends Launcher {
Process process; Process process;
try { try {
ProcessBuilder builder = new ProcessBuilder(rawCommandLine).directory(runDirectory); ProcessBuilder builder = new ProcessBuilder(rawCommandLine).directory(runDirectory);
if (listener == null) {
builder.inheritIO();
}
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);
process = builder.start(); process = builder.start();