Leaked source code of windows server 2003
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.

297 lines
8.8 KiB

  1. @echo off
  2. setlocal ENABLEEXTENSIONS
  3. setlocal ENABLEDELAYEDEXPANSION
  4. REM Check the command line for /? -? or ?
  5. for %%a in (./ .- .) do if ".%1." == "%%a?." goto Usage
  6. if "%1" EQU "" (
  7. echo RELEASE: requires a destination directory of the form 4.18.0
  8. goto Usage
  9. )
  10. set buildnum=%1
  11. set releasetype=daily
  12. set mypath=\\dbg\privates\beta\%buildnum%
  13. set mode=
  14. if not exist %mypath% (
  15. echo RELEASE: ERROR: %mypath% doesn't exist
  16. goto Usage
  17. )
  18. if "%2" EQU "" (
  19. REM running release and indexing
  20. set submit=s
  21. goto startrelease
  22. )
  23. REM
  24. REM Skip the release part.
  25. REM If second parameter is archive then we will do everything for archving the build
  26. REM If second parameter is "index" then we will submit index requests
  27. REM
  28. if /i "%2" EQU "archive" (
  29. REM Archiving
  30. set mode=archive
  31. set submit=a
  32. set releasetype=beta
  33. )
  34. if /i "%2" EQU "index" (
  35. REM Indexing
  36. set mode=index
  37. set submit=s
  38. set releasetype=daily
  39. )
  40. if not defined mode (
  41. echo RELEASE: Second parameter must be either "archive" or "index"
  42. goto Usage
  43. )
  44. if "%3" NEQ "" (
  45. set releasetype=%3
  46. )
  47. echo Release type=%releasetype%
  48. goto startindexing
  49. REM
  50. REM Do the release of the build
  51. REM
  52. :startrelease
  53. rd /s /q \privates\old1
  54. rd /s /q \privates\old2
  55. rd /s /q \privates\old3
  56. REM
  57. REM take down the share
  58. REM
  59. net share privates /d
  60. REM
  61. REM remove all the old shares
  62. REM
  63. cd \privates
  64. ren latest old1
  65. ren oca old2
  66. ren stress old3
  67. REM
  68. REM Recreate the share
  69. REM
  70. net share privates=c:\privates
  71. REM
  72. REM Create our directories
  73. REM
  74. mkdir \privates\latest
  75. mkdir \privates\oca
  76. mkdir \privates\stress\setup
  77. mkdir \privates\stress\uncompressed
  78. REM
  79. REM populate the release share. This contains all the binaries
  80. REM
  81. xcopy /s /d /y \privates\beta\%buildnum% \privates\latest
  82. REM
  83. REM Create the OCA share. This contains only the uncompressed directory.
  84. REM
  85. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\x86\oca \privates\oca
  86. REM
  87. REM Create the stress share. This contains all binaries except the kernel extensions.
  88. REM we do this to save time and space when downloading to the TARGET machine.
  89. REM
  90. copy /y \privates\beta\%buildnum% \privates\stress
  91. xcopy /s /d /y \privates\beta\%buildnum%\setup \privates\stress\setup
  92. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\remote.exe* \privates\stress\uncompressed
  93. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\dbgeng.dll* \privates\stress\uncompressed
  94. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\dbghelp.dll* \privates\stress\uncompressed
  95. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\ntsd.exe* \privates\stress\uncompressed
  96. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\symsrv.dll* \privates\stress\uncompressed
  97. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\decem.dll* \privates\stress\uncompressed
  98. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\ext.dll* \privates\stress\uncompressed
  99. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\exts.dll* \privates\stress\uncompressed
  100. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\uext.dll* \privates\stress\uncompressed
  101. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\lsaexts.dll* \privates\stress\uncompressed
  102. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\rpcexts.dll* \privates\stress\uncompressed
  103. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\shlexts.dll* \privates\stress\uncompressed
  104. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\splexts.dll* \privates\stress\uncompressed
  105. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\vdmexts.dll* \privates\stress\uncompressed
  106. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\certexts.dll* \privates\stress\uncompressed
  107. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\ntsdexts.dll* \privates\stress\uncompressed
  108. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\userexts.dll* \privates\stress\uncompressed
  109. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\w64cpuex.dll* \privates\stress\uncompressed
  110. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\wow64exts.dll* \privates\stress\uncompressed
  111. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\triage.ini* \privates\stress\uncompressed
  112. xcopy /s /d /y \privates\beta\%buildnum%\uncompressed\oca.ini* \privates\stress\uncompressed
  113. rd /s /q \privates\old1
  114. rd /s /q \privates\old2
  115. rd /s /q \privates\old3
  116. :endrelease
  117. REM ***************************
  118. REM
  119. REM Index on \\symbols\symbols or
  120. REM submit archive requests
  121. REM
  122. REM ***************************
  123. :startindexing
  124. if defined archiving (
  125. echo archiving %mypath% ...
  126. ) else (
  127. echo indexing %mypath% ...
  128. )
  129. for %%a in (x86 ia64 amd64) do (
  130. for %%b in ( pri bin ) do (
  131. REM use a different ini file in case of concurrent indexing
  132. set myini=%temp%\archive.%%a.%%b.txt
  133. copy .\dbg.ini !myini! > nul
  134. REM Add fields to the text file in case this is archived
  135. echo Platform=%%a >> !myini!
  136. echo Release=%releasetype% >> !myini!
  137. echo Build=%1 >> !myini!
  138. if /i "%%b" == "pri" (
  139. set mypath2=%mypath%\symbols\%%a
  140. echo SubmitToArchive=pri;pub >> !myini!
  141. echo SubmitToInternet=yes >> !myini!
  142. ) else (
  143. set mypath2=%mypath%\uncompressed\%%a
  144. echo SubmitToArchive=%%b >> !myini!
  145. )
  146. call \\symbols\tools\createrequest.cmd /i !myini! /d %temp% /b %1.%%a.%%b /e %releasetype% /g !mypath2! /r -c -%submit%
  147. del !myini!
  148. del %temp%\dbg_%1.%%a.%%b_%releasetype%.ssi
  149. )
  150. )
  151. :endindexing
  152. REM ***************************
  153. REM
  154. REM Create the redist directory
  155. REM
  156. REM ***************************
  157. :createredist
  158. if not defined archiving goto endcreateredist
  159. if /i "%releasetype%" NEQ "retail" goto endcreateredist
  160. set redist=\\dbg\privates\released\redist\%1
  161. REM Make all the directories
  162. for %%a in (x86 ia64) do (
  163. for %%b in (symbols inc lib) do (
  164. mkdir %redist%\%%a\%%b
  165. )
  166. )
  167. for %%a in (x86 ia64) do (
  168. echo xcopy %mypath%\uncompressed\%%a\redist.txt %redist%\%%a
  169. xcopy %mypath%\uncompressed\%%a\redist.txt %redist%\%%a
  170. echo xcopy %mypath%\sdk\%%a\eula.rtf %redist%\%%a
  171. xcopy %mypath%\sdk\%%a\eula.rtf %redist%\%%a
  172. for %%b in (dbghelp symsrv) do (
  173. echo xcopy %mypath%\uncompressed\%%a\%%b.dll %redist%\%%a
  174. xcopy %mypath%\uncompressed\%%a\%%b.dll %redist%\%%a
  175. echo xcopy %mypath%\symbols\%%a\dll\%%b.pdb %redist%\%%a\symbols
  176. xcopy %mypath%\symbols\%%a\dll\%%b.pdb %redist%\%%a\symbols
  177. )
  178. )
  179. for %%a in (x86 ia64) do (
  180. for %%b in (inc lib) do (
  181. echo xcopy %mypath%\uncompressed\%%a\sdk\inc\dbghelp.h %redist%\%%a\inc
  182. xcopy %mypath%\uncompressed\%%a\sdk\inc\dbghelp.h %redist%\%%a\inc
  183. if "%%a" == "x86" (
  184. echo xcopy %mypath%\uncompressed\%%a\sdk\lib\i386\dbghelp.lib %redist%\%%a\lib
  185. xcopy %mypath%\uncompressed\%%a\sdk\lib\i386\dbghelp.lib %redist%\%%a\lib
  186. ) else (
  187. echo xcopy %mypath%\uncompressed\%%a\sdk\lib\%%a\dbghelp.lib %redist%\%%a\lib
  188. xcopy %mypath%\uncompressed\%%a\sdk\lib\%%a\dbghelp.lib %redist%\%%a\lib
  189. )
  190. )
  191. )
  192. set buildfile="%redist%\Build %1"
  193. echo This build is available at > %buildfile%
  194. echo %mypath% (internal version) >> %buildfile%
  195. echo %mypath%.retail (external version) >> %buildfile%
  196. :endcreateredist
  197. REM **************************************
  198. REM
  199. REM Create the appropriate directory under
  200. REM \\dbg\privates\release
  201. REM
  202. REM **************************************
  203. :copytoreleasedir
  204. if not defined archiving goto endcopytoreleasedir
  205. mkdir \\dbg\privates\released\%releasetype%\%1
  206. echo copying %mypath%\retail \\dbg\privates\released\%releasetype%\%1
  207. xcopy /sec %mypath%\retail \\dbg\privates\released\%releasetype%\%1
  208. :endcopytoreleasedir
  209. :end
  210. endlocal
  211. goto :EOF
  212. :errend
  213. endlocal
  214. goto :EOF
  215. :Usage
  216. echo release ^<BuildNumber^> ^[ archive ^| index ^[ ^<releasetype^> ^] ^]
  217. echo.
  218. echo When you give only one parameter, this will release and index a
  219. echo Debugger build from \\dbg\privates\beta\^<BuildNumber^>.
  220. echo.
  221. echo When you give the "archive" parameter, it will do the following:
  222. echo -- submit an archive request for the build
  223. echo -- if releasetype is "retail", it will create the redist directory
  224. echo on \\dbg\privates\redist
  225. echo -- copy the released bits to \\dbg\privates\released
  226. echo.
  227. echo When you give the "index" parameter, it will create indexing requests only
  228. echo.
  229. echo releasetype -- examples are retail and beta. For archiving the default is beta if
  230. echo releasetype isn't specified. For indexing, the default is "daily".
  231. echo.
  232. goto end