Skip to content

Commit

Permalink
PICARD-2724: Move all Qt5 DLLs into main directory on Windows
Browse files Browse the repository at this point in the history
Avoids import errors if a system wide, incompatible Qt5 installation
is present on the system.
  • Loading branch information
phw committed Sep 8, 2023
1 parent b100eb1 commit addf1cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/package/win-common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check notice on line 45 in scripts/package/win-common.ps1

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

scripts/package/win-common.ps1#L45

Cmdlet 'Join-Path' has positional parameter. Please use named parameters instead of positional parameters when calling a command.

Check warning

Code scanning / Psscriptanalyzer (reported by Codacy)

Cmdlet 'Join-Path' has positional parameter. Please use named parameters instead of positional parameters when calling a command. Warning

Cmdlet 'Join-Path' has positional parameter. Please use named parameters instead of positional parameters when calling a command.
Move-Item (Join-Path $Qt5BinDir *.dll) $Path -Force
Remove-Item $Qt5BinDir
}

0 comments on commit addf1cf

Please sign in to comment.