Skip to content

Commit

Permalink
Fail packaging on Windows code signing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Sep 21, 2023
1 parent 05d605d commit 2a3ad2a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions scripts/package/win-common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Function FinalizePackage {
$Path
)

CodeSignBinary (Join-Path -Path $Path -ChildPath picard.exe)
CodeSignBinary (Join-Path -Path $Path -ChildPath fpcalc.exe)
CodeSignBinary (Join-Path -Path $Path -ChildPath discid.dll)
CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath picard.exe) -ErrorAction Stop
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
# versions of those dependencies. Since some version PyInstaller tries to
Expand Down
3 changes: 2 additions & 1 deletion scripts/package/win-package-appx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Param(

# Errors are handled explicitly. Otherwise any output to stderr when
# calling classic Windows exes causes a script error.
# TODO: For PowerShell >= 7.3 use $PSNativeCommandUseErrorActionPreference = $true
$ErrorActionPreference = 'Continue'

If (-Not $BuildNumber) {
Expand Down Expand Up @@ -68,4 +69,4 @@ If ($CertificateFile -or $Certificate) {
MakeAppx pack /o /h SHA256 /d $PackageDir /p $PackageFile
ThrowOnExeError "MakeAppx failed"

CodeSignBinary $PackageFile
CodeSignBinary -BinaryPath $PackageFile -ErrorAction Stop
2 changes: 1 addition & 1 deletion scripts/package/win-package-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ FinalizePackage dist\picard
# Build the installer
makensis.exe /INPUTCHARSET UTF8 installer\picard-setup.nsi 2>&1 | %{ "$_" }
ThrowOnExeError "NSIS failed"
CodeSignBinary installer\picard-setup-*.exe
CodeSignBinary -BinaryPath installer\picard-setup-*.exe -ErrorAction Stop
2 changes: 1 addition & 1 deletion scripts/package/win-package-portable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ ThrowOnExeError "setup.py build_ext -i failed"
$env:PICARD_BUILD_PORTABLE = '1'
pyinstaller --noconfirm --clean picard.spec 2>&1 | %{ "$_" }
ThrowOnExeError "PyInstaller failed"
CodeSignBinary dist\MusicBrainz-Picard-*.exe
CodeSignBinary -BinaryPath dist\MusicBrainz-Picard-*.exe -ErrorAction Stop

0 comments on commit 2a3ad2a

Please sign in to comment.