Skip to content

Commit 92b232b

Browse files
committed
win,build: try multiple timeservers when signing
PR-URL: #9155 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: João Reis <reis@janeasystems.com>
1 parent a14a6a3 commit 92b232b

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

tools/sign.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
3+
set timeservers=(http://timestamp.globalsign.com/scripts/timestamp.dll http://timestamp.comodoca.com/authenticode http://timestamp.verisign.com/scripts/timestamp.dll http://tsa.starfieldtech.com)
4+
5+
for %%s in %timeservers% do (
6+
signtool sign /a /d "node" /t %%s %1
7+
if not ERRORLEVEL 1 (
8+
echo Successfully signed %1 using timeserver %%s
9+
exit /b 0
10+
)
11+
echo Signing %1 failed using %%s
12+
)
13+
14+
echo Could not sign %1 using any available timeserver
15+
exit /b 1

vcbuild.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ if errorlevel 1 goto exit
196196
@rem Skip signing if the `nosign` option was specified.
197197
if defined nosign goto licensertf
198198

199-
signtool sign /a /d "node" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\node.exe
199+
call tools\sign.bat Release\node.exe
200200
if errorlevel 1 echo Failed to sign exe&goto exit
201201

202202
:licensertf
@@ -216,7 +216,7 @@ msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:PlatformToolset=%
216216
if errorlevel 1 goto exit
217217

218218
if defined nosign goto upload
219-
signtool sign /a /d "node" /t http://timestamp.globalsign.com/scripts/timestamp.dll node-v%FULLVERSION%-%target_arch%.msi
219+
call tools\sign.bat node-v%FULLVERSION%-%target_arch%.msi
220220
if errorlevel 1 echo Failed to sign msi&goto exit
221221

222222
:upload

0 commit comments

Comments
 (0)