Files
picard/scripts/package/win-common.ps1
Philipp Wolfer 1636fcb310 PICARD-1703: Upgrade to PyInstaller 3.6
Allows us to remove some Windows specific workarounds, fixes a CVE related to the portable onefile install.
2020-01-11 15:09:01 +01:00

44 lines
954 B
PowerShell

# Common functions for Windows packaging scripts
Param(
[System.Security.Cryptography.X509Certificates.X509Certificate]
$Certificate
)
Function CodeSignBinary {
Param(
[ValidateScript({Test-Path $_ -PathType Leaf})]
[String]
$BinaryPath
)
If ($Certificate) {
Set-AuthenticodeSignature -FilePath $BinaryPath -Certificate $Certificate `
-ErrorAction Stop
} Else {
Write-Output "Skip signing $BinaryPath"
}
}
Function ThrowOnExeError {
Param( [String]$Message )
If ($LastExitCode -ne 0) {
Throw $Message
}
}
Function FinalizePackage {
Param(
[ValidateScript({Test-Path $_ -PathType Container})]
[String]
$Path
)
CodeSignBinary (Join-Path $Path picard.exe)
CodeSignBinary (Join-Path $Path fpcalc.exe)
CodeSignBinary (Join-Path $Path discid.dll)
# Delete unused files
Remove-Item -Path (Join-Path $Path libcrypto-1_1.dll)
Remove-Item -Path (Join-Path $Path libssl-1_1.dll)
}