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.

606 lines
20 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM CdImage.cmd
  5. REM Creates cd images for each sku from the binaries tree
  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. CdImage [-d <release|full>] [-c <comp|uncomp>] [-l <language>]
  21. Creates cd images for each sku from the binaries tree.
  22. Default is to get data, perform compression on 4 proc or greater
  23. machines, and make CD image.
  24. -d Release Running on Archive server, compute CD image and make it
  25. but do not perform compression.
  26. -d Full Run as a standalone program. Perform list creation and
  27. compression (if appropriate), and linking from scratch.
  28. -c Comp Force compression regardless of number of procs.
  29. -c Uncomp Force no compression regardless of number of procs.
  30. USAGE
  31. parseargs('?' => \&Usage,
  32. 'd:'=> \$ENV{CLDATA},
  33. 'c:'=> \$ENV{CLCOMP});
  34. # *** NEXT FEW LINES ARE TEMPLATE ***
  35. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  36. __END__
  37. :CPCBegin
  38. set _CPCMAGIC=
  39. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  40. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  41. if defined 386 set Share=i386
  42. if defined amd64 set Share=amd64
  43. if defined ia64 set Share=ia64
  44. set perl=perl
  45. REM Need CompDr to evaluate to something even when not used
  46. set CompDr=%_NTPostBld%\comp
  47. REM Interpret any command-line parameters
  48. set Release=No
  49. set Full=No
  50. if /i "%cldata%" EQU "full" (set Full=Yes)
  51. if /i "%cldata%" EQU "release" (set Release=Yes)
  52. if /i "%clcomp%" EQU "comp" (set Comp=Yes)
  53. if /i "%clcomp%" EQU "uncomp" (set Comp=No)
  54. REM Make uncomp default for now except on 4 proc machines
  55. if NOT defined Comp (
  56. set Comp=No
  57. if /i %NUMBER_OF_PROCESSORS% GEQ 4 (
  58. set Comp=Yes
  59. )
  60. if defined OFFICIAL_BUILD_MACHINE (
  61. set Comp=Yes
  62. )
  63. )
  64. REM
  65. REM Product List Fields:
  66. REM Display Name,CD Root,Sku,'Ordered links','CD Product membership',CD Tag letter, win9x upgrade (yes/no)
  67. REM
  68. set NumProds=0
  69. set Products=;
  70. REM Personal
  71. perl %RazzleToolPath%\cksku.pm -t:per -l:%lang% -a:%_BuildArch%
  72. if not errorlevel 1 (
  73. set /a NumProds=!NumProds! + 1
  74. set Products=!Products!;Personal,%_NTPOSTBLD%,per,'perinf','a p wp',c,yes
  75. )
  76. REM Professional
  77. perl %RazzleToolPath%\cksku.pm -t:pro -l:%lang% -a:%_BuildArch%
  78. if not errorlevel 1 (
  79. set /a NumProds=!NumProds! + 1
  80. set Products=!Products!;Professional,%_NTPOSTBLD%,pro,'','a w wp xp',p,yes
  81. )
  82. REM Web blade
  83. perl %RazzleToolPath%\cksku.pm -t:bla -l:%lang% -a:%_BuildArch%
  84. if not errorlevel 1 (
  85. set /a NumProds=!NumProds! + 1
  86. set Products=!Products!;Blade,%_NTPOSTBLD%,bla,'srvinf blainf','a ss xp sxd',b,no
  87. )
  88. REM Small Business Server
  89. perl %RazzleToolPath%\cksku.pm -t:sbs -l:%lang% -a:%_BuildArch%
  90. if not errorlevel 1 (
  91. set /a NumProds=!NumProds! + 1
  92. set Products=!Products!;sbs,%_NTPOSTBLD%,sbs,'srvinf sbsinf','a ss xp sxd',l,no
  93. )
  94. REM Server
  95. perl %RazzleToolPath%\cksku.pm -t:srv -l:%lang% -a:%_BuildArch%
  96. if not errorlevel 1 (
  97. set /a NumProds=!NumProds! + 1
  98. set Products=!Products!;Server,%_NTPOSTBLD%,srv,'srvinf','a s ss xp sxd',s,no
  99. )
  100. REM Advanced Server
  101. perl %RazzleToolPath%\cksku.pm -t:ads -l:%lang% -a:%_BuildArch%
  102. if not errorlevel 1 (
  103. set /a NumProds=!NumProds! + 1
  104. set Products=!Products!;Advanced,%_NTPOSTBLD%,ads,'srvinf entinf','a as ss xp sxd',a,no
  105. )
  106. REM Datacenter Server
  107. perl %RazzleToolPath%\cksku.pm -t:dtc -l:%lang% -a:%_BuildArch%
  108. if not errorlevel 1 (
  109. set /a NumProds=!NumProds! + 1
  110. set Products=!Products!;Datacenter,%_NTPOSTBLD%,dtc,'srvinf entinf dtcinf','a d ss xp',d,no
  111. )
  112. REM Call GetData to create a new cddata list if appropriate
  113. if /i "%Release%" EQU "Yes" call :GetData
  114. if /i "%Full%" EQU "Yes" call :GetData
  115. REM
  116. REM Now compress if required
  117. REM
  118. if /i not "%Comp%" EQU "Yes" GOTO EndCompLoop
  119. REM Need at least the base directory to exist
  120. if not exist %CompDr% md %CompDr%
  121. REM Loop through products
  122. for /l %%a in ( 1,1,%NumProds% ) do (
  123. REM Want OrderedLinks value for each product
  124. CALL :GetProductData %%a
  125. REM Want to make sure a compressed directory exists for every link
  126. for /f "tokens=*" %%k in (!OrderedLinks!) do for %%j in (%%k) do (
  127. if not exist %CompDr%\%%j md %CompDr%\%%j
  128. )
  129. )
  130. if not exist %CompDr%\lang md %CompDr%\lang
  131. REM BUGBUG?
  132. REM Apparently done if we are releasing
  133. if /i "%Release%" EQU "Yes" goto :EndCompLoop
  134. echo Now compressing ...
  135. call %RazzleToolPath%\PostBuildScripts\startcompress.cmd endcomp -l %lang%
  136. REM Wait on Compression to finish
  137. echo Waiting on compression to finish ...
  138. :CompLoop
  139. sleep 5
  140. If not exist %tmp%\compression\*.tmp goto EndSleepLoop
  141. goto :CompLoop
  142. :EndSleepLoop
  143. :EndCompLoop
  144. REM BUGBUG--JasonS--Force creation of support\tools dir on ia64, since cddirs.lst has it.
  145. if not exist %_NTPostBld%\support\tools md %_NTPostBld%\support\tools
  146. REM BUGBUG--JasonS--Force creation of support\tools dir on ia64, since cddirs.lst has it.
  147. set UseCompressedLinks=yes
  148. if /i "%Release%" EQU "no" if /i "%Comp%" EQU "no" set UseCompressedLinks=no
  149. REM Loop through products
  150. for /l %%a in ( 1,1,%NumProds% ) do (
  151. REM Need to get the following variables set:
  152. REM DisplayName
  153. REM CDRoot
  154. REM Sku
  155. REM OrderedLinks
  156. REM CDProductGroups
  157. REM CDTagLetter
  158. REM Win9xUpgrade
  159. CALL :GetProductData %%a
  160. echo Creating CD image for !DisplayName! ...
  161. if /i "%Full%" EQU "yes" (
  162. echo Deleting !DisplayName! directory ...
  163. rd /s /q !CDRoot!\!Sku!
  164. )
  165. echo Linking base directories ...
  166. if "%UseCompressedLinks%" == "yes" (
  167. CALL :MakeLinksWithCompression !DisplayName! !CDRoot! %CompDr% !Sku! %Share% !OrderedLinks!
  168. ) else (
  169. CALL :MakeLinksWithoutCompression !DisplayName! !CDRoot! !Sku! %Share% !OrderedLinks!
  170. )
  171. echo Linking winnt32 directories ...
  172. CALL :LinkSetupSubdirs !DisplayName! !CDRoot! !Sku! %Share% %UseCompressedLinks% !Win9xUpgrade! !OrderedLinks!
  173. echo Linking other directories ...
  174. CALL :LinkCDSubdirs !DisplayName! !CDRoot! !Sku! %Share% !CDProductGroups!
  175. echo Linking miscellaneous files ...
  176. CALL :CommonMiscellaneousLinks !DisplayName! !CDRoot! !Sku! %Share%
  177. REM Make tag files for CDs
  178. set TagPrefix=i
  179. if /i "%_BuildArch%" EQU "amd64" set TagPrefix=a
  180. if /i "%_BuildArch%" EQU "ia64" set TagPrefix=m
  181. set TagFileName=win51!TagPrefix!!CDTagLetter!
  182. echo Windows > !CDRoot!\!Sku!\win51
  183. echo Windows > !CDRoot!\!Sku!\!TagFileName!
  184. )
  185. perl %RazzleToolPath%\cksku.pm -t:pro -l:%lang% -a:%_BuildArch%
  186. if not errorlevel 1 (
  187. CALL :LinkTabletPC pro cmpnents tabletpc %share% PROCD1 PROCD2
  188. )
  189. REM Done
  190. if defined errors seterror.exe "%errors%"& goto :EOF
  191. GOTO :EOF
  192. REM Function: LinkTabletPC
  193. REM
  194. REM Links all the Tablet PC specific files to PRO\cmpnents\taletpc\i386 directory
  195. REM Links all the files under pro except for the tabletpc dir to %NTPOSTBLD%\PROCD1
  196. REM Links all the tabletpc files under PRO\cmpnents to %NTPOSTBLD%\PROCD1
  197. REM PROCD1 and PROCD2 will be burnlab for burning PRO CDs.
  198. :LinkTabletPC
  199. setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  200. set SKUNAME=%1& shift
  201. set DIRNAME1=%1& shift
  202. set DIRNAME2=%1& shift
  203. set SHARE=%1& shift
  204. set CD1=%1& shift
  205. set CD2=%1& shift
  206. REM Linking the TabletPC Files to the PRO directory
  207. if exist %tmp%\Tabletpc.lst (
  208. if not exist %CDRoot%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share% (
  209. mkdir %CDRoot%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%
  210. )
  211. if "%UseCompressedLinks%" == "yes" (
  212. echo Running compdir /kerlntsd /m:%tmp%\TabletPCComp.lst %CompDr% %CDRoot%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%
  213. call ExecuteCmd.cmd "compdir /kerlntsd /m:%tmp%\TabletPCcomp.lst %CompDr% %CDRoot%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%" >nul
  214. ) else (
  215. echo Running compdir /kerlntsd /m:%tmp%\TabletPC.lst %_NTPostBld% %CDRoot%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%
  216. call ExecuteCmd.cmd "compdir /kerlntsd /m:%tmp%\TabletPC.lst %_NTPostBld% %CDRoot%\%SKUNAME%\%DIRNAME1%\%DIRNAME2%\%share%" >nul
  217. )
  218. echo running compdir /kelntsd %CDRoot%\%SKUNAME%\cmpnents %CDRoot%\%CD2%\cmpnents
  219. call Executecmd.cmd "compdir /kelntsd %CDRoot%\%SKUNAME%\cmpnents %CDRoot%\%CD2%\cmpnents"
  220. dir /a-d /b %CDRoot%\%SKUNAME% >%TMP%\flatFileList.lst
  221. dir /ad /b %CDRoot%\%SKUNAME% |findstr /v cmpnents >%TMP%\dirlist.lst
  222. echo compdir /kerlntsd /m:%TMP%\flatFileList.lst %CDRoot%\%SKUNAME% %CDRoot%\%CD1%
  223. call Executecmd.cmd "compdir /kerlntsd /m:%TMP%\flatFileList.lst %CDRoot%\%SKUNAME% %CDRoot%\%CD1%"
  224. for /F %%a in (%TMP%\dirlist.lst) do (
  225. if not exist %CDRoot%\%CD1%\%%a md %CDRoot%\%CD1%\%%a
  226. echo Running compdir /kelntsd %CDRoot%\%SKUNAME%\%%a %CDRoot%\%CD1%\%%a
  227. call Executecmd.cmd "compdir /kelntsd %CDRoot%\%SKUNAME%\%%a %CDRoot%\%CD1%\%%a"
  228. )
  229. del %TMP%\flatFileList.lst
  230. del %TMP%\DirList.lst
  231. )
  232. GOTO :EOF
  233. REM Function: GetProductData
  234. REM
  235. REM accesses the global %Products% variable and
  236. REM sets global values that reflect entry %1
  237. REM in that list (1,2,3,...)
  238. REM
  239. REM Note: have to use a function like this in
  240. REM order to access a random number of
  241. REM entries, even though this is really
  242. REM bad about using and setting globals
  243. REM that are used elsewhere
  244. :GetProductData
  245. set EntryNum=%1
  246. for /f "tokens=%EntryNum% delims=;" %%z in ("%Products%") do (
  247. for /f "tokens=1-8 delims=," %%a in ("%%z") do (
  248. set DisplayName=%%a
  249. set CDRoot=%%b
  250. set Sku=%%c
  251. set OrderedLinks=%%d
  252. set CDProductGroups=%%e
  253. set CDTagLetter=%%f
  254. set Win9xUpgrade=%%g
  255. REM Replace single-quote in list variables with double-quotes
  256. REM so they can be passed into subroutines as a single parameter
  257. set OrderedLinks=!OrderedLinks:'="!
  258. set CDProductGroups=!CDProductGroups:'="!
  259. ))
  260. if defined errors if 0%errors% NEQ 0 (
  261. endlocal
  262. set errors=1
  263. ) else endlocal
  264. GOTO :EOF
  265. :MakeLinksWithCompression
  266. setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  267. set FullSkuName=%1& shift
  268. set CDRoot=%1&shift
  269. set CompDr=%1& shift
  270. set Sku=%1& shift
  271. set Share=%1& shift
  272. set OrderedLinkSubdirs=%1& shift
  273. REM base compressed files...
  274. echo Running compdir /kerlntsd /m:%tmp%\%Sku%comp.lst %CompDr% %CDRoot%\%Sku%\%Share%
  275. call ExecuteCmd.cmd "compdir /kerlntsd /m:%tmp%\%Sku%comp.lst %CompDr% %CDRoot%\%Sku%\%Share%" >nul
  276. REM base uncompressed files...
  277. echo Running compdir /kerlntsd /m:%tmp%\%Sku%uncomp.lst %_NTPostBld% %CDRoot%\%Sku%\%Share%
  278. call ExecuteCmd.cmd "compdir /kerlntsd /m:%tmp%\%Sku%uncomp.lst %_NTPostBld% %CDRoot%\%Sku%\%Share%" >nul
  279. REM lang compressed files...
  280. echo Running compdir /kelntsd %CompDr%\lang %CDRoot%\%Sku%\%Share%\lang
  281. call ExecuteCmd.cmd "compdir /kelntsd %CompDr%\lang %CDRoot%\%Sku%\%Share%\lang" >nul
  282. for /f "tokens=*" %%z in ( %OrderedLinkSubdirs% ) do for %%a in (%%z) do (
  283. REM ???inf compressed files...
  284. echo Running compdir /deklnruz /m:%tmp%\%Sku%subcomp.lst %CompDr%\%%a %CDRoot%\%Sku%\%Share%
  285. call ExecuteCmd.cmd "compdir /deklnruz /m:%tmp%\%Sku%subcomp.lst %CompDr%\%%a %CDRoot%\%Sku%\%Share%" >nul
  286. REM ???inf uncompressed files...
  287. echo Running compdir /deklnruz /m:%tmp%\%Sku%subuncomp.lst %_NTPostBld%\%%a %CDRoot%\%Sku%\%Share%
  288. call ExecuteCmd.cmd "compdir /deklnruz /m:%tmp%\%Sku%subuncomp.lst %_NTPostBld%\%%a %CDRoot%\%Sku%\%Share%" >nul
  289. )
  290. if defined errors if 0%errors% NEQ 0 (
  291. endlocal
  292. set errors=1
  293. ) else endlocal
  294. GOTO :EOF
  295. :MakeLinksWithoutCompression
  296. setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  297. set FullSkuName=%1& shift
  298. set CDRoot=%1& shift
  299. set Sku=%1& shift
  300. set Share=%1& shift
  301. set OrderedLinkSubdirs=%1& shift
  302. REM base files...
  303. echo Running compdir /kerlntsd /m:%tmp%\%Sku%.lst %_NTPostBld% %CDRoot%\%Sku%\%Share%
  304. call ExecuteCmd.cmd "compdir /kerlntsd /m:%tmp%\%Sku%.lst %_NTPostBld% %CDRoot%\%Sku%\%Share%" >nul
  305. REM lang files...
  306. echo Running compdir /kelntsd %_NTPostBld%\lang %CDRoot%\%Sku%\%Share%\lang
  307. call ExecuteCmd.cmd "compdir /kelntsd %_NTPostBld%\lang %CDRoot%\%Sku%\%Share%\lang" >nul
  308. for /f "tokens=*" %%z in ( %OrderedLinkSubdirs% ) do for %%a in (%%z) do (
  309. REM ???inf files...
  310. echo Running compdir /deklnruz /m:%tmp%\%Sku%sub.lst %_NTPostBld%\%%a %CDRoot%\%Sku%\%Share%
  311. call ExecuteCmd.cmd "compdir /deklnruz /m:%tmp%\%Sku%sub.lst %_NTPostBld%\%%a %CDRoot%\%Sku%\%Share%" >nul
  312. )
  313. if defined errors if 0%errors% NEQ 0 (
  314. endlocal
  315. set errors=1
  316. ) else endlocal
  317. GOTO :EOF
  318. :LinkSetupSubdirs
  319. setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  320. set FullSkuName=%1& shift
  321. set CDRoot=%1& shift
  322. set Sku=%1& shift
  323. set Share=%1& shift
  324. set Comp=%1& shift
  325. set Win9xUpgrade=%1& shift
  326. set OrderedLinkSubDirs=%1& shift
  327. set SetupSubDirs=winnt32\compdata
  328. REM Add Win9x upgrade directory on X86 architectures if supported by the sku
  329. if defined 386 if /I "%Win9xupgrade%" == "yes" set SetupSubDirs=%SetupSubDirs% winnt32\win9xupg
  330. set RecursiveSetupSubDirs=winnt32\winntupg
  331. REM Setup subdirs get linked under the flat CD dirs on compressed
  332. REM and underneath a winnt32 subdirectory on uncompressed
  333. if /i "%Comp%" EQU "no" (
  334. set StartingDestDir=%CDRoot%\%Sku%\%Share%\winnt32
  335. ) else (
  336. set StartingDestDir=%CDRoot%\%Sku%\%Share%
  337. )
  338. REM Link dr watson files required for winnt32.
  339. call ExecuteCmd.cmd "perl %RazzleToolPath%\postbuildscripts\Copydw.pl %_NTPostBld% %CDRoot%\%Sku%\%Share% %StartingDestDir%"
  340. REM Now link all of the winnt32 directories, starting with
  341. REM the ones in the flat binaries share and then the
  342. REM ones in the SKU specific directories
  343. for /f "tokens=*" %%z in ( %OrderedLinkSubdirs% ) do set LinkDirs=%%z
  344. set LinkDirs=. %LinkDirs%
  345. for %%a in (%LinkDirs%) do (
  346. REM Start with base winnt32 directory
  347. echo Running compdir /deklnruz %_NTPostBld%\%%a\winnt32 %StartingDestDir%
  348. call ExecuteCmd.cmd "compdir /deklnruz %_NTPostBld%\%%a\winnt32 %StartingDestDir%"
  349. for %%b in (%RecursiveSetupSubDirs%) do (
  350. REM Only want to concatenate the last part
  351. REM of the path for the destination
  352. set DestDir=%StartingDestDir%\%%~nxb
  353. if exist %_NTPostBld%\%%a\%%b (
  354. echo Running compdir /deklnuz %_NTPostBld%\%%a\%%b !DestDir!
  355. call ExecuteCmd.cmd "compdir /deklnuz %_NTPostBld%\%%a\%%b !DestDir!" >nul
  356. )
  357. )
  358. for %%b in (%SetupSubDirs%) do (
  359. REM Only want to concatenate the last part
  360. REM of the path for the destination
  361. set DestDir=%StartingDestDir%\%%~nxb
  362. if exist %_NTPostBld%\%%a\%%b (
  363. echo Running compdir /deklnruz %_NTPostBld%\%%a\%%b !DestDir!
  364. call ExecuteCmd.cmd "compdir /deklnruz %_NTPostBld%\%%a\%%b !DestDir!" >nul
  365. )
  366. )
  367. )
  368. if defined errors if 0%errors% NEQ 0 (
  369. endlocal
  370. set errors=1
  371. ) else endlocal
  372. GOTO :EOF
  373. :LinkCDSubDirs
  374. setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  375. set FullSkuName=%1& shift
  376. set CDRoot=%1& shift
  377. set Sku=%1& shift
  378. set Share=%1& shift
  379. set ValidForProduct=%1& shift
  380. for /f "tokens=1-7" %%a in (%RazzleToolPath%\postbuildscripts\CDDirs.lst) do (
  381. REM Fields retrieved from file
  382. set BinSubDir=%%a
  383. set RootCDDir=%%b
  384. set CDSubDir=%%c
  385. REM 4th entry ignored %%d
  386. set ProductInfo=%%e
  387. set Recursion=%%f
  388. set Archs=%%g
  389. REM According to our architecture, are we interested?
  390. set ValidForArchitecture=0
  391. if /i "!Archs!" EQU "a" (
  392. set ValidForArchitecture=1
  393. ) else if /i "%_BuildArch%" EQU "x86" (
  394. if /i "!Archs!" EQU "x" set ValidForArchitecture=1
  395. ) else if /i "%_BuildArch%" EQU "amd64" (
  396. if /i "!Archs!" EQU "d" set ValidForArchitecture=1
  397. ) else if /i "%_BuildArch%" EQU "ia64" (
  398. if /i "!Archs!" EQU "i" set ValidForArchitecture=1
  399. )
  400. REM Only continue if valid
  401. if !ValidForArchitecture! EQU 1 (
  402. REM According to our product type, are we interested?
  403. set ValidForSku=0
  404. for /f "tokens=*" %%z in (%ValidForProduct%) do for %%a in (%%z) do (
  405. if /i "%%a" EQU "!ProductInfo!" set ValidForSku=1
  406. )
  407. REM Only continue if valid
  408. if !ValidForSku! EQU 1 (
  409. REM Linked under root or product on the CD?
  410. if not "!RootCDDir!" EQU "p" (
  411. if not "!RootCDDir!" EQU "r" (
  412. call errmsg.cmd "Unknown value in second column of %RazzleToolPath%\postbuildscripts\CDDirs.lst (!RootCDDir!)"
  413. GOTO :EOF
  414. ) else (
  415. set CDDest=!CDSubDir!
  416. )
  417. ) else (
  418. set CDDest=%Share%\!CDSubDir!
  419. )
  420. REM Default compdir switches
  421. set CompdirSwitches=/deklnuz
  422. REM Set no-recursion flag for compdir if necessary
  423. if /i NOT "!Recursion!" EQU "y" set CompdirSwitches=!CompdirSwitches!r
  424. echo Running compdir !CompdirSwitches! %_NTPostBld%\!BinSubDir! %CDRoot%\%Sku%\!CDDest!
  425. call ExecuteCmd.cmd "compdir !CompdirSwitches! %_NTPostBld%\!BinSubDir! %CDRoot%\%Sku%\!CDDest!" >nul
  426. REM These parens end the architecture check
  427. REM and the valid product check -- could
  428. REM heavily indent all of the above or
  429. REM just make this nice comment
  430. ))
  431. )
  432. if defined errors if 0%errors% NEQ 0 (
  433. endlocal
  434. set errors=1
  435. ) else endlocal
  436. GOTO :EOF
  437. :CommonMiscellaneousLinks
  438. setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  439. set FullSkuName=%1& shift
  440. set CDRoot=%1& shift
  441. set Sku=%1& shift
  442. set Share=%1& shift
  443. REM Link WOW64 stuff
  444. if not defined 386 (
  445. echo Linking wow bins for %FullSkuName% ...
  446. echo Running compdir /kelntsd %_NTPostBld%\wowbins %CDRoot%\%Sku%\i386
  447. call ExecuteCmd.cmd "compdir /kelntsd %_NTPostBld%\wowbins %CDRoot%\%Sku%\i386" >nul
  448. )
  449. REM WARNING: hard-coded special case for PRO and ADS
  450. if /i "%Sku%" EQU "pro" (
  451. call ExecuteCmd.cmd "copy %_NTPostBld%\autorun.exe %CDRoot%\pro\setup.exe"
  452. call ExecuteCmd.cmd "copy %_NTPostBld%\ntautorun.inf %CDRoot%\pro\autorun.inf"
  453. ) else if /i "%Sku%" EQU "ads" (
  454. call ExecuteCmd.cmd "copy %_NTPostBld%\entinf\autorun.exe %CDRoot%\ads\setup.exe"
  455. call ExecuteCmd.cmd "copy %_NTPostBld%\entinf\ntautorun.inf %CDRoot%\ads\autorun.inf"
  456. ) else (
  457. call ExecuteCmd.cmd "copy %_NTPostBld%\%Sku%inf\autorun.exe %CDRoot%\%Sku%\setup.exe"
  458. call ExecuteCmd.cmd "copy %_NTPostBld%\%Sku%inf\ntautorun.inf %CDRoot%\%Sku%\autorun.inf"
  459. )
  460. REM system32 subdirectory...
  461. if not exist %CDRoot%\%Sku%\%Share%\system32 (
  462. call ExecuteCmd.cmd "md %CDRoot%\%Sku%\%Share%\system32"
  463. )
  464. call ExecuteCmd.cmd "copy %_NTPostBld%\usetup.exe %CDRoot%\%Sku%\%Share%\system32\smss.exe"
  465. call ExecuteCmd.cmd "copy %_NTPostBld%\ntdll.dll %CDRoot%\%Sku%\%Share%\system32\ntdll.dll"
  466. REM Bootfont.bin
  467. if exist %CDRoot%\%Sku%\%Share%\bootfont.bin call ExecuteCmd.cmd "copy %CDRoot%\%Sku%\%Share%\bootfont.bin %CDRoot%\%Sku%"
  468. if defined errors if 0%errors% NEQ 0 (
  469. endlocal
  470. set errors=1
  471. ) else endlocal
  472. GOTO :EOF
  473. REM
  474. REM Funcion: GetData
  475. REM Clears current lists, then calls CDData.cmd
  476. REM
  477. :GetData
  478. setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  479. REM Call CDdata.cmd - pushd to make logmsg output fit on one line
  480. pushd %RazzleToolPath%\postbuildscripts
  481. set DelFileList=%_NTPostBld%\build_logs\bindiff.txt
  482. set DelFileList=!DelFileList! %_NTPostBld%\build_logs\cddata.txt
  483. set DelFileList=!DelFileList! %_NTPostBld%\build_logs\cddata.txt.full
  484. set DelFileList=!DelFileList!
  485. for %%a in (!DelFileList!) do (
  486. if exist %%a (
  487. call logmsg.cmd "Deleting %%a ..."
  488. del /f /q %%a
  489. )
  490. )
  491. call CDdata.cmd -f -d -l %lang%
  492. popd
  493. if defined errors if 0%errors% NEQ 0 (
  494. endlocal
  495. set errors=1
  496. ) else endlocal
  497. GOTO :EOF