mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-22 19:52:14 -08:00
Compare commits
2 Commits
28a30d2767
...
fc1b8ba63b
Author | SHA1 | Date | |
---|---|---|---|
|
fc1b8ba63b | ||
|
35c5b24bb6 |
@ -836,6 +836,13 @@ class ProcessBuilder {
|
|||||||
libs = {...libs, ...res}
|
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}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
const cp = require('child_process')
|
const cp = require('child_process')
|
||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
const { URL } = require('url')
|
const { URL } = require('url')
|
||||||
|
const { join } = require('path')
|
||||||
const {
|
const {
|
||||||
MojangRestAPI,
|
MojangRestAPI,
|
||||||
getServerStatus
|
getServerStatus
|
||||||
@ -550,6 +551,32 @@ async function dlAsync(login = true) {
|
|||||||
serv.rawServer.id
|
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 forgeData = await distributionIndexProcessor.loadForgeVersionJson(serv)
|
||||||
const versionData = await mojangIndexProcessor.getVersionJson()
|
const versionData = await mojangIndexProcessor.getVersionJson()
|
||||||
|
|
||||||
|
BIN
libraries/java/ForgeInstallerCLI.jar
Normal file
BIN
libraries/java/ForgeInstallerCLI.jar
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user