From 01fa2c349f09f3534267764c61f08650e29d3b62 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Wed, 4 May 2022 21:49:27 -0600 Subject: [PATCH] main.py: Update cwd path --- resources/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/main.py b/resources/main.py index 09cb0c99c..0e717151c 100644 --- a/resources/main.py +++ b/resources/main.py @@ -44,10 +44,11 @@ class OpenCoreLegacyPatcher: if utilities.check_cli_args() is not None: print("- Detected arguments, switching to CLI mode") self.constants.gui_mode = True # Assumes no user interaction is required - self.constants.current_path = Path.cwd() - if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS") and "--auto_patch" not in sys.argv: - print("- Rerouting payloads location") - self.constants.payload_path = sys._MEIPASS / Path("payloads") + if "--auto_patch" not in sys.argv: + self.constants.current_path = Path.cwd() + if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): + print("- Rerouting payloads location") + self.constants.payload_path = sys._MEIPASS / Path("payloads") arguments.arguments().parse_arguments(self.constants) else: print(f"- No arguments present, loading {'GUI' if self.constants.wxpython_variant is True else 'TUI'} mode")