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.

258 lines
7.9 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM
  5. REM
  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 File::Path;
  18. use File::Copy;
  19. END {
  20. my $temp = $?;
  21. mkpath "$ENV{_NTPOSTBLD}\\build_logs";
  22. if (-e $ENV{LOGFILE}) {
  23. copy($ENV{LOGFILE}, "$ENV{_NTPOSTBLD}\\build_logs\\package.log");
  24. }
  25. if (-e $ENV{ERRFILE}) {
  26. copy($ENV{ERRFILE}, "$ENV{_NTPOSTBLD}\\build_logs\\package.err");
  27. }
  28. $? = $temp;
  29. }
  30. use PbuildEnv;
  31. use ParseArgs;
  32. sub Usage { print<<USAGE; exit(1) }
  33. package.cmd [-l lang] [-prs] [-qfe qfe_num] [-plan]
  34. -l Specify the language to package.
  35. -prs PRS Sign necessary files during packaging.
  36. -qfe Package a QFE instead of a service pack.
  37. -plan Do a dry run to determine dependencies.
  38. Do final preparations and package a service pack or QFE.
  39. USAGE
  40. my ($qfe, $plan, $prs);
  41. parseargs('?' => \&Usage,
  42. 'qfe:' => \$qfe,
  43. 'prs' => \$ENV{_PRS},
  44. 'plan' => \$plan);
  45. $ENV{_QFE} = $qfe ? "-qfe $qfe":"";
  46. $ENV{_PLAN} = $plan ? "-plan":"";
  47. if ($plan) {
  48. system("md $ENV{_NTPOSTBLD}\\..\\build_logs") if !-d "$ENV{_NTPOSTBLD}\\..\\build_logs";
  49. system("del $ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt") if -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt";
  50. } else {
  51. system("del /q $ENV{_NTPOSTBLD}\\build_logs\\CopyWowCanStart.txt >nul 2>nul") if -f "$ENV{_NTPOSTBLD}\\build_logs\\CopyWowCanStart.txt";
  52. }
  53. # *** NEXT FEW LINES ARE TEMPLATE ***
  54. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  55. __END__
  56. :CPCBegin
  57. set _CPCMAGIC=
  58. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  59. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  60. if defined _COVERAGE_BUILD (
  61. call "%COVERAGE_SCRIPTS%\CovSetupBuild.cmd %_QFE% %_PLAN%"
  62. )
  63. call ExecuteCmd.cmd "%razzletoolpath%\sp\loc.cmd %_QFE% %_PLAN%"
  64. REM sysgen still has "ok" errors
  65. REM if errorlevel 1 goto :EOF
  66. call ExecuteCmd.cmd "%razzletoolpath%\sp\winnt32msi.cmd %_QFE% %_PLAN%"
  67. if errorlevel 1 goto :EOF
  68. call ExecuteCmd.cmd "%razzletoolpath%\sp\ntrebase.cmd %_QFE% %_PLAN%"
  69. if errorlevel 1 goto :EOF
  70. call ExecuteCmd.cmd "%razzletoolpath%\sp\bindsys.cmd %_QFE% %_PLAN%"
  71. if errorlevel 1 goto :EOF
  72. call ExecuteCmd.cmd "%razzletoolpath%\sp\crypto.cmd %_QFE% %_PLAN%"
  73. if errorlevel 1 goto :EOF
  74. REM
  75. REM if %BUILD_NON_PRODUCT_PRODUCTS% is set, use '-f' to force DDKSPCabs.bat
  76. REM to run. Otherwise, use no flags which will only generate DDKs if
  77. REM %OFFICIAL_BUILD_MACHINE% is set
  78. REM
  79. IF "%_QFE%"=="" (
  80. IF NOT "%BUILD_NON_PRODUCT_PRODUCTS%"=="" (
  81. call ExecuteCmd.cmd "%razzletoolpath%\sp\ddkspcabs.bat -f %_PLAN%"
  82. ) ELSE (
  83. call ExecuteCmd.cmd "%razzletoolpath%\sp\ddkspcabs.bat %_PLAN%"
  84. )
  85. )
  86. REM No need goto :EOF if DDKSPCabs.bat fails, nothing other
  87. REM than the devkits will be affected
  88. call ExecuteCmd.cmd "%razzletoolpath%\sp\tscert.cmd %_QFE% %_PLAN%"
  89. if errorlevel 1 goto :EOF
  90. call ExecuteCmd.cmd "%razzletoolpath%\sp\tsclient.cmd %_QFE% %_PLAN%"
  91. if errorlevel 1 goto :EOF
  92. call ExecuteCmd.cmd "%razzletoolpath%\sp\tscsetup.cmd %_QFE% %_PLAN%"
  93. if errorlevel 1 goto :EOF
  94. call ExecuteCmd.cmd "%razzletoolpath%\sp\tswebsetup.cmd %_QFE% %_PLAN%"
  95. if errorlevel 1 goto :EOF
  96. if /i "%_buildarch%" equ "x86" (
  97. if not defined BUILD_OFFLINE (
  98. call ExecuteCmd.cmd "%razzletoolpath%\sp\scp_wpafilessp1.cmd %_QFE% %_PLAN%"
  99. if errorlevel 1 goto :EOF
  100. )
  101. )
  102. call ExecuteCmd.cmd "%razzletoolpath%\sp\shimbind.cmd %_QFE% %_PLAN%"
  103. if errorlevel 1 goto :EOF
  104. call ExecuteCmd.cmd "%razzletoolpath%\sp\migwiz.cmd %_QFE% %_PLAN%"
  105. if errorlevel 1 goto :EOF
  106. call ExecuteCmd.cmd "%razzletoolpath%\sp\hnw.cmd %_QFE% %_PLAN%"
  107. if errorlevel 1 goto :EOF
  108. call ExecuteCmd.cmd "%razzletoolpath%\sp\nntpsmtp.cmd %_QFE% %_PLAN%"
  109. if errorlevel 1 goto :EOF
  110. if defined OFFICIAL_BUILD_MACHINE (
  111. call ExecuteCmd.cmd "%razzletoolpath%\sp\deploytools.cmd %_QFE% %_PLAN%"
  112. )
  113. if not defined OFFICIAL_BUILD_MACHINE (
  114. if defined BUILD_NON_PRODUCT_FILES (
  115. call ExecuteCmd.cmd "%razzletoolpath%\sp\deploytools.cmd %_QFE% %_PLAN%"
  116. )
  117. )
  118. if errorlevel 1 goto :EOF
  119. call ExecuteCmd.cmd "%razzletoolpath%\sp\helpsupportservices.cmd %_QFE% %_PLAN%"
  120. if errorlevel 1 goto :EOF
  121. if "%_QFE%"=="" (
  122. call ExecuteCmd.cmd "%razzletoolpath%\sp\spcab.cmd %_QFE% %_PLAN%"
  123. if errorlevel 1 goto :EOF
  124. )
  125. if /i "%_buildarch%" equ "x86" (
  126. call ExecuteCmd.cmd "%razzletoolpath%\sp\mktabcab.cmd %_QFE% %_PLAN%"
  127. if errorlevel 1 goto :EOF
  128. call ExecuteCmd.cmd "%razzletoolpath%\sp\mkmedctr.cmd %_QFE% %_PLAN%"
  129. if errorlevel 1 goto :EOF
  130. )
  131. call ExecuteCmd.cmd "%razzletoolpath%\sp\infsize_wrap.cmd %_QFE% %_PLAN%"
  132. if errorlevel 1 goto :EOF
  133. call ExecuteCmd.cmd "%razzletoolpath%\sp\ocinfwrap.cmd %_QFE% %_PLAN%"
  134. if errorlevel 1 goto :EOF
  135. call ExecuteCmd.cmd "%razzletoolpath%\sp\wmmkdcache.cmd %_QFE% %_PLAN%"
  136. if errorlevel 1 goto :EOF
  137. call ExecuteCmd.cmd "%razzletoolpath%\sp\updatentprintcat.cmd %_QFE% %_PLAN%"
  138. if errorlevel 1 goto :EOF
  139. if /i "%_buildarch%" equ "ia64" (
  140. call ExecuteCmd.cmd "%razzletoolpath%\sp\spcopywow64.cmd %_QFE% %_PLAN%"
  141. if errorlevel 1 goto :EOF
  142. call ExecuteCmd.cmd "%razzletoolpath%\sp\copytsc.cmd %_QFE% %_PLAN%"
  143. if errorlevel 1 goto :EOF
  144. )
  145. call ExecuteCmd.cmd "%razzletoolpath%\sp\makeupdatemap.cmd %_QFE% %_PLAN%"
  146. if errorlevel 1 goto :EOF
  147. call ExecuteCmd.cmd "%razzletoolpath%\sp\inccatsign.cmd %_QFE% %_PLAN%"
  148. if errorlevel 1 goto :EOF
  149. call ExecuteCmd.cmd "%razzletoolpath%\sp\winfusesfcgen.cmd -hashes:yes -cdfs:yes %_QFE% %_PLAN%"
  150. if errorlevel 1 goto :EOF
  151. if "%_QFE%"=="" (
  152. call ExecuteCmd.cmd "%razzletoolpath%\sp\symcd.cmd %_PLAN%"
  153. ) else (
  154. call ExecuteCmd.cmd "%razzletoolpath%\sp\symcd.cmd -m %_QFE% %_PLAN%"
  155. )
  156. call ExecuteCmd.cmd "%razzletoolpath%\sp\CheckTestSig.cmd %_QFE% %_PLAN%"
  157. if errorlevel 1 goto :EOF
  158. if not defined _PRS (
  159. call ExecuteCmd.cmd "%razzletoolpath%\sp\spupd.cmd %_QFE% %_PLAN%"
  160. if errorlevel 1 goto :EOF
  161. ) ELSE (
  162. call ExecuteCmd.cmd "%razzletoolpath%\sp\spupd.cmd %_QFE% %_PLAN% -cat"
  163. if errorlevel 1 goto :EOF
  164. call ExecuteCmd.cmd "%razzletoolpath%\sp\prs\reqprs.cmd %_QFE% %_PLAN%"
  165. if errorlevel 1 goto :EOF
  166. call ExecuteCmd.cmd "%razzletoolpath%\sp\tswebsetup.cmd %_QFE% %_PLAN%"
  167. if errorlevel 1 goto :EOF
  168. call ExecuteCmd.cmd "%razzletoolpath%\sp\spupd.cmd %_QFE% %_PLAN% -prs"
  169. if errorlevel 1 goto :EOF
  170. call ExecuteCmd.cmd "%razzletoolpath%\sp\prs\reqprs.cmd %_QFE% %_PLAN% -x"
  171. if errorlevel 1 goto :EOF
  172. )
  173. if "%_QFE%"=="" (
  174. call ExecuteCmd.cmd "%razzletoolpath%\sp\slipstream.cmd %_QFE% %_PLAN%"
  175. if errorlevel 1 goto :EOF
  176. call ExecuteCmd.cmd "%razzletoolpath%\sp\standalone.cmd %_QFE% %_PLAN%"
  177. if errorlevel 1 goto :EOF
  178. call ExecuteCmd.cmd "%razzletoolpath%\sp\spmakebfloppy.cmd %_QFE% %_PLAN%"
  179. if errorlevel 1 goto :EOF
  180. if /i "%_buildarch%" equ "x86" (
  181. if defined OFFICIAL_BUILD_MACHINE (
  182. call ExecuteCmd.cmd "%razzletoolpath%\sp\makewinpeimg.cmd %_QFE% %_PLAN%"
  183. )
  184. if not defined OFFICIAL_BUILD_MACHINE (
  185. if defined BUILD_NON_PRODUCT_FILES (
  186. call ExecuteCmd.cmd "%razzletoolpath%\sp\makewinpeimg.cmd %_QFE% %_PLAN%"
  187. )
  188. )
  189. REM - Temp workaround for KOR and JPN - we keep getting an error code of 87 when
  190. REM - makewinpeimg actually succeeds. - AEsquiv
  191. REM if errorlevel 1 goto :EOF
  192. )
  193. if /i "%_buildarch%" equ "x86" (
  194. call ExecuteCmd.cmd "%razzletoolpath%\sp\CD2.cmd %_QFE% %_PLAN%"
  195. if errorlevel 1 goto :EOF
  196. )
  197. )
  198. if defined _COVERAGE_BUILD (
  199. call "%COVERAGE_SCRIPTS%\CovSaveFiles.cmd %_QFE% %_PLAN%"
  200. )
  201. if "%_PLAN%"=="" (
  202. start /min cmd /c ExecuteCmd.cmd "%razzletoolpath%\sp\release.cmd -l:%lang% %_QFE%"
  203. if errorlevel 1 goto :EOF
  204. )