Paste P144

Signing
ActivePublic

Authored by alvinhochun on Dec 9 2017, 5:34 PM.
@echo off
setlocal enableextensions enabledelayedexpansion
set "SIGNTOOL=C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\signtool.exe"
set pkg_root=%~f1
echo Signing binaries in "%pkg_root%"
if not exist "%pkg_root%\" (
echo ERROR: No packaging dir %1 1>&2
exit /b 1
)
for /r "%pkg_root%\" %%F in (*.exe *.dll *.pyd) do (
:: Check for existing signature
"%SIGNTOOL%" verify /q /pa "%%F" > NUL
if errorlevel 1 (
echo Signing %%F
"%SIGNTOOL%" sign /f "C:\Users\Alvin\MySPC.pfx" /t http://timestamp.verisign.com/scripts/timstamp.dll "%%F"
if errorlevel 1 (
echo ERROR: Got exit code !errorlevel! from signtool! 1>&2
exit /b 1
)
) else (
echo Not signing %%F - file already signed
)
)
endlocal
alvinhochun created this paste.Dec 9 2017, 5:34 PM
alvinhochun created this object in space S1 KDE Community.