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.

119 lines
3.4 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] [-skip] [-qfe qfe_num] [-plan]
  34. -l Specify the language to package.
  35. -qfe Package a QFE instead of a service pack.
  36. -skip Don't sign the final executable.
  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. 'skip' => \$ENV{_SKIP},
  43. 'qfe:' => \$qfe,
  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. }
  51. # *** NEXT FEW LINES ARE TEMPLATE ***
  52. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  53. __END__
  54. :CPCBegin
  55. set _CPCMAGIC=
  56. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  57. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  58. call logmsg "packaging now "
  59. REM Sign the catalogs.
  60. call ExecuteCmd.cmd "%razzletoolpath%\sp\prs\reqprs.cmd %_QFE% %_PLAN%"
  61. if errorlevel 1 goto :EOF
  62. REM Create the TS Web installation executable.
  63. call ExecuteCmd.cmd "%razzletoolpath%\sp\tswebsetup.cmd %_QFE% %_PLAN%"
  64. if errorlevel 1 goto :EOF
  65. REM Package up the signed catalogs.
  66. call ExecuteCmd.cmd "%razzletoolpath%\sp\spupd.cmd %_QFE% %_PLAN% -prs"
  67. if errorlevel 1 goto :EOF
  68. REM Sign the executable.
  69. if not defined _SKIP (
  70. call ExecuteCmd.cmd "%razzletoolpath%\sp\prs\reqprs.cmd %_QFE% %_PLAN% -x"
  71. if errorlevel 1 goto :EOF
  72. )
  73. if "%_QFE%"=="" (
  74. call ExecuteCmd.cmd "%razzletoolpath%\sp\slipstream.cmd %_QFE% %_PLAN%"
  75. if errorlevel 1 goto :EOF
  76. call ExecuteCmd.cmd "%razzletoolpath%\sp\standalone.cmd %_QFE% %_PLAN%"
  77. if errorlevel 1 goto :EOF
  78. call ExecuteCmd.cmd "%razzletoolpath%\sp\spmakebfloppy.cmd %_QFE% %_PLAN%"
  79. if errorlevel 1 goto :EOF
  80. if /i "%_buildarch%" equ "x86" (
  81. if defined OFFICIAL_BUILD_MACHINE (
  82. call ExecuteCmd.cmd "%razzletoolpath%\sp\makewinpeimg.cmd %_QFE% %_PLAN%"
  83. )
  84. if not defined OFFICIAL_BUILD_MACHINE (
  85. if defined BUILD_NON_PRODUCT_FILES (
  86. call ExecuteCmd.cmd "%razzletoolpath%\sp\makewinpeimg.cmd %_QFE% %_PLAN%"
  87. )
  88. )
  89. if errorlevel 1 goto :EOF
  90. )
  91. if /i "%_buildarch%" equ "x86" (
  92. call ExecuteCmd.cmd "%razzletoolpath%\sp\CD2.cmd %_QFE% %_PLAN%"
  93. if errorlevel 1 goto :EOF
  94. )
  95. )
  96. if "%_PLAN%"=="" (
  97. start /min cmd /c ExecuteCmd.cmd "%razzletoolpath%\sp\release.cmd -l:%lang%"
  98. if errorlevel 1 goto :EOF
  99. )