diff --git a/offline-minecraft-launcher.py b/offline-minecraft-launcher.py index 1e63732..4874ce7 100644 --- a/offline-minecraft-launcher.py +++ b/offline-minecraft-launcher.py @@ -318,7 +318,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") print("\nSetting up launcher variables...") launcherVariables = {} @@ -379,13 +381,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)