diff --git a/.github/workflows/build-app-wxpython.yml b/.github/workflows/build-app-wxpython.yml index 564cdca05..ba9d74b00 100644 --- a/.github/workflows/build-app-wxpython.yml +++ b/.github/workflows/build-app-wxpython.yml @@ -10,16 +10,19 @@ jobs: build: name: Build wxPython runs-on: x86_64_mojave + if: github.repository_owner == 'dortania' env: branch: ${{ github.ref }} commiturl: ${{ github.event.head_commit.url }}${{ github.event.release.html_url }} commitdate: ${{ github.event.head_commit.timestamp }}${{ github.event.release.published_at }} + MAC_NOTARIZATION_USERNAME: ${{ secrets.MAC_NOTARIZATION_USERNAME }} + MAC_NOTARIZATION_PASSWORD: ${{ secrets.MAC_NOTARIZATION_PASSWORD }} steps: - uses: actions/checkout@v3 - run: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 Build-Binary.command --reset_binaries --branch "${{ env.branch }}" --commit "${{ env.commiturl }}" --commit_date "${{ env.commitdate }}" - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' - run: cd dist; ditto -c -k --sequesterRsrc --keepParent OpenCore-Patcher.app ../OpenCore-Patcher-wxPython.app.zip - - run: ./../sign-wxpython.sh + - run: xcrun altool --notarize-app --primary-bundle-id "com.dortania.opencore-legacy-patcher" --username "${{ env.MAC_NOTARIZATION_USERNAME }}" --password "${{ env.MAC_NOTARIZATION_PASSWORD }}" --file OpenCore-Patcher-wxPython.app.zip - run: packagesbuild ./payloads/InstallPackage/AutoPkg-Assets-Setup.pkgproj - run: mv ./OpenCore-Patcher-wxPython.app.zip ./OpenCore-Patcher-GUI.app.zip - name: Upload App to Artifacts diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index e0202ed58..b6a9dca72 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -19,12 +19,6 @@ jobs: - run: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 Build-Binary.command --build_tui --reset_binaries --branch "${{ env.branch }}" --commit "${{ env.commiturl }}" --commit_date "${{ env.commitdate }}" - run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' - run: cd dist; zip -r ../OpenCore-Patcher-TUI.app.zip OpenCore-Patcher.app - - run: ./../sign-tui.sh - - name: Upload App to Artifacts - uses: actions/upload-artifact@v3 - with: - name: OpenCore-Patcher-TUI.app - path: OpenCore-Patcher-TUI.app.zip - name: Validate OpenCore run: ./dist/OpenCore-Patcher.app/Contents/MacOS/OpenCore-Patcher --validate diff --git a/SOURCE.md b/SOURCE.md index 68ff35f36..88adc6b88 100644 --- a/SOURCE.md +++ b/SOURCE.md @@ -1,11 +1,10 @@ # Build and run from source -OpenCore Legacy Patcher at its core is a python-based TUI/CLI based application. This means that to run the project from source, you simply need to invoke the OpenCore-Patcher.command file via Python. +OpenCore Legacy Patcher at its core is a python-based GUI/CLI based application. This means that to run the project from source, you simply need to invoke the OpenCore-Patcher-GUI.command file via Python. For developers wishing to validate mainline changes, you may use these nightly links: * [GUI (Graphical Based App)](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app-wxpython/main/OpenCore-Patcher.app%20%28GUI%29.zip) -* [TUI (Text Based App)](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app/main/OpenCore-Patcher-TUI.app.zip) **Warning**: These binaries should not be used without first consulting the [CHANGELOG](./CHANGELOG.md). Do not distribute these links in forums, instead direct to this file. @@ -32,34 +31,24 @@ pip3 install -r requirements.txt If you have installation error, see following troubleshooting options: -* Use Python 3.9 - * Currently our build server uses py3.9 for generating binaries used in releases +* Use Python 3.10 + * Currently our build server uses py3.10 for generating binaries used in releases * Use .whl snapshots for installing additional dependencies - * [wxPython 4.1.1 wheel for py3.9](https://files.pythonhosted.org/packages/2c/a8/7027e8ca3ba20dc2ed2acd556e31941cb44097ab87d6f81d646a79de4eab/wxPython-4.1.1-cp39-cp39-macosx_10_10_x86_64.whl) - * [PyObjc 8.5 wheel for py3](https://files.pythonhosted.org/packages/69/3d/786f379dd669a078cf0c4a686e242c9b643071c23367bfbd3d9a7eb589ec/pyobjc-8.5-py3-none-any.whl) - * [Requests 2.27.1 for py2/py3](https://files.pythonhosted.org/packages/2d/61/08076519c80041bc0ffa1a8af0cbd3bf3e2b62af10435d269a9d0f40564d/requests-2.27.1-py2.py3-none-any.whl) - * [pyinstaller 5.3 for py3](https://files.pythonhosted.org/packages/65/70/625e86e5a45cb975a9c32a10a721394d10771275c69207308b80bc6a758e/pyinstaller-5.3-py3-none-macosx_10_13_universal2.whl) - ## Running OpenCore Legacy Patcher To run the project from source, simply invoke via python3: -```sh -# Launch TUI -python3 OpenCore-Patcher.command -``` - ```sh # Launch GUI python3 OpenCore-Patcher-GUI.command ``` -Note that the OpenCore-Patcher.command file can be run as both a TUI and a CLI utility for other programs to call. If no core arguments are passed, the TUI is initialized. Otherwise the CLI will start: +Note that the OpenCore-Patcher-GUI.command file can be run as both a GUI and a CLI utility for other programs to call. If no core arguments are passed, the GUI is initialized. Otherwise the CLI will start: ```sh # Launch CLI -python3 OpenCore-Patcher.command --build --model iMac12,2 --verbose +python3 OpenCore-Patcher-GUI.command --build --model iMac12,2 --verbose ``` See `-h`/`--help` for more information on supported CLI arguments. @@ -79,7 +68,7 @@ pip3 install pyinstaller cd ~/Developer/OpenCore-Legacy-Patcher/ # Create the pyinstaller based Application # Optional Arguments -# '--build_tui': Create TUI vairant +# '--build_tui': Create TUI vairant (deprecated) # '--reset_binaries': Redownload and generate support files python3 Build-Binary.command # Open build folder diff --git a/resources/gui/gui_main.py b/resources/gui/gui_main.py index 521727347..f0b668ece 100644 --- a/resources/gui/gui_main.py +++ b/resources/gui/gui_main.py @@ -18,8 +18,22 @@ import hashlib from datetime import datetime import py_sip_xnu import logging +import tempfile -from resources import constants, defaults, install, installer, utilities, run, generate_smbios, updates, integrity_verification, global_settings, kdk_handler, network_handler +from resources import ( + constants, + defaults, + install, + installer, + utilities, + run, + generate_smbios, + updates, + integrity_verification, + global_settings, + kdk_handler, + network_handler +) from resources.sys_patch import sys_patch_detect, sys_patch from resources.build import build from data import model_array, os_data, smbios_data, sip_data, cpu_data @@ -2327,16 +2341,22 @@ class wx_python_gui: def install_installer_pkg(self, disk): disk = disk + "s2" # ESP sits at 1, and we know macOS will have created the main partition at 2 - if Path(self.constants.installer_pkg_path).exists(): - path = utilities.grab_mount_point_from_disk(disk) - if Path(path + "/System/Library/CoreServices/SystemVersion.plist").exists(): - os_version = plistlib.load(Path(path + "/System/Library/CoreServices/SystemVersion.plist").open("rb")) - kernel_version = os_data.os_conversion.os_to_kernel(os_version["ProductVersion"]) - if int(kernel_version) >= os_data.os_data.big_sur: - subprocess.run(["mkdir", "-p", f"{path}/Library/Packages/"]) - subprocess.run(["cp", "-r", self.constants.installer_pkg_path, f"{path}/Library/Packages/"]) - else: - logging.info("- Installer unsupported, requires Big Sur or newer") + + if not Path(self.constants.installer_pkg_path).exists(): + return + + path = utilities.grab_mount_point_from_disk(disk) + if not Path(path + "/System/Library/CoreServices/SystemVersion.plist").exists(): + return + + os_version = plistlib.load(Path(path + "/System/Library/CoreServices/SystemVersion.plist").open("rb")) + kernel_version = os_data.os_conversion.os_to_kernel(os_version["ProductVersion"]) + if int(kernel_version) < os_data.os_data.big_sur: + logging.info("- Installer unsupported, requires Big Sur or newer") + return + + subprocess.run(["mkdir", "-p", f"{path}/Library/Packages/"]) + subprocess.run(["cp", "-r", self.constants.installer_pkg_path, f"{path}/Library/Packages/"]) def settings_menu(self, event=None):