From 7f08d77b36281e088afa256fd856ab0b1027bd5e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 12 Jan 2016 17:27:54 -0800 Subject: [PATCH] move uninstaller signing to onInit --- cmake/templates/NSIS.template.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 92059d3a3e..89c5d89a90 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -49,13 +49,6 @@ !system "$%TEMP%\tempinstaller.exe" = 2 - ; That will have written an uninstaller binary for us. Now we sign it with your - ; favourite code signing tool, if it's a production build. - - ${If} "@PRODUCTION_BUILD@" == "1" - !system "signcode $%TEMP%\uninstaller.exe" = 0 - ${EndIf} - ; Good. Now we can carry on writing the real installer. ;Name and file @@ -1110,6 +1103,13 @@ Function .onInit Quit !endif + ; The Inner invocation has written an uninstaller binary for us. + ; We need to sign it if it's a production build. + + ${If} "@PRODUCTION_BUILD@" == "1" + !system "signcode $%TEMP%\uninstaller.exe" = 0 + ${EndIf} + StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString"