diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java index 94abd9e2..4136aeb8 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncherProcess.java @@ -31,6 +31,8 @@ import java.util.stream.Collectors; public class ClientLauncherProcess { + + public final List pre = new LinkedList<>(); public final ClientParams params = new ClientParams(); public final List jvmArgs = new LinkedList<>(); public final List jvmModules = new LinkedList<>(); @@ -134,7 +136,7 @@ private void applyClientProfile() { public void start(boolean pipeOutput) throws IOException, InterruptedException { if (isStarted) throw new IllegalStateException("Process already started"); LauncherEngine.modulesManager.invokeEvent(new ClientProcessBuilderPreLaunchEvent(this)); - List processArgs = new LinkedList<>(); + List processArgs = new LinkedList<>(pre); processArgs.add(executeFile.toString()); processArgs.addAll(jvmArgs); if (javaVersion.version >= 9) { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/DirBridge.java b/Launcher/src/main/java/pro/gravit/launcher/client/DirBridge.java index 8cd5b337..b26ccd3f 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/DirBridge.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/DirBridge.java @@ -112,6 +112,22 @@ public static Path getGuardDir() { return dir.resolve("guard"); } + public static Path getGuardDir(JVMHelper.ARCH arch, JVMHelper.OS os) { + Path dir = getGuardDir().resolve(makeSpecialGuardDirName(arch, os)); + try { + IOHelper.createParentDirs(dir); + } catch (Throwable e) { + throw new RuntimeException(e); + } + return dir; + } + + + + public static String makeSpecialGuardDirName(JVMHelper.ARCH arch, JVMHelper.OS os) { + return String.format("%s-%s", arch.name, os.name); + } + public static Path getLegacyLauncherDir(String projectname) { return IOHelper.HOME_DIR.resolve(projectname); }