sync
This commit is contained in:
parent
1106ced049
commit
cd627b03ae
2
main.js
2
main.js
@ -448,7 +448,7 @@ async function launchGame(restartGame) {
|
||||
type: "release"
|
||||
},
|
||||
forge: path.join(app.getPath("appData"), ".catboat", "forge-1.16.5.jar"),
|
||||
javaPath: "C:\\Program Files\\Java\\jdk-17\\bin\\java.exe",
|
||||
javaPath: await java.getPath(path.join(app.getPath("appData"), ".catboat", "jre")),
|
||||
memory: {
|
||||
min: 512,
|
||||
max: launcherSettings.get("ram").max
|
||||
|
||||
@ -74,6 +74,21 @@ async function main(customExtractPath) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getPath(customExtractPath) {
|
||||
const requiredVersion = "17"
|
||||
const isJavaInstalled = checkJavaVersion(requiredVersion)
|
||||
|
||||
if (!isJavaInstalled) {
|
||||
if (!fs.existsSync(path.join(customExtractPath, "jdk-17.0.12", "bin", os.platform() == "win32" ? "java.exe" : "java"))) {
|
||||
await main(customExtractPath)
|
||||
} else {
|
||||
return path.join(customExtractPath, "jdk-17.0.12", "bin", os.platform() == "win32" ? "java.exe" : "java")
|
||||
}
|
||||
} else {
|
||||
console.log("No further action is required.")
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
main
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user