Source code of Windows XP (NT5)
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.

67 lines
1.8 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM CheckTestSig.cmd
  5. REM Verifys that all files in fullprslist.txt are signed.
  6. REM
  7. REM Copyright (c) Microsoft Corporation. All rights reserved.
  8. REM
  9. REM ------------------------------------------------------------------
  10. if defined _CPCMAGIC goto CPCBegin
  11. perl -x "%~f0" %*
  12. goto :EOF
  13. #!perl
  14. use strict;
  15. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  16. use lib $ENV{RAZZLETOOLPATH};
  17. use PbuildEnv;
  18. use ParseArgs;
  19. sub Usage { print<<USAGE; exit(1) }
  20. CheckTestSig [-l <language>]
  21. Verify that all files listed in fullprslist.txt are signed. CheckTestSign
  22. will try once to sign any unsigned files. Returns an error if any files
  23. are still unsigned after attempting to resign.
  24. USAGE
  25. parseargs('?' => \&Usage);
  26. # *** NEXT FEW LINES ARE TEMPLATE ***
  27. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  28. __END__
  29. :CPCBegin
  30. set _CPCMAGIC=
  31. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  32. REM *** BEGIN YOUR 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. chktrust -q %_NTPostBld%\%%a
  40. if !ErrorLevel! EQU 0 (
  41. call logmsg.cmd "%_NTPostBld%\%%a successfully signed."
  42. ) else (
  43. call logmsg.cmd "WARNING: %_NTPostBld%\%%a not signed. Attempting to resign."
  44. call ntsign.cmd -n -f %_NTPostBld%\%%a
  45. chktrust -q %_NTPostBld%\%%a
  46. if !ErrorLevel! EQU 0 (
  47. call logmsg.cmd "%_NTPostBld%\%%a signed on retry."
  48. ) else (
  49. call errmsg.cmd "%_NTPostBld%\%%a not signed on retry."
  50. )
  51. )
  52. )
  53. )
  54. goto end
  55. :end
  56. seterror.exe "%errors%"& goto :EOF