Skip to content

Commit 09b91bd

Browse files
committed
#143 remove pause when when sign tool is not found to avoid blocking automated process
# Conflicts: # Scripts/sign-tool.cmd
1 parent 8fe21db commit 09b91bd

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Scripts/sign-tool.cmd

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+

0 commit comments

Comments
 (0)