From 35c5b24bb6b6bc2b3267f507c7e8fa2f9e6ea8f1 Mon Sep 17 00:00:00 2001 From: Kamesuta Date: Sun, 1 Oct 2023 19:20:08 +0900 Subject: [PATCH 1/3] Execute Forge Installer locally --- app/assets/js/processbuilder.js | 7 +++++++ app/assets/js/scripts/landing.js | 27 +++++++++++++++++++++++++++ libraries/java/ForgeInstallerCLI.jar | Bin 0 -> 7880 bytes 3 files changed, 34 insertions(+) create mode 100644 libraries/java/ForgeInstallerCLI.jar diff --git a/app/assets/js/processbuilder.js b/app/assets/js/processbuilder.js index b86698c4..5b30dfe8 100644 --- a/app/assets/js/processbuilder.js +++ b/app/assets/js/processbuilder.js @@ -836,6 +836,13 @@ class ProcessBuilder { libs = {...libs, ...res} } } + } else if(type === Type.Forge){ + // Forge installer generated libraries + const forgeLibs = [] + for (const library of this.forgeData.libraries) { + forgeLibs.push(path.join(ConfigManager.getCommonDirectory(), 'libraries', library.downloads.artifact.path)) + } + libs = {...libs, ...forgeLibs} } } diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index 94d311a0..d2c2c89a 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -5,6 +5,7 @@ const cp = require('child_process') const crypto = require('crypto') const { URL } = require('url') +const { join } = require('path') const { MojangRestAPI, getServerStatus @@ -552,6 +553,32 @@ async function dlAsync(login = true) { serv.rawServer.id ) + // Install Forge + let wrapperPath + if(isDev) { + wrapperPath = join(process.cwd(), 'libraries', 'java', 'ForgeInstallerCLI.jar') + } else { + if(process.platform === 'darwin'){ + wrapperPath = join(process.cwd(), 'Contents', 'Resources', 'libraries', 'java', 'ForgeInstallerCLI.jar') + } else { + wrapperPath = join(process.cwd(), 'resources', 'libraries', 'java', 'ForgeInstallerCLI.jar') + } + } + + // Launch Forge Installer + loggerLaunchSuite.info('Installing Forge.') + setLaunchDetails('Installing Forge..') + setLaunchPercentage(0) + const jExe = ConfigManager.getJavaExecutable(ConfigManager.getSelectedServer()) + await distributionIndexProcessor.installForge(jExe, wrapperPath, percent => { + setDownloadPercentage(percent) + }) + setDownloadPercentage(100) + + // Remove download bar. + remote.getCurrentWindow().setProgressBar(-1) + + // After Forge installed, we can get the Forge version data. const forgeData = await distributionIndexProcessor.loadForgeVersionJson(serv) const versionData = await mojangIndexProcessor.getVersionJson() diff --git a/libraries/java/ForgeInstallerCLI.jar b/libraries/java/ForgeInstallerCLI.jar new file mode 100644 index 0000000000000000000000000000000000000000..759ca92747e8d33593c410fd6ff0a4eda36b09a7 GIT binary patch literal 7880 zcmb7J1yq~qwgrky@nVHSaS873#e%yP3xwhhg#rx}mqMXXtT+@xuof@w4#isBid(Qy z?9n%OX72Rfcjvw@D}PqjI(wf#Cpq7@bGD}HJydKYBuq>sBy|}Bq`QUk^K!Sa?w&ve zT^WF~x+2#-B+b7Bs!@3kt=t7PBO@V^{Bs~sMqOD^K}VMpsQ5~AKn0bDpa}zxU#}`_ z`@+(BAeeVEVsqtl-x+jFJS^Yi@L(tkry*~qsIal5q2x(~bGs~@!o!V~a*TE8D}il1 zGClIAoH=1QxYMg&?4cFiA&p0nkZTPrN%o$RNTJgy%K;sKK2YZKCzvjZz@GiSboBz@ zq~(zTwVei^v5<)WOt(|N;#?pW&B3jAZNwNVX1imjO1V0ys9<04M}LM{+Ho}Td{p&< z94j1ovkNm`tm0ss6wdWF9vHindu4N*@^mjJR#QUcB7!D||2B!8Gw(KFFg8!})lx6! zu<+$S)#MuZ*W#hx)x_Gx=`VHrH3sh=F%FhaAP+B3%l{bs=+|Id7k4|5y|ag>rK2Or z-P+OqU*Lk+GDsi{B%}obBqYwihb#Zi#cAzm>EV%S5c!mr%>{4-$lOf8Q z7>j_n#^a@v74d9a+mf*%Yd*j%ANhfPWB-2CjJ-qAlkt;g{PX57AvEeHw1sj0MZinu z_35*reHA4`bgSFL;ZxYff{=@%%k_CT6;j;NBCoflN;`(lgyk~~ezhkF$qD!3trS02 zYYi&oMDGWX;AoL+t>tm&RWOj)h+{O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t)Jy8YfG|@% z`*m+}n-8#pRfz%+SfR%&W={p?xhqeiJb-VVcd^h4Rl_IE(NXNVYE6SByP4AasD?gC zc7H=>!spaiVOX?#oj;v;mJC){W1RxBcoD^mc9xAqUBBOD%P5o9w5NjmT_3m05BsKwh^f;p zXzZ_;y;nfJZ#jL1_xd`leuUv&&!FD{Z)PX&azTO%6J>7zocadK{QAie z2#Op1w40PIF!`i?rdlP-!QKxJU2b^vEc1lQd=`PHsfvt3a_|54(0=aeNJs=odon*? z|8UfPh5hQN{S5xO@?ZWO1^og0Cx7jq8GiMae)>S0Vh$_^U$roiqPs z=YPrgZ}r0era}6x5q|z2f8B+DPlJTiL;m00xc Date: Sat, 14 Oct 2023 13:29:15 +0900 Subject: [PATCH 2/3] Fix ForgeInstallerCLI path for cross-platform. --- app/assets/js/scripts/landing.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index d2c2c89a..bf3690ad 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -558,10 +558,11 @@ async function dlAsync(login = true) { if(isDev) { wrapperPath = join(process.cwd(), 'libraries', 'java', 'ForgeInstallerCLI.jar') } else { + const exePath = remote.app.getPath('exe') if(process.platform === 'darwin'){ - wrapperPath = join(process.cwd(), 'Contents', 'Resources', 'libraries', 'java', 'ForgeInstallerCLI.jar') + wrapperPath = join(exePath, '..', '..', 'Contents', 'Resources', 'libraries', 'java', 'ForgeInstallerCLI.jar') } else { - wrapperPath = join(process.cwd(), 'resources', 'libraries', 'java', 'ForgeInstallerCLI.jar') + wrapperPath = join(exePath, '..', 'resources', 'libraries', 'java', 'ForgeInstallerCLI.jar') } } From 6f9a5c65ccaa74b6403a75d44f737b69ce527011 Mon Sep 17 00:00:00 2001 From: Kamesuta Date: Mon, 23 Oct 2023 03:22:22 +0900 Subject: [PATCH 3/3] Fix ForgeInstallerCLI path for mac. --- app/assets/js/scripts/landing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index bf3690ad..55bd417a 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -560,7 +560,7 @@ async function dlAsync(login = true) { } else { const exePath = remote.app.getPath('exe') if(process.platform === 'darwin'){ - wrapperPath = join(exePath, '..', '..', 'Contents', 'Resources', 'libraries', 'java', 'ForgeInstallerCLI.jar') + wrapperPath = join(exePath, '..', '..', 'Resources', 'libraries', 'java', 'ForgeInstallerCLI.jar') } else { wrapperPath = join(exePath, '..', 'resources', 'libraries', 'java', 'ForgeInstallerCLI.jar') }