From 4cccfc38cdfe47e167cc143d946b831243bab1d7 Mon Sep 17 00:00:00 2001 From: Exeldro Date: Wed, 14 Feb 2024 22:32:09 +0100 Subject: [PATCH] update build --- .github/scripts/utils.zsh/check_packages | 8 ++-- .github/workflows/build.yml | 59 ++++++++---------------- installer.iss.in | 25 ++++------ 3 files changed, 33 insertions(+), 59 deletions(-) diff --git a/.github/scripts/utils.zsh/check_packages b/.github/scripts/utils.zsh/check_packages index 31f2d0f..4d0ce3d 100755 --- a/.github/scripts/utils.zsh/check_packages +++ b/.github/scripts/utils.zsh/check_packages @@ -24,16 +24,16 @@ if (( ! ${+commands[packagesbuild]} )) { pushd mkcd ${project_root:h}/obs-build-dependencies - local packages_url='http://s.sudre.free.fr/Software/files/Packages.dmg' + local packages_url='http://s.sudre.free.fr/Software/files/Packages_1210_1.dmg' local packages_hash='6afdd25386295974dad8f078b8f1e41cabebd08e72d970bf92f707c7e48b16c9' - if [[ ! -f Packages.dmg ]] { + if [[ ! -f Packages_1210_1.dmg ]] { log_status 'Download Packages.app' curl ${curl_opts} ${packages_url} } local image_checksum - read -r image_checksum _ <<< "$(sha256sum Packages.dmg)" + read -r image_checksum _ <<< "$(sha256sum Packages_1210_1.dmg)" if [[ ${packages_hash} != ${image_checksum} ]] { log_error "Checksum mismatch of Packages.app download. @@ -42,7 +42,7 @@ Actual : ${image_checksum}" return 2 } - hdiutil attach -noverify Packages.dmg &> /dev/null && log_status 'Packages.dmg image mounted.' + hdiutil attach -noverify Packages_1210_1.dmg &> /dev/null && log_status 'Packages_1210_1.dmg image mounted.' log_info 'Installing Packages.app...' packages_volume=$(hdiutil info -plist | grep '/Volumes/Packages' | sed 's/.*\(\/Volumes\/[^<]*\)<\/string>/\1/') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e17faf..2cd75c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,13 +28,13 @@ jobs: shell: zsh {0} steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: path: plugin submodules: recursive - name: Checkout obs-studio - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 with: repository: 'obsproject/obs-studio' path: obs-studio @@ -78,7 +78,7 @@ jobs: - name: Restore Compilation Cache id: ccache-cache - uses: actions/cache@v3.0.11 + uses: actions/cache@v4.0.0 with: path: ${{ github.workspace }}/.ccache key: macos-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }} @@ -132,7 +132,7 @@ jobs: codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }} - name: Upload Build Artifact - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }} path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-macos-${{ matrix.arch }}.pkg @@ -145,13 +145,13 @@ jobs: ubuntu: ['ubuntu-20.04', 'ubuntu-22.04'] steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: repository: obsproject/obs-studio ref: ${{ env.OBS_VERSION }} submodules: 'recursive' - name: "Checkout plugin" - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: path: plugins/${{ env.PLUGIN_NAME }} - name: Add plugin to obs cmake @@ -181,7 +181,7 @@ jobs: mv ./plugins/${{ env.PLUGIN_NAME }}/data ./${{ env.PLUGIN_NAME }}/data tar -cvzf "${FILE_NAME}" ${{ env.PLUGIN_NAME }} - name: 'Publish' - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: '${{ env.FILE_NAME }}' path: '*.tar.gz' @@ -206,15 +206,15 @@ jobs: WINDOWS_DEPS_VERSION: '2022-08-02' steps: - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1.3 + uses: microsoft/setup-msbuild@v2 - name: Checkout obs - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: repository: obsproject/obs-studio ref: ${{ env.OBS_VERSION }} submodules: 'recursive' - name: Checkout plugin - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v4.1.1 with: path: plugins/${{ env.PLUGIN_NAME}} - name: Add plugin to obs cmake @@ -251,13 +251,13 @@ jobs: exit 0 - name: Publish zip if: success() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: '${{ env.FILE_NAME }}' path: package/* - name: Publish Installer Files - if: success() - uses: actions/upload-artifact@v3.1.1 + if: success() && matrix.target == 'x64' + uses: actions/upload-artifact@v4.3.1 with: name: 'installer-files' path: installer/* @@ -278,59 +278,40 @@ jobs: $env:FILE_NAME_X64="${{ env.PLUGIN_NAME }}-${{ github.sha }}-windows-x64" echo "FILE_NAME_X64=${env:FILE_NAME_X64}" >> ${env:GITHUB_ENV} - name: Retrieve x86 build - uses: actions/download-artifact@v3.0.1 + uses: actions/download-artifact@v4.1.2 with: name: '${{ env.FILE_NAME_X86 }}' path: ./package - name: Retrieve x64 build - uses: actions/download-artifact@v3.0.1 + uses: actions/download-artifact@v4.1.2 with: name: '${{ env.FILE_NAME_X64 }}' path: ./package - name: Retrieve installer files - uses: actions/download-artifact@v3.0.1 + uses: actions/download-artifact@v4.1.2 with: name: 'installer-files' path: . - - name: Create Code Signing Certificate - if: success() && github.event_name != 'pull_request' - run: | - New-Item -ItemType directory -Path certificate - Set-Content -Path certificate\certificate.txt -Value '${{ secrets.CERTIFICATE }}' - certutil -decode certificate\certificate.txt certificate\certificate.pfx - - name: Code Sign 32 - if: success() && github.event_name != 'pull_request' - run: | - & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x86/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\32bit\${{ env.PLUGIN_NAME }}.dll - - name: Code Sign 64 - if: success() && github.event_name != 'pull_request' - run: | - & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\64bit\${{ env.PLUGIN_NAME }}.dll - name: Publish zip if: success() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: '${{ env.FILE_NAME }}' path: package/* - name: "Package Installer (Prereqs)" run: | - curl "-kL" "https://github.com/Xaymar/msvc-redist-helper/releases/download/0.1/msvc-redist-helper-64.exe" "-f" "--retry" "5" "-o" "msvc-redist-helper.exe" curl "-kL" "https://files.jrsoftware.org/is/6/innosetup-6.0.3.exe" "-f" "--retry" "5" "-o" "inno.exe" .\inno.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART - name: "Package Installer (Compile)" run: | & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /Qp ".\installer.iss" - - name: Code Sign Installer - if: success() && github.event_name != 'pull_request' - run: | - & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\${{ env.PLUGIN_NAME }}-installer.exe - name: Publish installer if: success() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.1 with: name: '${{ env.FILE_NAME }}-installer' path: package/*.exe - name: Remove temp artifacts - uses: geekyeggo/delete-artifact@v2.0.0 + uses: geekyeggo/delete-artifact@v4.1.0 with: - name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}\ninstaller-files" + name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}" diff --git a/installer.iss.in b/installer.iss.in index 37be480..6427a22 100644 --- a/installer.iss.in +++ b/installer.iss.in @@ -40,7 +40,6 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Files] Source: "package/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "msvc-redist-helper.exe"; DestDir: "{app}"; DestName: "msvc-redist-helper.exe"; Flags: ignoreversion dontcopy noencryption ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] @@ -56,7 +55,9 @@ begin Result := ExpandConstant('{pf}\obs-studio'); // query the first registry value; if this succeeds, return the obtained value if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then - Result := InstallPath + Result := InstallPath; + if RegQueryStringValue(HKLM64, 'SOFTWARE\OBS Studio', '', InstallPath) then + Result := InstallPath; end; ///////////////////////////////////////////////////////////////////// @@ -107,20 +108,12 @@ begin end; ///////////////////////////////////////////////////////////////////// -procedure CurStepChanged(CurStep: TSetupStep); -var - ResultCode: Integer; +function NextButtonClick(PageId: Integer): Boolean; begin - if (CurStep=ssInstall) then - begin - if (IsUpgrade()) then - begin - UnInstallOldVersion(); + Result := True; + if (PageId = wpSelectDir) and not FileExists(ExpandConstant('{app}\bin\64bit\obs64.exe')) then begin + MsgBox('OBS Studio (bin\64bit\obs64.exe) does not seem to be installed in that folder. Please select the correct folder.', mbError, MB_OK); + Result := False; + exit; end; - end; - if (CurStep=ssPostInstall) then - begin - ExtractTemporaryFile('msvc-redist-helper.exe'); - Exec(ExpandConstant('{tmp}\msvc-redist-helper.exe'), '2019', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); - end; end;