diff --git a/offline-minecraft-launcher.py b/offline-minecraft-launcher.py index 466fa1a..10f7606 100644 --- a/offline-minecraft-launcher.py +++ b/offline-minecraft-launcher.py @@ -315,7 +315,9 @@ def main(): for library in libraries: if library["type"] == "native": if "rules" in library and checkRules(library["rules"]) == "disallow": continue - subprocess.run(["7z","x",library["filePathOS"],"-o" +nativesOutPath,"-aos"],check=True,stdout=subprocess.DEVNULL) + proc = subprocess.Popen(["7z","x",library["filePathOS"],"-o" +nativesOutPath,"-aos"],stdout=subprocess.DEVNULL) + rtn = proc.wait() + if rtn != 0: raise Exception("process","return code isn't 0") launcherVariables = {} launcherVariables["auth_player_name"] = lv["name"] @@ -371,13 +373,14 @@ def main(): print("\nLaunching Minecraft...") if lv["console"] == "1": - subprocess.run([lv["java"]] + args,check = True) + proc = subprocess.Popen([lv["java"]] + args) + rtn = proc.wait() + if rtn != 0: raise Exception("process","return code isn't 0") else: pkwargs = { "stdout": subprocess.DEVNULL, "stdin": subprocess.DEVNULL, "stderr": subprocess.DEVNULL, - "close_fds": True } if lv["osName"] == "windows": pkwargs["creationflags"] = 0x00000008 subprocess.Popen([lv["java"] + "w"] + args,**pkwargs)