From 7c7de584a67f44ea22d624d9b655b25ac2e9b8d5 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Fri, 8 Sep 2023 08:07:05 +0200 Subject: [PATCH] PICARD-2724: Move all Qt5 DLLs into main directory on Windows Avoids import errors if a system wide, incompatible Qt5 installation is present on the system. --- scripts/package/win-common.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/package/win-common.ps1 b/scripts/package/win-common.ps1 index d6fb096d0..1e0607d4a 100644 --- a/scripts/package/win-common.ps1 +++ b/scripts/package/win-common.ps1 @@ -36,4 +36,13 @@ Function FinalizePackage { CodeSignBinary (Join-Path $Path picard.exe) CodeSignBinary (Join-Path $Path fpcalc.exe) CodeSignBinary (Join-Path $Path discid.dll) + + # Move all Qt5 DLLs into the main folder to avoid conflicts with system wide + # versions of those dependencies. Since some version PyInstaller tries to + # maintain the file hierarchy of imported modules, but this easily breaks + # DLL loading on Windows. + # Workaround for https://tickets.metabrainz.org/browse/PICARD-2736 + $Qt5BinDir = (Join-Path $Path PyQt5 Qt5 bin) + Move-Item (Join-Path $Qt5BinDir *.dll) $Path -Force + Remove-Item $Qt5BinDir }