diff --git a/Launcher/runtime/config.js b/Launcher/runtime/config.js index 74dbc6ed..df8b90d9 100644 --- a/Launcher/runtime/config.js +++ b/Launcher/runtime/config.js @@ -25,15 +25,4 @@ var config = { }, settingsMagic: 0xC0DE5, // Магия вне хогвартса -}; - -DirBridge.dir = DirBridge.getLauncherDir(config.dir); -DirBridge.dirStore = DirBridge.getStoreDir(config.dir); -DirBridge.dirProjectStore = DirBridge.getProjectStoreDir(config.dir); -if (!IOHelper.isDir(DirBridge.dir)) { - java.nio.file.Files.createDirectory(DirBridge.dir); -} -DirBridge.defaultUpdatesDir = DirBridge.dir.resolve("updates"); -if (!IOHelper.isDir(DirBridge.defaultUpdatesDir)) { - java.nio.file.Files.createDirectory(DirBridge.defaultUpdatesDir); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/Launcher/runtime/engine/api.js b/Launcher/runtime/engine/api.js index 3374a51d..4f6e4d20 100644 --- a/Launcher/runtime/engine/api.js +++ b/Launcher/runtime/engine/api.js @@ -89,4 +89,15 @@ function startTask(task) { function openURL(url) { app.getHostServices().showDocument(url.toURI()); +} + +DirBridge.dir = DirBridge.getLauncherDir(config.dir); +DirBridge.dirStore = DirBridge.getStoreDir(config.dir); +DirBridge.dirProjectStore = DirBridge.getProjectStoreDir(config.dir); +if (!IOHelper.isDir(DirBridge.dir)) { + java.nio.file.Files.createDirectory(DirBridge.dir); +} +DirBridge.defaultUpdatesDir = DirBridge.dir.resolve("updates"); +if (!IOHelper.isDir(DirBridge.defaultUpdatesDir)) { + java.nio.file.Files.createDirectory(DirBridge.defaultUpdatesDir); } \ No newline at end of file diff --git a/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java b/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java index 17738305..93638602 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java @@ -171,8 +171,8 @@ public void run(String[] args) throws ScriptException, NoSuchMethodException, IO @Override public void preLoad() throws IOException, ScriptException { if (!isPreLoaded) { - loadScript(Launcher.API_SCRIPT_FILE); loadScript(Launcher.CONFIG_SCRIPT_FILE); + loadScript(Launcher.API_SCRIPT_FILE); isPreLoaded = true; } }