From b6850aff0de47ff07649ccf2d10133c5d12b4ccb Mon Sep 17 00:00:00 2001 From: Jack Lau Date: Fri, 28 Aug 2026 14:09:34 +0800 Subject: [PATCH 1/2] fix: update Qt version and deploy path for windows build The old 6.4.3/msvc2019_64 toolchain no longer builds on the current windows runner, so bump Qt to 6.8.3/msvc2022_64. The deploy step still pointed windeployqt at the old 6.4.3/msvc2019_64 path, which no longer exists; align it so the Qt runtime bundling actually runs. --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3f169f11..a7764c90 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -395,10 +395,10 @@ jobs: - name: (2) Install Qt uses: jurplel/install-qt-action@v3 with: - version: 6.4.3 + version: 6.8.3 host: windows target: desktop - arch: win64_msvc2019_64 + arch: win64_msvc2022_64 dir: ${{ runner.temp }} setup-python: false @@ -428,7 +428,7 @@ jobs: Copy-Item -Path "src\build\Release\OpenConverter.exe" -Destination "OpenConverter_win64" # 3) Bundle Qt runtime into OpenConverter_win64/ - & "D:\a\_temp\Qt\6.4.3\msvc2019_64\bin\windeployqt.exe" ` + & "D:\a\_temp\Qt\6.8.3\msvc2022_64\bin\windeployqt.exe" ` "--qmldir=src" ` "OpenConverter_win64\OpenConverter.exe" From 2e1e6701282f34981fda65f420b6fe4b659b4b96 Mon Sep 17 00:00:00 2001 From: Jack Lau Date: Wed, 30 Sep 2026 16:36:29 +0800 Subject: [PATCH 2/2] fix: bundle MSVC C++ runtime DLLs for windows build The windows package crashed on machines whose VC++ Redistributable is older than the toolset used to build it: msvcp140.dll 14.20 (VS2019) in System32 against a VS2022 (14.4x) build -> 0xc0000005 inside MSVCP140.dll while transcoding. windeployqt never ships the runtime DLLs (in release mode it only copies the vc_redist installer), so ship them app-local instead. - copy Microsoft.VC143.CRT\*.dll from the VS redist directory into OpenConverter_win64 (app-local wins over System32) - fail the build when vcruntime140.dll / vcruntime140_1.dll / msvcp140.dll are missing from the package - resolve windeployqt.exe via Get-Command (PATH) instead of a hard-coded path; install-qt-action@v3 puts /bin on PATH and never exports QT_ROOT_DIR (that variable only exists in v4) --- .github/workflows/build.yaml | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a7764c90..82950085 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -428,7 +428,15 @@ jobs: Copy-Item -Path "src\build\Release\OpenConverter.exe" -Destination "OpenConverter_win64" # 3) Bundle Qt runtime into OpenConverter_win64/ - & "D:\a\_temp\Qt\6.8.3\msvc2022_64\bin\windeployqt.exe" ` + # Resolve windeployqt through PATH instead of a hard-coded path, so + # bumping the Qt version can't silently break deployment + # (install-qt-action@v3 puts /bin on PATH; QT_ROOT_DIR is v4+). + $windeployqt = (Get-Command windeployqt.exe -ErrorAction SilentlyContinue).Source + if (-not $windeployqt) { + throw "windeployqt.exe not found in PATH; check the 'Install Qt' step" + } + Write-Host "Using $windeployqt" + & $windeployqt ` "--qmldir=src" ` "OpenConverter_win64\OpenConverter.exe" @@ -437,6 +445,32 @@ jobs: -Path "ffmpeg\ffmpeg-n5.1.6-11-gcde3c5fc0c-win64-gpl-shared-5.1\bin\*.dll" ` -Destination "OpenConverter_win64" + # 5) Bundle the MSVC C++ runtime app-local. The app directory wins over + # System32, so the package also runs on machines whose VC++ + # Redistributable is older than the toolset used here (a 14.20 + # msvcp140.dll from VS2019 crashes this build with 0xc0000005). + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + if (-not (Test-Path $vswhere)) { throw "vswhere not found at '$vswhere'" } + $vsPath = & $vswhere -latest -products * ` + -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ` + -property installationPath + $crtDir = Get-ChildItem "$vsPath\VC\Redist\MSVC\*\x64\Microsoft.VC143.CRT" ` + -Directory -ErrorAction SilentlyContinue | + Sort-Object FullName -Descending | Select-Object -First 1 + if (-not $crtDir) { + throw "MSVC runtime redist directory not found under '$vsPath\VC\Redist\MSVC'" + } + Copy-Item "$($crtDir.FullName)\*.dll" -Destination "OpenConverter_win64" + Write-Host "Bundled MSVC runtime from $($crtDir.FullName)" + + # 6) Fail the build when the runtime is incomplete: a missing DLL here + # means the shipped package crashes on clean machines. + foreach ($dll in 'vcruntime140.dll', 'vcruntime140_1.dll', 'msvcp140.dll') { + if (-not (Test-Path "OpenConverter_win64\$dll")) { + throw "missing $dll in OpenConverter_win64" + } + } + # Upload the build artifacts (upload-artifact will automatically zip the folder) - name: Upload build artifacts uses: actions/upload-artifact@v4