En fazla 300 kez döngü yapan aşağıdaki toplu iş dosyasını kullanıyorum. İki bağımsız değişken var,% 1 toplu iş dosyasını, pfx dosyasını ve signtool.exe'yi içeren bir klasörün yoludur. % 2, imzalanan dosyanın tam yoludur. Bunu, Visual Studio post build olayınızda "$ (SolutionDir) thirdparty \ signing \ sign.bat" "$ (SolutionDir) thirdparty \ signing" "$ (TargetPath)" gibi bir şeyle çağırabilirsiniz. Bu toplu iş dosyasını şu şekilde değiştirdim her yinelemede farklı zaman damgası sunucuları kullanın. Şu anda Comodo, Verisign, GlobalSign ve Starfield kullanıyor. Umarım bu The Ultimate Signing Script'dir;)
@echo off
REM create an array of timestamp servers...
set SERVERLIST=(http://timestamp.comodoca.com/authenticode http://timestamp.verisign.com/scripts/timestamp.dll http://timestamp.globalsign.com/scripts/timestamp.dll http://tsa.starfieldtech.com)
REM sign the file...
%1\signtool.exe sign /f %1\comodo.pfx /p videodigital %2
set timestampErrors=0
for /L %%a in (1,1,300) do (
for %%s in %SERVERLIST% do (
REM try to timestamp the file. This operation is unreliable and may need to be repeated...
%1\signtool.exe timestamp /t %%s %2
REM check the return value of the timestamping operation and retry a max of ten times...
if ERRORLEVEL 0 if not ERRORLEVEL 1 GOTO succeeded
echo Signing failed. Probably cannot find the timestamp server at %%s
set /a timestampErrors+=1
)
REM wait 2 seconds...
choice /N /T:2 /D:Y >NUL
)
REM return an error code...
echo sign.bat exit code is 1. There were %timestampErrors% timestamping errors.
exit /b 1
:succeeded
REM return a successful code...
echo sign.bat exit code is 0. There were %timestampErrors% timestamping errors.
exit /b 0
Ayrıca http: //timestamp.comodoca.com'u güvenilir sitelere koydum (teşekkürler Vince). Bunun önemli bir adım olabileceğini düşünüyorum. Bilgisayardaki kök sertifikaları da güncelledim.