Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.8 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM CheckTestSig.cmd - WadeLa
  4. @REM Verifys that all files in fullprslist.txt are signed.
  5. @REM
  6. @REM Copyright (c) Microsoft Corporation. All rights reserved.
  7. @REM
  8. @REM -----------------------------------------------------------------
  9. @if defined _CPCMAGIC goto CPCBegin
  10. @perl -x "%~f0" %*
  11. @goto :EOF
  12. #!perl
  13. use strict;
  14. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  15. use lib $ENV{RAZZLETOOLPATH};
  16. use PbuildEnv;
  17. use ParseArgs;
  18. sub Usage { print<<USAGE; exit(1) }
  19. CheckTestSig [-l <language>]
  20. Verify that all files listed in fullprslist.txt are signed. CheckTestSign
  21. will try once to sign any unsigned files. Returns an error if any files
  22. are still unsigned after attempting to resign.
  23. USAGE
  24. parseargs('?' => \&Usage);
  25. # *** TEMPLATE CODE ***
  26. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  27. __END__
  28. @:CPCBegin
  29. @set _CPCMAGIC=
  30. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  31. @if not defined DEBUG echo off
  32. @REM *** CMD SCRIPT BELOW ***
  33. REM Loop over everything listed in newprs\fullprslist.txt
  34. REM Chktrust first. If it is not signed, sign it and log
  35. REM a warning
  36. set CatList=%RazzleToolPath%\postbuildscripts\newprs\fullprslist.txt
  37. for /f %%a in (%CatList%) do (
  38. if exist %_NTPostBld%\%%a (
  39. call logmsg.cmd "Test signing %_NTPostBld%\%a..."
  40. call ntsign.cmd -n -f %_NTPostBld%\%%a
  41. chktrust -q %_NTPostBld%\%%a
  42. if !ErrorLevel! EQU 0 (
  43. call logmsg.cmd "%_NTPostBld%\%%a test signed..."
  44. ) else (
  45. call errmsg.cmd "%_NTPostBld%\%%a not signed successfully."
  46. )
  47. ) else (
  48. call logmsg.cmd "WARNING: %_NTPostBld%\%%a not found..."
  49. )
  50. )
  51. goto end
  52. :end
  53. seterror.exe "%errors%"& goto :EOF