diff --git a/Launcher/runtime/dialog/overlay/settings/settings.js b/Launcher/runtime/dialog/overlay/settings/settings.js index 2f6b234c..1ec553fe 100644 --- a/Launcher/runtime/dialog/overlay/settings/settings.js +++ b/Launcher/runtime/dialog/overlay/settings/settings.js @@ -70,8 +70,9 @@ var settingsOverlay = { // Set new result var newDir = chooser.showDialog(stage); if (newDir !== null) { - settingsOverlay.transferCatalogDialog(); + settingsOverlay.transferCatalogDialog(newDir.toPath()); settings.updatesDir = newDir.toPath(); + DirBridge.dirUpdates = settings.updatesDir; settingsOverlay.updateDirLabel(); } }); @@ -137,11 +138,12 @@ var settingsOverlay = { holder.lookup("#apply").setOnAction(function(event) overlay.hide(0, null)); }, - transferCatalogDialog: function() { + transferCatalogDialog: function(newDir) { settingsOverlay.transferDialog.setVisible(true); settingsOverlay.transferDialog.lookup("#cancelTransfer").setOnAction(function(event) settingsOverlay.transferDialog.setVisible(false)); settingsOverlay.transferDialog.lookup("#applyTransfer").setOnAction(function(event) { //Здесь могла быть ваша реклама, либо DirBridge.move(); + DirBridge.move(newDir); settingsOverlay.transferDialog.setVisible(false); }); }, diff --git a/Launcher/src/main/java/ru/gravit/launcher/DirBridge.java b/Launcher/src/main/java/ru/gravit/launcher/DirBridge.java index c4852bd5..7f2fd10c 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/DirBridge.java +++ b/Launcher/src/main/java/ru/gravit/launcher/DirBridge.java @@ -1,7 +1,9 @@ package ru.gravit.launcher; import ru.gravit.launcher.LauncherAPI; +import ru.gravit.utils.helper.IOHelper; +import java.io.IOException; import java.nio.file.Path; public class DirBridge { @@ -11,5 +13,10 @@ public class DirBridge { public static Path dirUpdates; @LauncherAPI public static Path defaultUpdatesDir; - + @LauncherAPI + public static void move(Path newDir) throws IOException + { + IOHelper.move(dirUpdates,newDir); + dirUpdates = newDir; + } } diff --git a/Launcher/src/main/java/ru/gravit/launcher/LauncherSettings.java b/Launcher/src/main/java/ru/gravit/launcher/LauncherSettings.java index 228703ad..bdb463a1 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/LauncherSettings.java +++ b/Launcher/src/main/java/ru/gravit/launcher/LauncherSettings.java @@ -97,6 +97,7 @@ public void read(HInput input) throws IOException, SignatureException { // Client settings updatesDir = IOHelper.toPath(input.readString(0)); + DirBridge.dirUpdates = updatesDir; autoEnter = input.readBoolean(); fullScreen = input.readBoolean(); setRAM(input.readLength(JVMHelper.RAM)); diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index 4ef625b0..0ec1d416 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -364,9 +364,13 @@ else if (isDownloadJava) { Collections.addAll(args, profile.object.getJvmArgs()); Collections.addAll(args, "-Djava.library.path=".concat(params.clientDir.resolve(NATIVES_DIR).toString())); // Add Native Path Collections.addAll(args, "-javaagent:".concat(pathLauncher)); - Collections.addAll(args, "-classpath", pathLauncher); if(wrapper) Collections.addAll(args, "-Djava.class.path=".concat(pathLauncher)); // Add Class Path + else + { + Collections.addAll(args, "-cp"); + Collections.addAll(args, pathLauncher); + } Collections.addAll(args, ClientLauncher.class.getName()); // Print commandline debug message diff --git a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java b/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java index 7a46bc2f..ecee73f7 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java @@ -32,14 +32,6 @@ public final class Launcher { // Used to determine from clientside is launched from launcher public static final AtomicBoolean LAUNCHED = new AtomicBoolean(false); - static int readBuildNumber() { - try { - return Integer.valueOf(IOHelper.request(IOHelper.getResourceURL("buildnumber"))); - } catch (IOException ignored) { - return 0; // Maybe dev env? - } - } - private static final AtomicReference CONFIG = new AtomicReference<>(); @LauncherAPI public static ModulesManagerInterface modulesManager = null; @@ -67,7 +59,7 @@ static int readBuildNumber() { public static int MAJOR = 4; public static int MINOR = 0; public static int PATCH = 8; - public static int BUILD = readBuildNumber(); + public static int BUILD = 0; public static Version.Type RELEASE = Version.Type.STABLE; @LauncherAPI