-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from IT-Service/develop
v1.0.0
- Loading branch information
Showing
9 changed files
with
179 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
chocolatey/signcode.install/sources/signcode.install/signcodepwd.cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
@echo off | ||
setlocal enableextensions enabledelayedexpansion | ||
set SIGNCODEPWD=signcode-pwd.exe | ||
set SIGNCODE=signcode.exe | ||
set CODE_TIMESTAMP_URL=http://timestamp.verisign.com/scripts/timstamp.dll | ||
set CODE_SIGNING_DLL=mssipotf.dll | ||
set SIGNCODEPASSWORD=%CODE_SIGNING_CERTIFICATE_PASSWORD% | ||
|
||
:parseargs | ||
if "%~1"=="" goto :endparseargs | ||
if "%~1"=="-h" ( | ||
:help | ||
echo Parameters -spc, -v, -t, -j, -p and filename for signing expected. | ||
exit /b -1 | ||
) | ||
if "%~1"=="/?" goto :help | ||
if "%~1"=="-?" goto :help | ||
if "%~1"=="-help" goto :help | ||
if "%~1"=="--help" goto :help | ||
if "%~1"=="-spc" ( | ||
set CODE_SIGNING_CERTIFICATE_SPC=%~2 | ||
shift | ||
shift | ||
goto :parseargs | ||
) | ||
if "%~1"=="-v" ( | ||
set CODE_SIGNING_CERTIFICATE_PVK=%~2 | ||
shift | ||
shift | ||
goto :parseargs | ||
) | ||
if "%~1"=="-t" ( | ||
set CODE_TIMESTAMP_URL=%~2 | ||
shift | ||
shift | ||
goto :parseargs | ||
) | ||
if "%~1"=="-j" ( | ||
set CODE_SIGNING_DLL=%~2 | ||
shift | ||
shift | ||
goto :parseargs | ||
) | ||
if "%~1"=="-p" ( | ||
set SIGNCODEPASSWORD=%~2 | ||
shift | ||
shift | ||
goto :parseargs | ||
) | ||
set FILEFORSIGNING=%~1 | ||
shift | ||
goto :parseargs | ||
:endparseargs | ||
|
||
if "%CODE_SIGNING_CERTIFICATE_SPC%"=="" goto :help | ||
if "%CODE_SIGNING_CERTIFICATE_PVK%"=="" goto :help | ||
if "%CODE_TIMESTAMP_URL%"=="" goto :help | ||
if "%CODE_SIGNING_DLL%"=="" goto :help | ||
if "%SIGNCODEPASSWORD%"=="" goto :help | ||
if "%FILEFORSIGNING%"=="" goto :help | ||
|
||
for %%A in ("%FILEFORSIGNING%") do set TMPFILE="%TMP%\%%~nxA" | ||
|
||
copy /Y "%FILEFORSIGNING%" "%TMPFILE%" | ||
@echo on | ||
"%SIGNCODEPWD%" -m %SIGNCODEPASSWORD% | ||
@echo off | ||
set /a i=10 | ||
:signingloopbegin | ||
@echo on | ||
"%SIGNCODE%" ^ | ||
-spc "%CODE_SIGNING_CERTIFICATE_SPC%" ^ | ||
-v "%CODE_SIGNING_CERTIFICATE_PVK%" ^ | ||
-j "%CODE_SIGNING_DLL%" ^ | ||
"%FILEFORSIGNING%" | ||
@set exitcode=%errorlevel% | ||
@echo off | ||
if %exitcode%==0 goto :beforetimestamp | ||
copy /Y "%TMPFILE%" "%FILEFORSIGNING%" | ||
set /a i-=1 | ||
if %i% gtr 0 goto :signingloopbegin | ||
:signingloopend | ||
goto :beforeexit | ||
|
||
:beforetimestamp | ||
copy /Y "%FILEFORSIGNING%" "%TMPFILE%" | ||
set /a i=10 | ||
:timestamploopbegin | ||
@echo on | ||
"%SIGNCODE%" ^ | ||
-x ^ | ||
-t "%CODE_TIMESTAMP_URL%" ^ | ||
"%FILEFORSIGNING%" | ||
@set exitcode=%errorlevel% | ||
@echo off | ||
if %exitcode%==0 goto :timestamploopend | ||
copy /Y "%TMPFILE%" "%FILEFORSIGNING%" | ||
set /a i-=1 | ||
if %i% gtr 0 goto :timestamploopbegin | ||
:timestamploopend | ||
|
||
:beforeexit | ||
@echo on | ||
"%SIGNCODEPWD%" -t | ||
@REM @del /F /Q "%TMPFILE%" | ||
@exit /b %exitcode% |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters