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.

231 lines
6.5 KiB

  1. @echo off
  2. REM ------------------------------------------------------------------
  3. REM
  4. REM setupw95.cmd
  5. REM build hwcomp.dat, a file containing all NT-supported
  6. REM PNP devices used by winnt32a|u.dll and w95upg.dll.
  7. REM Also generate a list of destination directories for
  8. REM setup INF files
  9. REM
  10. REM History:
  11. REM MLekas - created it 1/30/97
  12. REM MLekas - added comments, -c to commandline
  13. REM MLekas - remove -c 3/24/97
  14. REM MLekas - add filegen 4/29/98
  15. REM jimschm - moved hwdatgen to new POSTCOMPRESS option
  16. REM ovidiut - run hwdatgen for server SKUs as well
  17. REM
  18. REM Copyright (c) Microsoft Corporation. All rights reserved.
  19. REM
  20. REM ------------------------------------------------------------------
  21. if defined _CPCMAGIC goto CPCBegin
  22. perl -x "%~f0" %*
  23. goto :EOF
  24. #!perl
  25. use strict;
  26. use lib $ENV{RAZZLETOOLPATH} . "\\PostBuildScripts";
  27. use lib $ENV{RAZZLETOOLPATH};
  28. use PbuildEnv;
  29. use ParseArgs;
  30. sub Usage { print<<USAGE; exit(1) }
  31. setupw95
  32. Win95 project post-build file and PNP ID list generation
  33. Build hwcomp.dat, a file containing all NT-supported
  34. PNP devices used by w95upg.dll. Also generate a list
  35. of destination directories for setup INF files.
  36. USAGE
  37. parseargs('?' => \&Usage);
  38. # *** NEXT FEW LINES ARE TEMPLATE ***
  39. $ENV{"_CPCMAGIC"}++;exit(system($0)>>8);
  40. __END__
  41. :CPCBegin
  42. set _CPCMAGIC=
  43. setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
  44. REM *** BEGIN YOUR CMD SCRIPT BELOW ***
  45. REM cause filelist.dat and hwcomp.dat to get generated on x86 only:
  46. REM Not any more. The file is needed for other platforms as well
  47. REM if not defined x86 goto :EOF
  48. call logmsg.cmd "Beginning Win9x upgrade data generation"
  49. set _PER=1
  50. set _BLA=1
  51. set _SRV=1
  52. set _ENT=1
  53. set _SBS=1
  54. perl %RazzleToolPath%\cksku.pm -t:per -l:%lang% -a:%_BuildArch%
  55. if errorlevel 1 set _PER=
  56. perl %RazzleToolPath%\cksku.pm -t:bla -l:%lang% -a:%_BuildArch%
  57. if errorlevel 1 set _BLA=
  58. perl %RazzleToolPath%\cksku.pm -t:sbs -l:%lang% -a:%_BuildArch%
  59. if errorlevel 1 set _SBS=
  60. perl %RazzleToolPath%\cksku.pm -t:srv -l:%lang% -a:%_BuildArch%
  61. if errorlevel 1 set _SRV=
  62. perl %RazzleToolPath%\cksku.pm -t:ads -l:%lang% -a:%_BuildArch%
  63. if errorlevel 1 set _ENT=
  64. REM Set ProductList to the subdirs of products that support upgrades from Win9x.
  65. set ProductList=pro
  66. if defined _PER set ProductList=%ProductList% per
  67. echo.
  68. echo Beginning Win9x Upgrade data generation
  69. echo ---------------------------------------
  70. REM
  71. REM Build filelist.dat, a list of all the files installed by NT for a specific product
  72. REM
  73. set filegen_counter=0
  74. if not defined x86 goto HWDATGEN
  75. for %%a in (%ProductList%) do (
  76. if /i "%%a" == "pro" (
  77. set infdir=.
  78. ) else (
  79. set infdir=perinf
  80. )
  81. set /a filegen_counter=!filegen_counter!+1
  82. start /min cmd /c wrapper.cmd !filegen_counter! filegen -i:%_NTPostBld%\%%a\i386 -o:%_NTPostBld%\!infdir!\filelist.dat -a:%_NtPostBld%\mstools\filegen.inf -w:%tmp%\filelist.%%a.wrn -b:%_NTPostBld%\congeal_scripts\setupw95.%%a.txt -t:%_NTPostBld%\build_logs\%%a
  83. )
  84. :HWDATGEN
  85. REM
  86. REM Product hwcomp.dat, a database of compatible PNP IDs
  87. REM
  88. set HwDatgenProductList=%ProductList%
  89. if defined _BLA set HwDatgenProductList=%HwDatgenProductList% bla
  90. if defined _SBS set HwDatgenProductList=%HwDatgenProductList% sbs
  91. if defined _SRV set HwDatgenProductList=%HwDatgenProductList% srv
  92. if defined _ENT set HwDatgenProductList=%HwDatgenProductList% ads
  93. if /i "%_BuildArch%" == "x86" (
  94. set bindir=i386
  95. ) else (
  96. set bindir=%_BuildArch%
  97. )
  98. set hwdatgen_counter=0
  99. for %%a in (%HwDatgenProductList%) do (
  100. if /i "%%a" == "pro" (
  101. set infdir=.
  102. ) else if /i "%%a" == "per" (
  103. set infdir=perinf
  104. ) else if /i "%%a" == "bla" (
  105. set infdir=blainf
  106. ) else if /i "%%a" == "sbs" (
  107. set infdir=sbsinf
  108. ) else if /i "%%a" == "srv" (
  109. set infdir=srvinf
  110. ) else if /i "%%a" == "ads" (
  111. set infdir=entinf
  112. )
  113. set /a hwdatgen_counter=!hwdatgen_counter!+1
  114. start /min cmd /c wrapper.cmd !hwdatgen_counter! hwdatgen -i:%_NTPOSTBLD%\%%a\%bindir% -o:%_NTPOSTBLD%\!infdir!\hwcomp.dat
  115. )
  116. REM Wait for all of the processes to complete
  117. set WaitEvents=
  118. for /l %%a in (1,1,%filegen_counter%) do (
  119. set WaitEvents=!WaitEvents! filegen.%%a
  120. )
  121. for /l %%a in (1,1,%hwdatgen_counter%) do (
  122. set WaitEvents=!WaitEvents! hwdatgen.%%a
  123. )
  124. perl %RazzleToolPath%\PostBuildScripts\cmdevt.pl -iwv %WaitEvents%
  125. REM
  126. REM Now copy resulting files into the appropriate locations
  127. REM
  128. if "%filegen_counter%" == "0" goto CopyHWDATGEN
  129. for %%a in (%ProductList%) do (
  130. if /i "%%a" == "pro" (
  131. set infdir=.
  132. ) else (
  133. set infdir=perinf
  134. )
  135. if NOT EXIST %_NTPostBld%\!infdir!\filelist.dat (
  136. call errmsg "failed to generate filelist.dat for %%a"
  137. goto end
  138. )
  139. if exist !_NTPostBld!\comp\!infdir! (
  140. REM put filelist.da_ into comp so that release will copy and link it on the release server
  141. compress -r -zx21 -s %_NTPostBld%\!infdir!\filelist.dat %_NTPostBld%\comp\!infdir!\
  142. REM we also need to copy it into the cd image on the build machine because cdimage has already run
  143. if exist %_NTPostBld%\%%a\i386\filelist.da_ del %_NTPostBld%\%%a\i386\filelist.da_
  144. call ExecuteCmd.cmd "copy %_NTPostBld%\comp\!infdir!\filelist.da_ %_NTPostBld%\%%a\i386"
  145. ) else (
  146. REM we also need to copy it into the cd image on the build machine because cdimage has already run
  147. if exist %_NTPostBld%\%%a\i386\filelist.dat del %_NTPostBld%\%%a\i386\filelist.dat
  148. call ExecuteCmd.cmd "copy %_NTPostBld%\!infdir!\filelist.dat %_NTPostBld%\%%a\i386"
  149. )
  150. )
  151. :CopyHWDATGEN
  152. for %%a in (%HwDatgenProductList%) do (
  153. if /i "%%a" == "pro" (
  154. set infdir=.
  155. ) else if /i "%%a" == "per" (
  156. set infdir=perinf
  157. ) else if /i "%%a" == "bla" (
  158. set infdir=blainf
  159. ) else if /i "%%a" == "sbs" (
  160. set infdir=sbsinf
  161. ) else if /i "%%a" == "srv" (
  162. set infdir=srvinf
  163. ) else if /i "%%a" == "ads" (
  164. set infdir=entinf
  165. )
  166. if NOT EXIST %_NTPostBld%\!infdir!\hwcomp.dat (
  167. set errorlevel=1
  168. goto end
  169. )
  170. REM we also need to copy it into the cd image on the build machine because cdimage has already run
  171. if exist %_NTPostBld%\%%a\%bindir%\hwcomp.dat del %_NTPostBld%\%%a\%bindir%\hwcomp.dat
  172. call ExecuteCmd.cmd "copy %_NTPostBld%\!infdir!\hwcomp.dat %_NTPostBld%\%%a\%bindir%"
  173. REM NOTE: Do not compress -- code does not support hwcomp.da_
  174. )
  175. call logmsg.cmd "Win9x upgrade data generation completed"
  176. goto end
  177. :end
  178. seterror.exe "%errorlevel%"& goto :EOF