mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-13 20:28:21 +10:00
Add launcher type detection
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,3 +21,4 @@ __pycache__/
|
||||
/docs/yarn-error.log
|
||||
/docs/node_modules/
|
||||
/payloads/List.txt
|
||||
/payloads/Installer.sh
|
||||
|
||||
@@ -26,6 +26,13 @@ class OpenCoreLegacyPatcher:
|
||||
self.constants.computer = device_probe.Computer.probe()
|
||||
self.constants.recovery_status = utilities.check_recovery()
|
||||
self.computer = self.constants.computer
|
||||
launcher_script = None
|
||||
launcher_binary = sys.executable
|
||||
if "python" in launcher_binary:
|
||||
# We're running from source
|
||||
launcher_script = __file__
|
||||
self.constants.launcher_binary = launcher_binary
|
||||
self.constants.launcher_script = launcher_script
|
||||
defaults.generate_defaults.probe(self.computer.real_model, True, self.constants)
|
||||
if utilities.check_cli_args() is not None:
|
||||
print("- Detected arguments, switching to CLI mode")
|
||||
|
||||
@@ -96,6 +96,8 @@ class Constants:
|
||||
self.patch_disk = "" # Set Root Volume to patch
|
||||
self.validate = False # Enable validation testing for CI
|
||||
self.recovery_status = False # Detect if booted into RecoveryOS
|
||||
self.launcher_binary = None # Determine launch binary (ie. Python vs PyInstaller)
|
||||
self.launcher_script = None # Determine launch file (if run via Python)
|
||||
|
||||
## Hardware
|
||||
self.computer: device_probe.Computer = None # type: ignore
|
||||
|
||||
Reference in New Issue
Block a user