aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sign.bat
blob: a49bc39cae3961d015fbe455f45961cf64316a5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@setlocal enabledelayedexpansion
@echo off

set cert_store=Test Certificate Store
set cert_name=Test Certificate

if [%1] == [] (
  echo Usage: %0 SYS_PATH
  exit /b 1
)

set sys_path=%~f1

echo ============================ CERT INFO ============================
echo Certificate store: "%cert_store%"
echo Certificate name: "%cert_name%"
echo ========================== END CERT INFO ==========================
echo.
echo ============================= SIGNING =============================
echo signtool.exe sign /s "%cert_store%" /n "%cert_name%" "%sys_path%"
signtool.exe sign /s "%cert_store%" /n "%cert_name%" "%sys_path%" >nul || goto :signing_failure
echo signtool.exe verify /pa "%sys_path%"
signtool.exe verify /pa "%sys_path%" >nul || goto :signing_failure
echo ========================= SIGNING SUCCESS =========================
exit /b 0

:signing_failure
echo ========================= SIGNING FAILURE =========================
exit /b %errorlevel%