Windows/NSIS installer: use signtool.exe found by CMake

This commit is contained in:
Floris Bos 2023-05-21 17:25:04 +02:00
parent bb8b097c7d
commit 64d271b092
2 changed files with 3 additions and 2 deletions

View file

@ -228,6 +228,7 @@ if (WIN32)
if (NOT SIGNTOOL) if (NOT SIGNTOOL)
message(FATAL_ERROR "Unable to locate signtool.exe used for code signing") message(FATAL_ERROR "Unable to locate signtool.exe used for code signing")
endif() endif()
add_definitions(-DSIGNTOOL="${SIGNTOOL}")
add_custom_command(TARGET ${PROJECT_NAME} add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD POST_BUILD

View file

@ -63,13 +63,13 @@ InstallDir "$PROGRAMFILES\Raspberry Pi Imager"
; That will have written an uninstaller binary for us. Now we sign it with your ; That will have written an uninstaller binary for us. Now we sign it with your
; favorite code signing tool. ; favorite code signing tool.
!system '"c:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe" sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a "$%TEMP%\uninstall.exe"' = 0 !system '"@SIGNTOOL@" sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a "$%TEMP%\uninstall.exe"' = 0
; Good. Now we can carry on writing the real installer. ; Good. Now we can carry on writing the real installer.
OutFile "${INSTALLER_NAME}" OutFile "${INSTALLER_NAME}"
SetCompressor /SOLID lzma SetCompressor /SOLID lzma
!finalize '"c:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe" sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a "%1"' !finalize '"@SIGNTOOL@" sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a "%1"'
!endif !endif
### ###