mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Переписал код использующий ProccessBuilder. Активные участники прошу работоспособность после этого коммита.
This commit is contained in:
parent
97b30aa234
commit
358e92ad9e
2 changed files with 14 additions and 15 deletions
|
@ -12,7 +12,6 @@
|
|||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -62,8 +61,8 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
|
|||
JVMHelper.addSystemPropertyToArgs(args, DirBridge.USE_OPTDIR_PROPERTY);
|
||||
if (!noJava9check && !System.getProperty("java.version").startsWith("1.8")) {
|
||||
LogHelper.debug("Found Java 9+ ( %s )", System.getProperty("java.version"));
|
||||
Collections.addAll(args, "--add-modules");
|
||||
Collections.addAll(args, "javafx.base,javafx.fxml,javafx.controls,jdk.unsupported");
|
||||
args.add("--add-modules");
|
||||
args.add("javafx.base,javafx.fxml,javafx.controls,jdk.unsupported");
|
||||
Path jvmDir = Paths.get(System.getProperty("java.home"));
|
||||
String pathToFx = System.getenv("PATH_TO_FX");
|
||||
Path fxPath = pathToFx == null ? null : Paths.get(pathToFx);
|
||||
|
@ -75,17 +74,17 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
|
|||
tryAddModule(findPath, "javafx.controls", builder);
|
||||
String modulePath = builder.toString();
|
||||
if (!modulePath.isEmpty()) {
|
||||
Collections.addAll(args, "--module-path");
|
||||
Collections.addAll(args, modulePath);
|
||||
args.add("--module-path");
|
||||
args.add(modulePath);
|
||||
}
|
||||
}
|
||||
Collections.addAll(args, MAGIC_ARG);
|
||||
Collections.addAll(args, "-XX:+DisableAttachMechanism");
|
||||
Collections.addAll(args, "-Xmx256M");
|
||||
args.add(MAGIC_ARG);
|
||||
args.add("-XX:+DisableAttachMechanism");
|
||||
args.add("-Xmx256M");
|
||||
//Collections.addAll(args, "-javaagent:".concat(pathLauncher));
|
||||
Collections.addAll(args, "-cp");
|
||||
Collections.addAll(args, pathLauncher);
|
||||
Collections.addAll(args, LauncherEngine.class.getName());
|
||||
args.add("-cp");
|
||||
args.add(pathLauncher);
|
||||
args.add(LauncherEngine.class.getName());
|
||||
LauncherEngine.modulesManager.callWrapper(processBuilder, args);
|
||||
EnvHelper.addEnv(processBuilder);
|
||||
LogHelper.debug("Commandline: " + args);
|
||||
|
|
|
@ -109,14 +109,14 @@ public ClientLauncherContext build() throws IOException {
|
|||
// Add classpath and main class
|
||||
String pathLauncher = IOHelper.getCodeSource(ClientLauncher.class).toString();
|
||||
context.pathLauncher = pathLauncher;
|
||||
Collections.addAll(context.args, ClientLauncherWrapper.MAGIC_ARG);
|
||||
context.args.add(ClientLauncherWrapper.MAGIC_ARG);
|
||||
Collections.addAll(context.args, profile.getJvmArgs());
|
||||
profile.pushOptionalJvmArgs(context.args);
|
||||
Collections.addAll(context.args, "-Djava.library.path=".concat(params.clientDir.resolve(nativesDir).toString())); // Add Native Path
|
||||
Collections.addAll(context.args, "-javaagent:".concat(pathLauncher));
|
||||
context.args.add("-Djava.library.path=".concat(params.clientDir.resolve(nativesDir).toString())); // Add Native Path
|
||||
context.args.add("-javaagent:".concat(pathLauncher));
|
||||
ClientHookManager.clientLaunchHook.hook(context);
|
||||
LauncherGuardManager.guard.addCustomParams(context);
|
||||
Collections.addAll(context.args, ClientLauncher.class.getName());
|
||||
context.args.add(ClientLauncher.class.getName());
|
||||
ClientHookManager.clientLaunchFinallyHook.hook(context);
|
||||
|
||||
// Print commandline debug message
|
||||
|
|
Loading…
Reference in a new issue