Fix the incorrect path in some cases

This commit is contained in:
Hoang Hong Quan
2024-07-27 18:25:25 +07:00
parent 4b480b7751
commit d9e0ed9b34
6 changed files with 10 additions and 12 deletions

View File

@@ -27,7 +27,7 @@ class OCPE:
"18": "macOS Mojave 10.14",
"17": "macOS High Sierra 10.13"
}
self.result_dir = os.path.join(os.getcwd(), "Results")
self.result_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Results")
def check_for_update(self):
self.u.head("Check for update")

View File

@@ -2776,7 +2776,7 @@ DefinitionBlock ("", "SSDT", 2, "ZPSS", "Surface", 0x00001000)
return
def select_dsdt(self):
results_path = os.path.join(os.getcwd(), "Results")
results_path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "Results")
apcidump_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "acpidump.exe")
while True:
self.utils.head("Select ACPI Tables")

View File

@@ -13,9 +13,7 @@ class builder:
self.config = config_prodigy.ConfigProdigy()
self.kext = kext_maestro.KextMaestro()
self.utils = utils.Utils()
self.ock_files_dir = os.path.join(os.getcwd(), "OCK_Files")
self.oc_binary_data_dir = os.path.join(os.getcwd(), "OcBinaryData")
self.result_dir = os.path.join(os.getcwd(), "Results")
self.oc_binary_data_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "OcBinaryData")
self.intel_igpu_properties = {
"Ice Lake": {
"Laptop": {
@@ -374,14 +372,14 @@ class builder:
self.utils.request_input()
def build_efi(self, hardware, macos_version):
efi_directory = os.path.join(os.getcwd(), "Results")
efi_directory = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "Results")
self.utils.mkdirs(efi_directory)
if not os.path.exists(self.ock_files_dir):
raise Exception(f"Directory '{self.ock_files_dir}' does not exist.")
if not os.path.exists(self.kext.ock_files_dir):
raise Exception(f"Directory '{self.kext.ock_files_dir}' does not exist.")
source_efi_dir = os.path.join(self.ock_files_dir, "OpenCore")
source_efi_dir = os.path.join(self.kext.ock_files_dir, "OpenCore")
shutil.copytree(source_efi_dir, efi_directory, dirs_exist_ok=True)
shutil.copytree(self.oc_binary_data_dir, os.path.join(efi_directory, "EFI", "OC"), dirs_exist_ok=True)

View File

@@ -15,7 +15,7 @@ class gatheringFiles:
self.dortania_builds_url = "https://raw.githubusercontent.com/dortania/build-repo/builds/latest.json"
self.amd_vanilla_patches_url = f"https://raw.githubusercontent.com/AMD-OSX/AMD_Vanilla/beta/patches.plist"
self.temporary_dir = tempfile.mkdtemp()
self.ock_files_dir = os.path.join(os.getcwd(), "OCK_Files")
self.ock_files_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "OCK_Files")
self.download_history_file = os.path.join(self.ock_files_dir, "history.json")
self.builds = [
"AirportBrcmFixup",

View File

@@ -16,7 +16,7 @@ class KextMaestro:
"idVendor",
"HDAConfigDefault"
]
self.ock_files_dir = os.path.join(os.getcwd(), "OCK_Files")
self.ock_files_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "OCK_Files")
self.kext_loading_sequence = [
{
"MainKext": "Lilu",

View File

@@ -1,3 +1,3 @@
{
"version": "0.0.1"
"version": "0.0.2"
}