Skip to content

Commit

Permalink
Use -sign option to control siging and switch to the sectigo timestam…
Browse files Browse the repository at this point in the history
…ping servers
  • Loading branch information
pmeulen committed Jul 26, 2023
1 parent 6bdfffd commit a484c16
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions SolutionItems/MakeRelease.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,27 @@ copy %root_dir%\UPGRADE.md %release% || goto :error
copy %root_dir%\KNOWN_ISSUES.md %release% || goto :error
copy %root_dir%\CONFIGURATION.md %release% || goto :error

@rem Message when signing is not enabled
@if "%sign%" == "0" (
@choice /m "Sign release?" /c YN
@if "%errorlevel%" == "1" set sign=1
@echo.
@echo ------------------------------------------------------------
@echo Signing is not enabled, the release will not be signed
@echo To sign the release, run MakeRelease.cmd -sign %version%
@echo ------------------------------------------------------------
@echo.
)

@rem Use signtool.exe from the windows SDK to create timestamped signature is requested
@rem First we sign Setup.exe, later we sign the self extracting archive

@rem Set the RFC 3161 timestamp service to use
@rem @set timestampservice=http://timestamp.digicert.com
@set timestampservice=http://timestamp.sectigo.com

@if "%sign%" == "1" (
@echo Signing Setup.exe
signtool sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a %release%\Setup.exe || goto :error
@echo signtool.exe sign /tr %timestampservice% /td sha256 /fd sha256 /a %release%\Setup.exe
signtool.exe sign /tr %timestampservice% /td sha256 /fd sha256 /a %release%\Setup.exe || goto :error
)

@echo Making Self extracting archive
Expand All @@ -113,7 +126,8 @@ del %release%.exe

@if "%sign%" == "1" (
@echo Signing SetupPackage self extracting archive
signtool sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a %release%.exe || goto :error
echo signtool.exe sign /tr %timestampservice% /td sha256 /fd sha256 /a %release%.exe
signtool.exe sign /tr %timestampservice% /td sha256 /fd sha256 /a %release%.exe || goto :error
)

@echo Sucessfully created Release %release%.exe
Expand Down

0 comments on commit a484c16

Please sign in to comment.