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.

192 lines
4.5 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM makebfloppy.cmd
  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 PbuildEnv;
  18. use ParseArgs;
  19. sub Usage { print<<USAGE; exit(1) }
  20. makebfloppy.cmd
  21. USAGE
  22. parseargs('?' => \&Usage);
  23. # *** NEXT FEW LINES ARE TEMPLATE ***
  24. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  25. __END__
  26. :CPCBegin
  27. set _CPCMAGIC=
  28. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  29. REM
  30. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  31. REM
  32. @echo off
  33. REM
  34. REM Set local variable's state
  35. REM
  36. set BFBUILDERROR=0
  37. set OldCurrentDirectory=%cd%
  38. REM
  39. REM We only create boot floppy images on fre compressed i386 builds.
  40. REM
  41. if /i "%_BuildType%" == "chk" (
  42. goto :bfloppy_done
  43. )
  44. if /i "%BUILD_CHECKED_KERNEL%" == "1" (
  45. goto :bfloppy_done
  46. )
  47. REM
  48. REM Binaries for coverage builds are too big to fit on floppies
  49. REM so don't make them
  50. REM
  51. if defined _COVERAGE_BUILD (
  52. goto :bfloppy_done
  53. )
  54. if not defined 386 (
  55. goto :bfloppy_done
  56. )
  57. set Share=i386
  58. if NOT defined Comp (
  59. set Comp=No
  60. if /i %NUMBER_OF_PROCESSORS% GEQ 4 (
  61. set Comp=Yes
  62. )
  63. if defined OFFICIAL_BUILD_MACHINE (
  64. set Comp=Yes
  65. )
  66. )
  67. if /i not "%Comp%" EQU "Yes" GOTO :bfloppy_done
  68. echo.
  69. echo ---------------------------------------
  70. echo Beginning Boot Floppy image generation
  71. echo ---------------------------------------
  72. echo.
  73. call logmsg.cmd /t "Beginning Boot Floppy image generation"
  74. REM
  75. REM Product List Fields:
  76. REM Display Name,CD Root,Sku,'Ordered links','CD Product membership',CD Tag letter
  77. REM
  78. REM
  79. REM Product List Fields:
  80. REM Display Name,CD Root,Sku,'Ordered links','CD Product membership',CD Tag letter
  81. REM
  82. set NumProds=0
  83. set Products=;
  84. REM Personal
  85. perl %RazzleToolPath%\cksku.pm -t:per -l:%lang% -a:%_BuildArch%
  86. if not errorlevel 1 (
  87. set /a NumProds=!NumProds! + 1
  88. set Products=!Products!;Personal,%_NTPOSTBLD%,per,'perinf','a p wp',c,no
  89. )
  90. REM Professional
  91. perl %RazzleToolPath%\cksku.pm -t:pro -l:%lang% -a:%_BuildArch%
  92. if not errorlevel 1 (
  93. set /a NumProds=!NumProds! + 1
  94. set Products=!Products!;Professional,%_NTPOSTBLD%,pro,'','a w wp xp',p,no
  95. )
  96. REM
  97. REM Create Images.
  98. REM
  99. REM Loop through products
  100. for /l %%a in ( 1,1,%NumProds% ) do (
  101. CALL :GetProductData %%a
  102. cd /d %_NTPostBld%\!OrderedLinks!
  103. mkdir bootfloppy
  104. cd bootfloppy
  105. echo !CDRoot!\!Sku!\!Share!
  106. perl %RazzleToolPath%\postbuildscripts\makeimg.pl !CDRoot!\!Sku!\!Share!
  107. if errorlevel 1 (
  108. call errmsg.cmd "Could not cab boot floppy images."
  109. set BFBUILDERROR=1
  110. )else (
  111. REM
  112. REM Munge the path so we use the correct wextract.exe to build the package with...
  113. REM NOTE: We *want* to use the one we just built (and for Intl localized)!
  114. REM
  115. set _NEW_PATH_TO_PREPEND=!RazzleToolPath!\!PROCESSOR_ARCHITECTURE!\loc\!LANG!
  116. set _OLD_PATH_BEFORE_PREPENDING=!PATH!
  117. set PATH=!_NEW_PATH_TO_PREPEND!;!PATH!
  118. call ExecuteCmd.cmd "start /min /wait iexpress.exe /M /N /Q ..\bfcab.inf"
  119. REM
  120. REM Return the path to what it was before...
  121. REM
  122. set PATH=!_OLD_PATH_BEFORE_PREPENDING!
  123. )
  124. )
  125. goto :bfloppy_done
  126. REM Function: GetProductData
  127. REM
  128. REM accesses the global %Products% variable and
  129. REM sets global values that reflect entry %1
  130. REM in that list (1,2,3,...)
  131. REM
  132. REM Note: have to use a function like this in
  133. REM order to access a random number of
  134. REM entries, even though this is really
  135. REM bad about using and setting globals
  136. REM that are used elsewhere
  137. :GetProductData
  138. set EntryNum=%1
  139. for /f "tokens=%EntryNum% delims=;" %%z in ("%Products%") do (
  140. for /f "tokens=1-7 delims=," %%a in ("%%z") do (
  141. set DisplayName=%%a
  142. set CDRoot=%%b
  143. set Sku=%%c
  144. set OrderedLinks=%%d
  145. set CDProductGroups=%%e
  146. set CDTagLetter=%%f
  147. REM Replace single-quote in list variables with double-quotes
  148. REM so they can be passed into subroutines as a single parameter
  149. set OrderedLinks=!OrderedLinks:'="!
  150. set CDProductGroups=!CDProductGroups:'="!
  151. ))
  152. :bfloppy_done
  153. call logmsg.cmd /t "Done with boot floppy image generation"
  154. echo.
  155. echo ---------------------------------------
  156. echo Done with boot floppy generation
  157. echo ---------------------------------------
  158. echo.
  159. seterror.exe "%BFBUILDERROR%"