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.

63 lines
1.7 KiB

  1. @REM -----------------------------------------------------------------
  2. @REM
  3. @REM ntprintcat.cmd - WadeLa
  4. @REM Creates the ntprint.cat printer catalog
  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. ntprintcat [-l <language>]
  20. Creates the ntprint.cat printer catalog. NT5P needs to be set to the
  21. name of the catalog (ntprint).
  22. USAGE
  23. parseargs('?' => \&Usage);
  24. # *** TEMPLATE CODE ***
  25. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  26. __END__
  27. @:CPCBegin
  28. @set _CPCMAGIC=
  29. @setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  30. @if not defined DEBUG echo off
  31. @REM *** CMD SCRIPT BELOW ***
  32. REM Set some local vars
  33. set catCDFs=%tmp%\CDFs
  34. set CatTemp=%tmp%\cattemp
  35. set catfiles=%tmp%\cats
  36. REM Make a tempfile for catsign
  37. if NOT exist %CatTemp% md %CatTemp%
  38. echotime /t > %CatTemp%\ntprintcat.tmp
  39. call logmsg.cmd "Creating %catfiles%\%nt5p%.CAT ..."
  40. if not exist %_NTPostBld%\congeal_scripts md %_NTPostBld%\congeal_scripts
  41. makecat -o %_NTPostBld%\congeal_scripts\%nt5p%.hash -v %catCDFS%\%nt5p%.CDF > %catCDFs%\%nt5p%.log
  42. if errorlevel 1 (
  43. for /f "tokens=1*" %%i in ('findstr /i processed %catCDFs%\%nt5p%.log') do call errmsg.cmd "%%i %%j"
  44. call errmsg.cmd "makecat -v %catCDFS%\%nt5p%.CDF failed"
  45. set exitcode=1
  46. )
  47. copy %nt5p%.CAT %catfiles%
  48. del %nt5p%.CAT
  49. REM Delete temp file
  50. del %CatTemp%\ntprintcat.tmp
  51. goto end
  52. :end
  53. seterror.exe "%errors%"& goto :EOF