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.

201 lines
4.6 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. use Logmsg;
  20. sub Usage { print<<USAGE; exit(1) }
  21. nntpsmtp [-l <language>]
  22. Generates cabs, catalogs, and infs for NNTP/SMTP.
  23. USAGE
  24. sub Dependencies {
  25. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  26. errmsg("Unable to open dependency list file.");
  27. die;
  28. }
  29. print DEPEND<<DEPENDENCIES;
  30. \[$0\]
  31. IF { ims.cab ims.cat ims.inf }
  32. ADD {
  33. staxpt\\dump\\*
  34. staxpt\\smtp\\help\\*
  35. adsiisex.dll
  36. aqadmin.dll
  37. aqueue.dll
  38. fcachdll.dll
  39. ims.inf
  40. mailmsg.dll
  41. ntfsdrv.dll
  42. ntfsdrct.h
  43. ntfsdrct.ini
  44. regtrace.exe
  45. rwnh.dll
  46. scripto.dll
  47. seo.dll
  48. seos.dll
  49. smtpadm.dll
  50. smtpapi.dll
  51. smtpctrs.dll
  52. smtpctrs.h
  53. smtpctrs.ini
  54. smtpsnap.dll
  55. smtpsvc.dll
  56. snprfdll.dll
  57. }
  58. DEPENDENCIES
  59. close DEPEND;
  60. exit;
  61. }
  62. my $qfe;
  63. parseargs('?' => \&Usage,
  64. 'plan' => \&Dependencies,
  65. 'qfe:' => \$qfe);
  66. if ( -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  67. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  68. errmsg("Unable to open skip list file.");
  69. die;
  70. }
  71. while (<SKIP>) {
  72. chomp;
  73. exit if lc$_ eq lc$0;
  74. }
  75. close SKIP;
  76. }
  77. # *** NEXT FEW LINES ARE TEMPLATE ***
  78. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  79. __END__
  80. :CPCBegin
  81. set _CPCMAGIC=
  82. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  83. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  84. REM Creates the following files for NNTP/SMTP:
  85. REM NNTP:
  86. REM ins.cab
  87. REM ins.cat
  88. REM ins.inf
  89. REM srvinf\ins.inf
  90. REM SMTP:
  91. REM ims.cab
  92. REM ims.cat
  93. REM ims_w.inf
  94. REM srvinf\ims_s.inf
  95. REM
  96. REM Perform cleanup of ins/ims cats and cabs for a full postbuild.
  97. REM
  98. if exist %_NTPOSTBLD%\build_logs\FullPass.txt (
  99. call ExecuteCmd.cmd "if exist %_NTPostBld%\ins.cab del %_NTPostBld%\ins.cab /s/q"
  100. call ExecuteCmd.cmd "if exist %_NTPostBld%\ins.cat del %_NTPostBld%\ins.cat /s/q"
  101. call ExecuteCmd.cmd "if exist %_NTPostBld%\ims.cab del %_NTPostBld%\ims.cab /s/q"
  102. call ExecuteCmd.cmd "if exist %_NTPostBld%\ims.cat del %_NTPostBld%\ims.cat /s/q"
  103. )
  104. REM
  105. REM Create the cab files ins.cab and ims.cab for nntpsmtp.
  106. REM
  107. if not exist %_NTPostBld%\staxpt\dump (
  108. call errmsg.cmd "Unable to find directory %_NTPostBld%\staxpt\dump."
  109. goto end
  110. )
  111. pushd %_NTPostBld%\staxpt\dump
  112. if errorlevel 1 goto end
  113. set nonntp=
  114. set noinf=
  115. REM
  116. REM NNTP/SMTP infs are dynamically generated for USA by makecab.cmd,
  117. REM but they're dropped pre-localized for international languages to
  118. REM \\rastaman\fe -p nntpsmtp.
  119. REM
  120. if /i not "%lang%"=="usa" set noinf=/noinf
  121. REM
  122. REM NNTP is only applicable to languages that ship a server product.
  123. REM
  124. set /A found=0
  125. perl %RazzleToolPath%\cksku.pm -t:bla -l:%lang%
  126. if %errorlevel% EQU 0 set /A found=1
  127. perl %RazzleToolPath%\cksku.pm -t:sbs -l:%lang%
  128. if %errorlevel% EQU 0 set /A found=1
  129. perl %RazzleToolPath%\cksku.pm -t:srv -l:%lang%
  130. if %errorlevel% EQU 0 set /A found=1
  131. perl %RazzleToolPath%\cksku.pm -t:ads -l:%lang%
  132. if %errorlevel% EQU 0 set /A found=1
  133. perl %RazzleToolPath%\cksku.pm -t:dtc -l:%lang%
  134. if %errorlevel% EQU 0 set /A found=1
  135. REM
  136. REM Don't build NNTP for XP
  137. REM if %found% EQU 0 set nonntp=/nonntp
  138. set nonntp=/nonntp
  139. REM Makecab.cmd should set errorlevel to a positive value if it fails.
  140. call ExecuteCmd.cmd "call makecab.cmd %nonntp% %noinf%"
  141. if errorlevel 1 goto end
  142. popd
  143. REM
  144. REM Create the catalog files for nntpsmtp
  145. REM
  146. pushd %RazzleToolPath%
  147. if errorlevel 1 (
  148. call errmsg.cmd "createcat.cmd to run from %RazzleToolPath% only."
  149. goto end
  150. )
  151. if not defined nonntp (
  152. call ExecuteCmd.cmd "call createcat.cmd -f %_NTPostBld%\staxpt\dump\nt5ins.lst -c ins -t %_NTPostBld%\staxpt\dump -o %_NTPostBld% -l:%lang%"
  153. )
  154. call ExecuteCmd.cmd "call createcat.cmd -f %_NTPostBld%\staxpt\dump\nt5ims.lst -c ims -t %_NTPostBld%\staxpt\dump -o %_NTPostBld% -l:%lang%"
  155. popd
  156. if not exist %_NTPostBld%\cdf md %_NTPostBld%\cdf
  157. REM Don't check errorlevel since md will return 1 if the directory already exists
  158. if not defined nonntp (
  159. call ExecuteCmd.cmd "move %_NTPostBld%\ins.cdf %_NTPostBld%\cdf\ins.cdf"
  160. )
  161. call ExecuteCmd.cmd "move %_NTPostBld%\ims.cdf %_NTPostBld%\cdf\ims.cdf"
  162. goto end
  163. :end
  164. seterror.exe "%errors%"& goto :EOF