File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ @ echo off
2+ rem For information see
3+ rem https://search.thawte.com/support/ssl-digital-certificates/index?page=content&actp=CROSSLINK&id=SO17631
4+
5+ setlocal EnableExtensions EnableDelayedExpansion
6+
7+ set certificatesFolder = %~dp0
8+
9+ set target = %~1
10+
11+ if not exist " %target% " (
12+ echo First argument should be the name of the file, the one specified was not found.
13+ exit /b 1
14+ )
15+ shift
16+
17+ set description = %~1
18+ if " %description% " == " " (
19+ echo Second argument should be the description the file is signed with.
20+ exit /b 1
21+ )
22+ shift
23+
24+ set signToolRelative1 = Windows Kits\10\App Certification Kit\signtool.exe
25+ set signtoolRelative2 = Microsoft SDKs\ClickOnce\SignTool
26+ set signtool = " %ProgramFiles% \%signToolRelative1% "
27+
28+ rem RFC3161 timestamping URL for SHA256
29+ set timestampURL256 = http://timestamp.sectigo.com
30+
31+
32+
33+ if not exist %signtool% set signtool = " %SystemDrive% \Progra~2\%signToolRelative1% "
34+ if not exist %signtool% set signtool = " %ProgramFiles% \%signToolRelative2% "
35+ if not exist %signtool% set signtool = " %SystemDrive% \Progra~2\%signToolRelative2% "
36+
37+ if not exist %signtool% (
38+ echo Signing tool not found:
39+ echo %signtool%
40+ exit /b 1
41+ )
42+
43+
44+ echo Signing %target% with description " %description% "
45+
46+ set signSHA256 = %signtool% sign /tr " %timestampURL256% " /td SHA256 /fd SHA256 /d " %description% " /v /a " %target% "
47+
48+ :signSHA256
49+ echo %signSHA256%
50+ %signSHA256%
51+ if %errorlevel% NEQ 0 exit /b %errorlevel%
52+
53+
54+
55+
56+
57+
58+
59+
60+
You can’t perform that action at this time.
0 commit comments