From babf543f750412263f4ebf0aea6639bbe05bdec2 Mon Sep 17 00:00:00 2001 From: LinuxMint4Ever <> Date: Mon, 5 Aug 2019 14:58:44 +0200 Subject: [PATCH] CRITICAL FIX: relative path support --- earlyLauncher/earlylauncher.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/earlyLauncher/earlylauncher.py b/earlyLauncher/earlylauncher.py index 34cded3..c6803d6 100644 --- a/earlyLauncher/earlylauncher.py +++ b/earlyLauncher/earlylauncher.py @@ -107,10 +107,16 @@ def getToken(username, password): return access_token, profile_id, username +def deRelative(cwd, path): + if path[0]=='.': + return os.path.join(cwd, path) + else: + return path + def run(java_executable, ram, alignTo, libs, username, gameDir, assets, uuid, accessToken): cwd = os.getcwd() os.chdir(gameDir) - exitCode = os.system(java_executable+" -Xmx"+ram+alignTo+" -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -Djava.library.path="+os.path.join(libs, "natives")+" -cp "+os.path.join(libs,"jar")+os.sep+(":"+os.path.join(libs,"jar")+os.sep).join(os.listdir(os.path.join(libs,"jar")))+" net.minecraft.launchwrapper.Launch --username "+username+" --version 1.7.10-Forge10.13.4.1614-1.7.10 --gameDir "+gameDir+" --assetsDir "+assets+" --assetIndex 1.7.10 --uuid "+str(uuid)+" --accessToken "+accessToken+" --userProperties {} --userType mojang --tweakClass cpw.mods.fml.common.launcher.FMLTweaker") + exitCode = os.system(deRelative(cwd, java_executable)+" -Xmx"+ram+alignTo+" -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -Djava.library.path="+os.path.join(deRelative(cwd, libs), "natives")+" -cp "+os.path.join(deRelative(cwd, libs),"jar")+os.sep+(":"+os.path.join(deRelative(cwd,libs),"jar")+os.sep).join(os.listdir(os.path.join(deRelative(cwd, libs),"jar")))+" net.minecraft.launchwrapper.Launch --username "+username+" --version 1.7.10-Forge10.13.4.1614-1.7.10 --gameDir "+deRelative(cwd,gameDir)+" --assetsDir "+deRelative(cwd, assets)+" --assetIndex 1.7.10 --uuid "+str(uuid)+" --accessToken "+accessToken+" --userProperties {} --userType mojang --tweakClass cpw.mods.fml.common.launcher.FMLTweaker") os.chdir(cwd) return exitCode