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.

109 lines
2.2 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM tscert.cmd
  5. REM applies signature to terminal server files
  6. REM
  7. REM owner: MadanA
  8. REM
  9. REM Copyright (c) Microsoft Corporation. All rights reserved.
  10. REM
  11. REM ------------------------------------------------------------------
  12. if defined _CPCMAGIC goto CPCBegin
  13. perl -x "%~f0" %*
  14. goto :EOF
  15. #!perl
  16. use strict;
  17. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  18. use lib $ENV{RAZZLETOOLPATH};
  19. use PbuildEnv;
  20. use ParseArgs;
  21. use Logmsg;
  22. sub Usage { print<<USAGE; exit(1) }
  23. tscert [-l <language>]
  24. Applies signature to terminal server files
  25. USAGE
  26. sub Dependencies {
  27. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  28. errmsg("Unable to open dependency list file.");
  29. die;
  30. }
  31. print DEPEND<<DEPENDENCIES;
  32. \[$0\]
  33. IF {
  34. termdd.sys
  35. tdasync.sys
  36. tdipx.sys
  37. tdnetb.sys
  38. tdpipe.sys
  39. tdspx.sys
  40. tdtcp.sys
  41. tsddd.dll
  42. rdpdd.dll
  43. rdpwd.sys
  44. rdpwsx.dll
  45. }
  46. ADD {}
  47. DEPENDENCIES
  48. close DEPEND;
  49. exit;
  50. }
  51. my $qfe;
  52. parseargs('?' => \&Usage,
  53. 'plan' => \&Dependencies,
  54. 'qfe:' => \$qfe);
  55. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  56. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  57. errmsg("Unable to open skip list file.");
  58. die;
  59. }
  60. while (<SKIP>) {
  61. chomp;
  62. exit if lc$_ eq lc$0;
  63. }
  64. close SKIP;
  65. }
  66. # *** NEXT FEW LINES ARE TEMPLATE ***
  67. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  68. __END__
  69. :CPCBegin
  70. set _CPCMAGIC=
  71. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  72. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  73. set TsFileList=termdd.sys tdasync.sys tdipx.sys tdnetb.sys tdpipe.sys tdspx.sys
  74. set TSFileList=%TsFileList% tdtcp.sys tsddd.dll rdpdd.dll rdpwd.sys rdpwsx.dll
  75. for %%f in (%TsFileList%) do call :TsSign %_NTPOSTBLD%\%%f
  76. goto end
  77. :TSSign
  78. REM Only sign file if it is not already signed
  79. if not exist %1 (
  80. call logmsg.cmd "Image %1 does not exist"
  81. goto end
  82. )
  83. tscrtvfy.exe %1
  84. if "%errorlevel%" == "0" (
  85. call logmsg.cmd "Image %1 is already signed (Not signing again)"
  86. goto end
  87. )
  88. call ExecuteCmd "tscrtadd.exe %1"
  89. if not "%errorlevel%" == "0" (
  90. set errors=%errorlevel%
  91. )
  92. goto end
  93. :end
  94. seterror.exe "%errors%"& goto :EOF