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.

142 lines
3.5 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM nntpsmtp.cmd
  5. REM Generates cabs, catalogs, and infs for NNTP/SMTP
  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. nntpsmtp [-l <language>]
  21. Generates cabs, catalogs, and infs for NNTP/SMTP.
  22. USAGE
  23. parseargs('?' => \&Usage);
  24. # *** NEXT FEW LINES ARE TEMPLATE ***
  25. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  26. __END__
  27. :CPCBegin
  28. set _CPCMAGIC=
  29. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  30. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  31. REM Creates the following files for NNTP/SMTP:
  32. REM NNTP:
  33. REM ins.cab
  34. REM ins.cat
  35. REM ins.inf
  36. REM srvinf\ins.inf
  37. REM SMTP:
  38. REM ims.cab
  39. REM ims.cat
  40. REM ims_w.inf
  41. REM srvinf\ims_s.inf
  42. REM
  43. REM Perform cleanup of ins/ims cats and cabs for a full postbuild.
  44. REM
  45. if exist %_NTPOSTBLD%\build_logs\FullPass.txt (
  46. call ExecuteCmd.cmd "if exist %_NTPostBld%\ins.cab del %_NTPostBld%\ins.cab /s/q"
  47. call ExecuteCmd.cmd "if exist %_NTPostBld%\ins.cat del %_NTPostBld%\ins.cat /s/q"
  48. call ExecuteCmd.cmd "if exist %_NTPostBld%\ims.cab del %_NTPostBld%\ims.cab /s/q"
  49. call ExecuteCmd.cmd "if exist %_NTPostBld%\ims.cat del %_NTPostBld%\ims.cat /s/q"
  50. )
  51. REM
  52. REM Create the cab files ins.cab and ims.cab for nntpsmtp.
  53. REM
  54. if not exist %_NTPostBld%\staxpt\dump (
  55. call errmsg.cmd "Unable to find directory %_NTPostBld%\staxpt\dump."
  56. goto end
  57. )
  58. pushd %_NTPostBld%\staxpt\dump
  59. if errorlevel 1 goto end
  60. set nonntp=
  61. set noinf=
  62. REM
  63. REM NNTP/SMTP infs are dynamically generated for USA by makecab.cmd,
  64. REM but they're dropped pre-localized for international languages to
  65. REM \\rastaman\fe -p nntpsmtp.
  66. REM
  67. if /i not "%lang%"=="usa" set noinf=/noinf
  68. REM
  69. REM NNTP is only applicable to languages that ship a server product.
  70. REM
  71. set /A found=0
  72. perl %RazzleToolPath%\cksku.pm -t:bla -l:%lang%
  73. if %errorlevel% EQU 0 set /A found=1
  74. perl %RazzleToolPath%\cksku.pm -t:sbs -l:%lang%
  75. if %errorlevel% EQU 0 set /A found=1
  76. perl %RazzleToolPath%\cksku.pm -t:srv -l:%lang%
  77. if %errorlevel% EQU 0 set /A found=1
  78. perl %RazzleToolPath%\cksku.pm -t:ads -l:%lang%
  79. if %errorlevel% EQU 0 set /A found=1
  80. perl %RazzleToolPath%\cksku.pm -t:dtc -l:%lang%
  81. if %errorlevel% EQU 0 set /A found=1
  82. if %found% EQU 0 set nonntp=/nonntp
  83. REM Makecab.cmd should set errorlevel to a positive value if it fails.
  84. call ExecuteCmd.cmd "call makecab.cmd %nonntp% %noinf%"
  85. if errorlevel 1 goto end
  86. popd
  87. REM
  88. REM Create the catalog files for nntpsmtp
  89. REM
  90. pushd %RazzleToolPath%
  91. if errorlevel 1 (
  92. call errmsg.cmd "createcat.cmd to run from %RazzleToolPath% only."
  93. goto end
  94. )
  95. if not defined nonntp (
  96. call ExecuteCmd.cmd "call createcat.cmd -f %_NTPostBld%\staxpt\dump\nt5ins.lst -c ins -t %_NTPostBld%\staxpt\dump -o %_NTPostBld% -l:%lang%"
  97. )
  98. call ExecuteCmd.cmd "call createcat.cmd -f %_NTPostBld%\staxpt\dump\nt5ims.lst -c ims -t %_NTPostBld%\staxpt\dump -o %_NTPostBld% -l:%lang%"
  99. popd
  100. if not exist %_NTPostBld%\cdf md %_NTPostBld%\cdf
  101. REM Don't check errorlevel since md will return 1 if the directory already exists
  102. if not defined nonntp (
  103. call ExecuteCmd.cmd "move %_NTPostBld%\ins.cdf %_NTPostBld%\cdf\ins.cdf"
  104. )
  105. call ExecuteCmd.cmd "move %_NTPostBld%\ims.cdf %_NTPostBld%\cdf\ims.cdf"
  106. goto end
  107. :end
  108. seterror.exe "%errors%"& goto :EOF