diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index 439b1e673..36a001531 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -43,6 +43,10 @@ OutFile ".\build\npp.${APPVERSION}.Installer.arm64.exe" OutFile ".\build\npp.${APPVERSION}.Installer.exe" !endif +; Sign both installer and uninstaller +!finalize 'sign-installers.bat "%1"' = 0 ; %1 is replaced by the installer exe to be signed. +!uninstfinalize 'sign-installers.bat "%1"' = 0 ; %1 is replaced by the uninstaller exe to be signed. + ; ------------------------------------------------------------------------ ; Version Information VIProductVersion "${Version}" diff --git a/PowerEditor/installer/packageAll.bat b/PowerEditor/installer/packageAll.bat index 3cbbadf85..84b368965 100644 --- a/PowerEditor/installer/packageAll.bat +++ b/PowerEditor/installer/packageAll.bat @@ -542,14 +542,6 @@ ren npp.portable.minimalist.7z !7zvarMin! ren npp.portable.minimalist.x64.7z !7zvarMin64! ren npp.portable.minimalist.arm64.7z !7zvarMinArm64! -if %SIGN% == 0 goto NoSignInstaller -%signBinary% !nppInstallerVar! -If ErrorLevel 1 goto End -%signBinary% !nppInstallerVar64! -If ErrorLevel 1 goto End -%signArmBinary% !nppInstallerVarArm64! -If ErrorLevel 1 goto End -:NoSignInstaller cd .. diff --git a/PowerEditor/installer/sign-installers.bat b/PowerEditor/installer/sign-installers.bat new file mode 100644 index 000000000..1f6729ef1 --- /dev/null +++ b/PowerEditor/installer/sign-installers.bat @@ -0,0 +1,19 @@ +@ECHO OFF + +if [%SIGN%] == [] goto NoSignInstaller +if not %SIGN% == 1 goto NoSignInstaller + +ECHO Start signing file: %1 +%signBinary% "%1" + +if errorlevel 1 goto SigningFailed +goto SigningOK + +:SigningFailed +echo Failed to sign file %1 +exit 1 + +:NoSignInstaller +ECHO Signing skipped for file: %1 + +:SigningOK