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.

225 lines
7.1 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM slipstream.cmd
  5. REM make slipstream cd images for the sp
  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. slipstream [-l <language>] [-init]
  22. Creates slipstream cd images from gold media. You must have a local copy
  23. of the gold media (per and pro) in
  24. \%_NTDRIVE\%\\gold\\\%LANG\%\\\%_BUILDARCH\%\%_BUILDTYPE\%
  25. The -init option will attempt to create a local copy of the gold media
  26. for you.
  27. USAGE
  28. sub Dependencies {
  29. if ( !open DEPEND, ">>$ENV{_NTPOSTBLD}\\..\\build_logs\\dependencies.txt" ) {
  30. errmsg("Unable to open dependency list file.");
  31. die;
  32. }
  33. print DEPEND<<DEPENDENCIES;
  34. \[$0\]
  35. IF {...} ADD {
  36. no_tbomb.hiv
  37. idw\\setup\\tbomb120.hiv
  38. idw\\setup\\tbomb180.hiv
  39. congeal_scripts\\__qfenum__
  40. }
  41. DEPENDENCIES
  42. close DEPEND;
  43. exit;
  44. }
  45. my $qfe;
  46. parseargs('?' => \&Usage,
  47. 'plan' => \&Dependencies,
  48. 'qfe:' => \$qfe,
  49. 'init' => \$ENV{INIT});
  50. if ( !$ENV{INIT} and -f "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  51. if ( !open SKIP, "$ENV{_NTPOSTBLD}\\..\\build_logs\\skip.txt" ) {
  52. errmsg("Unable to open skip list file.");
  53. die;
  54. }
  55. while (<SKIP>) {
  56. chomp;
  57. exit if lc$_ eq lc$0;
  58. }
  59. close SKIP;
  60. }
  61. # *** NEXT FEW LINES ARE TEMPLATE ***
  62. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  63. __END__
  64. :CPCBegin
  65. set _CPCMAGIC=
  66. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  67. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  68. if /i "%_BuildArch%" EQU "x86" (
  69. set share=i386
  70. ) else (
  71. set share=ia64
  72. )
  73. set CommandLine=perl %RazzleToolPath%\sp\CmdIniSetting.pl -l:%LANG% -f:DfsRootName
  74. %CommandLine% >nul 2>nul
  75. if ERRORLEVEL 0 (
  76. for /f %%a in ('%CommandLine%') do (
  77. set DFSROOT=%%a
  78. )
  79. )
  80. set PLATFORM=%_BUILDARCH%%_BUILDTYPE%
  81. set GOLD=%DFSROOT%\main\%LANG%\2600\%PLATFORM%
  82. if defined _COVERAGE_BUILD set GOLD=\\coverbuilds\release\2600.x86fre
  83. set LOCALGOLD=%_ntdrive%\gold\%LANG%\%PLATFORM%
  84. set CommandLine=perl %RazzleToolPath%\sp\CmdIniSetting.pl -l:%LANG% -f:GoldFiles::%computername%
  85. %CommandLine% >nul 2>nul
  86. if ERRORLEVEL 0 (
  87. for /f %%a in ('%CommandLine%') do (
  88. set LOCALGOLD=%%a\%LANG%\%PLATFORM%
  89. )
  90. )
  91. if defined INIT (
  92. call logmsg.cmd "copying gold files locally"
  93. call ExecuteCmd.cmd "compdir /enust %GOLD%\pro %LOCALGOLD%\pro"
  94. call ExecuteCmd.cmd "copy %GOLD%\bin\idw\setup\no_tbomb.hiv %LOCALGOLD%\pro\%share%\setupreg.hiv"
  95. if /i "%_BuildArch%" EQU "x86" (
  96. call ExecuteCmd.cmd "compdir /enust %GOLD%\per %LOCALGOLD%\per"
  97. call ExecuteCmd.cmd "copy %GOLD%\bin\perinf\idw\setup\no_tbomb.hiv %LOCALGOLD%\per\%share%\setupreg.hiv"
  98. )
  99. goto :EOF
  100. )
  101. if not exist %LOCALGOLD% (
  102. call logmsg.cmd "slipstream gold files not present in %LOCALGOLD%"
  103. goto :EOF
  104. )
  105. call logmsg.cmd "creating slipstream from gold files in %LOCALGOLD%"
  106. call ExecuteCmd.cmd "compdir /enust %LOCALGOLD%\pro %_NTPOSTBLD%\slp\pro"
  107. if /i "%_BuildArch%" EQU "x86" (
  108. call ExecuteCmd.cmd "compdir /enust %LOCALGOLD%\per %_NTPOSTBLD%\slp\per"
  109. )
  110. if /i "%_BuildArch%" EQU "ia64" (
  111. if /i "%HOST_PROCESSOR_ARCHITECTURE%" EQU "x86" (
  112. rem Copying the 32 bit update.exe from the build Machine rather than the unreliable DFS link
  113. call :CopyFile
  114. )
  115. )
  116. call ExecuteCmd.cmd "%_NTPOSTBLD%\upd\%share%\update\update.exe -q -s:%_NTPOSTBLD%\slp\pro"
  117. if /i "%_BuildArch%" EQU "x86" (
  118. call ExecuteCmd.cmd "%_NTPOSTBLD%\upd\%share%\update\update.exe -q -s:%_NTPOSTBLD%\slp\per"
  119. )
  120. if exist %_NTPOSTBLD%\netfx (
  121. call ExecuteCmd.cmd "xcopy /ydei %_NTPOSTBLD%\netfx %_NTPOSTBLD%\slp\pro\dotnetfx"
  122. if /i "%_BuildArch%" EQU "x86" (
  123. call ExecuteCmd.cmd "xcopy /ydei %_NTPOSTBLD%\netfx %_NTPOSTBLD%\slp\per\dotnetfx"
  124. )
  125. )
  126. REM update support and valueadd
  127. if exist %_NTPOSTBLD%\support (
  128. call ExecuteCmd.cmd "compdir /enustd %_NTPOSTBLD%\support %_NTPOSTBLD%\slp\pro\support"
  129. if /i "%_BuildArch%" EQU "x86" (
  130. call ExecuteCmd.cmd "compdir /enustd %_NTPOSTBLD%\support %_NTPOSTBLD%\slp\per\support"
  131. )
  132. )
  133. if exist %_NTPOSTBLD%\valueadd (
  134. call ExecuteCmd.cmd "compdir /enustd %_NTPOSTBLD%\valueadd %_NTPOSTBLD%\slp\pro\valueadd"
  135. if /i "%_BuildArch%" EQU "x86" (
  136. call ExecuteCmd.cmd "compdir /enustd %_NTPOSTBLD%\valueadd %_NTPOSTBLD%\slp\per\valueadd"
  137. )
  138. )
  139. REM BUG 559848 remove mstsc_hpc from slipstream
  140. if exist %_NTPOSTBLD%\slp\pro\valueadd\msft\mgmt\mstsc_hpc (
  141. call ExecuteCmd.cmd "rd /s/q %_NTPOSTBLD%\slp\pro\valueadd\msft\mgmt\mstsc_hpc"
  142. )
  143. if exist %_NTPOSTBLD%\slp\per\valueadd\msft\mgmt\mstsc_hpc (
  144. call ExecuteCmd.cmd "rd /s/q %_NTPOSTBLD%\slp\per\valueadd\msft\mgmt\mstsc_hpc"
  145. )
  146. REM timebomb the build
  147. if /i "%_BuildArch%" EQU "x86" (
  148. if not exist %_NTPOSTBLD%\idw\setup\no_tbomb.hiv (
  149. call ExecuteCmd.cmd "copy %_NTPOSTBLD%\slp\pro\%share%\setupreg.hiv %_NTPOSTBLD%\idw\setup\no_tbomb.hiv"
  150. if errorlevel 1 goto :EOF
  151. )
  152. if not exist %_NTPOSTBLD%\perinf\idw\setup\no_tbomb.hiv (
  153. call ExecuteCmd.cmd "copy %_NTPOSTBLD%\slp\per\%share%\setupreg.hiv %_NTPOSTBLD%\perinf\idw\setup\no_tbomb.hiv"
  154. if errorlevel 1 goto :EOF
  155. )
  156. call ExecuteCmd.cmd "copy %_NTPOSTBLD%\idw\setup\tbomb180.hiv %_NTPOSTBLD%\slp\pro\%share%\setupreg.hiv"
  157. call ExecuteCmd.cmd "copy %_NTPOSTBLD%\perinf\idw\setup\tbomb180.hiv %_NTPOSTBLD%\slp\per\%share%\setupreg.hiv"
  158. ) else (
  159. if not exist %_NTPOSTBLD%\idw\setup\no_tbomb.hiv (
  160. call ExecuteCmd.cmd "copy %_NTPOSTBLD%\slp\pro\%share%\setupreg.hiv %_NTPOSTBLD%\idw\setup\no_tbomb.hiv"
  161. if errorlevel 1 goto :EOF
  162. )
  163. call ExecuteCmd.cmd "copy %_NTPOSTBLD%\idw\setup\tbomb180.hiv %_NTPOSTBLD%\slp\pro\%share%\setupreg.hiv"
  164. call ExecuteCmd.cmd "copy %_NTPOSTBLD%\slp\pro\win51mp %_NTPOSTBLD%\slp\pro\win51mp.sp1"
  165. )
  166. goto :EOF
  167. REM Functions
  168. :CopyFile
  169. if defined BUILD_OFFLINE (
  170. if defined _NTSlipstreamX86BinsTree (
  171. copy %_NTSlipstreamX86BinsTree%\idw\srvpack\update.exe %_NTPOSTBLD%\upd\%share%\update\update.exe
  172. ) else (
  173. copy %FilterDir%.x86fre\idw\srvpack\update.exe %_NTPOSTBLD%\upd\%share%\update\update.exe
  174. )
  175. ) else (
  176. for /f "tokens=1,2 delims==" %%a in (%RazzleToolPath%\sp\xpsp1.ini) do (
  177. if /i "%%a" == "BuildMachine::x86::%_BuildType%::%lang%" (
  178. set BuildMachine=%%b
  179. )
  180. )
  181. for /f "tokens=1,2 delims==" %%a in (%_ntpostbld%\congeal_scripts\__qfenum__) do (
  182. if "%%a" == "QFEBUILDNUMBER" (
  183. set BuildNumber=%%b
  184. )
  185. )
  186. copy \\%BuildMachine%\release\%BuildNumber%\%lang%\x86fre\bin\idw\srvpack\update.exe %_NTPOSTBLD%\upd\%share%\update\update.exe
  187. REM In case we fail to copy from the build machine due to any reason copy from the DFS link.Dont error out
  188. if ERRORLEVEL 1 echo copying file from DFS link \\ntdev\release\xpsp1\latest.tst\usa\x86fre\bin\idw\srvpack\update.exe & copy \\ntdev\release\xpsp1\latest.tst\usa\x86fre\bin\idw\srvpack\update.exe %_NTPOSTBLD%\upd\%share%\update\update.exe
  189. )
  190. goto :EOF