PICARD-2331: Adjust Windows Qt DLL fix to Qt6

This commit is contained in:
Philipp Wolfer
2023-09-27 15:44:37 +02:00
parent 0a713728af
commit 3de588eb2e

View File

@@ -45,16 +45,16 @@ Function FinalizePackage {
CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath fpcalc.exe) -ErrorAction Stop
CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath discid.dll) -ErrorAction Stop
# Move all Qt5 DLLs into the main folder to avoid conflicts with system wide
# Move all Qt6 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 $Path -ChildPath PyQt5\Qt5\bin)
Move-Item -Path (Join-Path -Path $Qt5BinDir -ChildPath *.dll) -Destination $Path -Force
Remove-Item -Path $Qt5BinDir
$QtBinDir = (Join-Path -Path $Path -ChildPath PyQt6\Qt6\bin)
Move-Item -Path (Join-Path -Path $QtBinDir -ChildPath *.dll) -Destination $Path -Force
Remove-Item -Path $QtBinDir
# Mitigate libwebp vulnerability allowing for arbitrary code execution (CVE-2023-4863).
# Disable the Qt webp imageformat plugin.
Remove-Item -Path (Join-Path -Path $Path -ChildPath PyQt5\Qt5\plugins\imageformats\qwebp.dll)
Remove-Item -Path (Join-Path -Path $Path -ChildPath PyQt6\Qt6\plugins\imageformats\qwebp.dll)
}