passage en 1.18.2 launcher

This commit is contained in:
luki39 2022-05-18 19:30:41 +02:00
parent 25eb740ceb
commit a3602eb2fb
7 changed files with 53 additions and 18 deletions

View File

@ -468,15 +468,15 @@ class JavaGuard extends EventEmitter {
break
}
}
} else {
} else if(verOb.major >= 16) {
// TODO Make this logic better. Make java 16 required.
// Java 9+
if(Util.mcVersionAtLeast('1.13', this.mcVersion)){
//console.log('Java 9+ not yet tested.')
/* meta.version = verOb
if(Util.mcVersionAtLeast('1.17', this.mcVersion)){
meta.version = verOb
++checksum
if(checksum === goal){
break
} */
}
}
}
// Space included so we get only the vendor.

View File

@ -96,6 +96,16 @@ class ProcessBuilder {
return child
}
/**
* Get the platform specific classpath separator. On windows, this is a semicolon.
* On Unix, this is a colon.
*
* @returns {string} The classpath separator for the current operating system.
*/
static getClasspathSeparator() {
return process.platform === 'win32' ? ';' : ':'
}
/**
* Determine if an optional mod is enabled from its configuration value. If the
* configuration value is null, the required object will be used to
@ -339,7 +349,7 @@ class ProcessBuilder {
// Classpath Argument
args.push('-cp')
args.push(this.classpathArg(mods, tempNativePath).join(process.platform === 'win32' ? ';' : ':'))
args.push(this.classpathArg(mods, tempNativePath).join(ProcessBuilder.getClasspathSeparator()))
// Java Arguments
if(process.platform === 'darwin'){
@ -377,6 +387,19 @@ class ProcessBuilder {
// JVM Arguments First
let args = this.versionData.arguments.jvm
// Debug securejarhandler
// args.push('-Dbsl.debug=true')
if(this.forgeData.arguments.jvm != null) {
for(const argStr of this.forgeData.arguments.jvm) {
args.push(argStr
.replaceAll('${library_directory}', this.libPath)
.replaceAll('${classpath_separator}', ProcessBuilder.getClasspathSeparator())
.replaceAll('${version_name}', this.forgeData.id)
)
}
}
//args.push('-Dlog4j.configurationFile=D:\\WesterosCraft\\game\\common\\assets\\log_configs\\client-1.12.xml')
// Java Arguments
@ -489,7 +512,7 @@ class ProcessBuilder {
val = args[i].replace(argDiscovery, this.launcherVersion)
break
case 'classpath':
val = this.classpathArg(mods, tempNativePath).join(process.platform === 'win32' ? ';' : ':')
val = this.classpathArg(mods, tempNativePath).join(ProcessBuilder.getClasspathSeparator())
break
}
if(val != null){
@ -647,9 +670,12 @@ class ProcessBuilder {
classpathArg(mods, tempNativePath){
let cpArgs = []
// Add the version.jar to the classpath.
const version = this.versionData.id
cpArgs.push(path.join(this.commonDir, 'versions', version, version + '.jar'))
if(!Util.mcVersionAtLeast('1.17', this.server.getMinecraftVersion())) {
// Add the version.jar to the classpath.
// Must not be added to the classpath for Forge 1.17+.
const version = this.versionData.id
cpArgs.push(path.join(this.commonDir, 'versions', version, version + '.jar'))
}
if(this.usingLiteLoader){
cpArgs.push(this.llPath)
@ -788,6 +814,15 @@ class ProcessBuilder {
let libs = []
for(let sm of mdl.getSubModules()){
if(sm.getType() === DistroManager.Types.Library){
// TODO Add as file or something.
const x = sm.getIdentifier()
console.log(x)
if(x.includes(':universal') || x.includes(':slim') || x.includes(':extra') || x.includes(':srg') || x.includes(':client')) {
console.log('SKIPPING ' + x)
continue
}
libs.push(sm.getArtifact().getPath())
}
// If this module has submodules, we need to resolve the libraries for those.

View File

@ -265,7 +265,7 @@ function asyncSystemScan(mcVersion, launchAfter = true){
// Show this information to the user.
setOverlayContent(
`Aucune installation<br>Java compatible n'a été trouvée`,
`Vous avez besoin d'une installation 64 bits de Java 8. Souhaitez-vous que nous en installions une copie ?`,
`Vous avez besoin d'une installation 64 bits de Java 17. Souhaitez-vous que nous en installions une copie ?`,
'Installer Java',
'Installer manuellement'
)
@ -280,7 +280,7 @@ function asyncSystemScan(mcVersion, launchAfter = true){
//$('#overlayDismiss').toggle(false)
setOverlayContent(
'Java est requis<br>pour lancer',
`Une installation x64 valide de Java 8 est requise pour le lancement.<br><br>Veuillez vous référer à notre <a href="https://github.com/luki-39/LukiEnLiveLauncher/wiki/Java-Management#manually-installing-a -valid-version-of-java">Guide de gestion Java</a> pour obtenir des instructions sur l'installation manuelle de Java.`,
`Une installation x64 valide de Java 17 est requise pour le lancement.<br><br>Veuillez vous référer à notre <a href="https://github.com/luki-39/LukiEnLiveLauncher/wiki/Java-Management#manually-installing-a -valid-version-of-java">Guide de gestion Java</a> pour obtenir des instructions sur l'installation manuelle de Java.`,
'Je comprends',
'Retour'
)

View File

@ -215,7 +215,7 @@
<div class="settingsFileSelContainer">
<div class="settingsFileSelTitle">Exécutable Java</div>
<div class="settingsFileSelContent">
<div id="settingsJavaExecDetails">Sélectionné : Java 8 mise à jour 172 (x64)</div>
<div id="settingsJavaExecDetails">Sélectionné : Java 17 (x64)</div>
<div class="settingsFileSelActions">
<div class="settingsFileSelIcon">
<svg class="settingsFileSelSVG" x="0px" y="0px" viewBox="0 0 305.001 305.001">
@ -235,7 +235,7 @@
<button class="settingsFileSelButton" id="settingsJavaExecSel" dialogTitle="Select Java Executable" dialogDirectory="false">Choose File</button>
</div>
</div>
<div class="settingsFileSelDesc">L'exécutable Java est validé avant le lancement du jeu. <strong>Nécessite Java 8 x64.</strong><br>Le chemin doit se terminer par <strong>bin<%= process.platform === 'win32' ? '\\javaw.exe' : '/java' %></strong>.</div>
<div class="settingsFileSelDesc">L'exécutable Java est validé avant le lancement du jeu. <strong>Nécessite Java 17 x64.</strong><br>Le chemin doit se terminer par <strong>bin<%= process.platform === 'win32' ? '\\javaw.exe' : '/java' %></strong>.</div>
</div>
<div id="settingsJVMOptsContainer">
<div id="settingsJVMOptsTitle">Options JVM supplémentaires</div>
@ -256,7 +256,7 @@
</div>
<input id="settingsJVMOptsVal" cValue="JVMOptions" type="text">
</div>
<div id="settingsJVMOptsDesc">Options à fournir à la JVM lors de l'exécution. <em>-Xms</em> et <em>-Xmx</em> ne devrait pas être inclus.<br><a href="https://docs.oracle.com/javase/8/docs/technotes/tools/<%= process.platform === 'win32' ? 'windows' : 'unix' %>/java.html">Options disponibles pour Java 8</a>.</div>
<div id="settingsJVMOptsDesc">Options à fournir à la JVM lors de l'exécution. <em>-Xms</em> et <em>-Xmx</em> ne devrait pas être inclus.<br><a href="https://docs.oracle.com/javase/17/docs/technotes/tools/<%= process.platform === 'win32' ? 'windows' : 'unix' %>/java.html">Options disponibles pour Java 17</a>.</div>
</div>
</div>
<div id="settingsTabLauncher" class="settingsTab" style="display: none;">

View File

@ -23,7 +23,7 @@ function initAutoUpdater(event, data) {
}
if(isDev){
autoUpdater.autoInstallOnAppQuit = false
autoUpdater.autoInstallOnAppQuit = true
autoUpdater.updateConfigPath = path.join(__dirname, 'dev-app-update.yml')
}
if(process.platform === 'darwin'){

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "lukienlivelauncher",
"version": "2.0.5",
"version": "2.0.6",
"lockfileVersion": 2,
"requires": true,
"packages": {

View File

@ -1,6 +1,6 @@
{
"name": "lukienlivelauncher",
"version": "2.0.5",
"version": "2.0.6",
"productName": "LukiEnLive Launcher",
"description": "Launcher du serveur Moddé du Streameur LukiEnLive",
"author": "Daniel Scalzi (https://github.com/dscalzi/) SoraxDubbing / Luki",