Make sure to sign all EXEs (#16141)

* Make sure to sign all EXEs

* type dev->dir

* Adjust code to sign all EXEs
This commit is contained in:
Earle Lowe 2023-08-23 15:50:36 -07:00 committed by GitHub
parent 9093c4013b
commit 9c1d285091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,14 +68,33 @@ mv temp.json package.json
Write-Output " ---"
Write-Output " ---"
Write-Output "electron-builder"
electron-builder build --win --x64 --config.productName="Chia"
Write-Output "electron-builder create package directory"
electron-builder build --win --x64 --config.productName="Chia" --dir
Get-ChildItem dist\win-unpacked\resources
Write-Output " ---"
If ($env:HAS_SIGNING_SECRET) {
Write-Output " ---"
Write-Output "Sign App"
Write-Output "Sign all EXEs"
Get-ChildItem ".\dist\win-unpacked" -Recurse | Where-Object { $_.Extension -eq ".exe" } | ForEach-Object {
$exePath = $_.FullName
Write-Output "Signing $exePath"
signtool.exe sign /sha1 $env:SM_CODE_SIGNING_CERT_SHA1_HASH /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 $exePath
Write-Output "Verify signature"
signtool.exe verify /v /pa $exePath
}
} Else {
Write-Output "Skipping verify signatures - no authorization to install certificates"
}
Write-Output " ---"
Write-Output "electron-builder create installer"
electron-builder build --win --x64 --config.productName="Chia" --pd ".\dist\win-unpacked"
Write-Output " ---"
If ($env:HAS_SIGNING_SECRET) {
Write-Output " ---"
Write-Output "Sign Final Installer App"
signtool.exe sign /sha1 $env:SM_CODE_SIGNING_CERT_SHA1_HASH /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 .\dist\ChiaSetup-$packageVersion.exe
Write-Output " ---"
Write-Output "Verify signature"