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.

429 lines
13 KiB

  1. @echo off
  2. setlocal
  3. if CMDEXTVERSION 1 goto cmdok
  4. echo.
  5. echo This script requires CMD version 4.0 or better with
  6. echo CMD extensions version 1 enabled.
  7. goto end
  8. :cmdok
  9. set ERRORCOUNT=0
  10. REM
  11. REM check parameters
  12. REM
  13. if "%1"=="" goto usage
  14. if "%2"=="" goto usage
  15. set BUILD_NUM=%1
  16. set BUILD_DATE=%2
  17. REM
  18. REM Main hard-coded parameters
  19. REM
  20. set TARGET=\\online1\oleds
  21. set DROP_DIR=%TARGET%\drop25.NT5
  22. set DROP_TARGET=%DROP_DIR%\%BUILD_NUM%
  23. set BUILD_DIR=\\ntbuilds\release\usa\specproj\oleds\%BUILD_DATE%
  24. set BUILD_SHARE=nt40$
  25. set ADS_DIR=\\NTSPECXF\%BUILD_SHARE%\nt\private\oleds
  26. set PUB_INC_DIR=%ADS_DIR%\nt40\public\sdk\inc
  27. set ADS_SPEC=\\popcorn\razzle1\src\spec\nt5\ds\ads20.doc
  28. set ADS_RELNOTES=%ADS_DIR%\setup\relnotes.doc
  29. REM
  30. REM Check that necessary dirs are around
  31. REM
  32. if exist %DROP_TARGET% goto alreadyexists
  33. if not exist %DROP_DIR% goto baddropdir
  34. if not exist %BUILD_DIR% goto badbuilddir
  35. if not exist %ADS_DIR% goto badadsdir
  36. call :do_common
  37. call :do_platform i386 x86 fre
  38. call :do_platform i386 x86 chk
  39. call :do_platform alpha alpha fre
  40. call :do_platform alpha alpha chk
  41. call :do_platform win95 win95 fre
  42. call :do_platform win95 win95 chk
  43. call :do_platform win98 win95 fre
  44. call :do_platform win98 win95 chk
  45. if not "%ERRORCOUNT%" == "0" echo There was/were %ERRORCOUNT% ERROR(S).
  46. goto end
  47. :do_dirs_platform
  48. set BUILD_PICKUP=%BUILD_DIR%\%ARCH%%TYPE%
  49. set SYMBOLS_PICKUP=%BUILD_DIR%\%ARCH%%TYPE%\symbols\dll
  50. set TARGET_DIR_BIN=%DROP_TARGET%\%TYPE%\%PLATFORM%
  51. set TARGET_DIR_SYMBOLS=%DROP_TARGET%\%TYPE%\%PLATFORM%\symbols
  52. call :mkdir %TARGET_DIR_BIN%
  53. call :mkdir %TARGET_DIR_SYMBOLS%
  54. goto :EOF
  55. :do_dirs_common
  56. set TARGET_DIR_SDK=%DROP_TARGET%\sdk
  57. set TARGET_DIR_SDK_INCLUDE=%TARGET_DIR_SDK%\include
  58. set TARGET_DIR_SDK_LIB=%TARGET_DIR_SDK%\lib
  59. set TARGET_DIR_SDK_ODL=%TARGET_DIR_SDK%\odl
  60. set TARGET_DIR_SDK_SPEC=%TARGET_DIR_SDK%\spec
  61. set TARGET_DIR_SDK_SAMPPROV=%TARGET_DIR_SDK%\sampprov
  62. set TARGET_DIR_SDK_SAMPAPP=%TARGET_DIR_SDK%\sampapp
  63. set TARGET_DIR_SDK_SAMPAPP_CXX=%TARGET_DIR_SDK_SAMPAPP%\cxx
  64. set TARGET_DIR_SDK_SAMPAPP_CXX_ADSCMD=%TARGET_DIR_SDK_SAMPAPP_CXX%\adscmd
  65. set TARGET_DIR_SDK_SAMPAPP_CXX_ADSQRY=%TARGET_DIR_SDK_SAMPAPP_CXX%\adsqry
  66. set TARGET_DIR_SDK_SAMPAPP_VB=%TARGET_DIR_SDK_SAMPAPP%\vb
  67. set TARGET_DIR_SDK_SAMPAPP_VB_DSBROWSE=%TARGET_DIR_SDK_SAMPAPP_VB%\dsbrowse
  68. set TARGET_DIR_SDK_SAMPAPP_VB_INCLUDE=%TARGET_DIR_SDK_SAMPAPP_VB%\include
  69. set TARGET_DIR_SDK_SAMPAPP_VJ=%TARGET_DIR_SDK_SAMPAPP%\vj
  70. set TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD=%TARGET_DIR_SDK_SAMPAPP_VJ%\bizcard
  71. set TARGET_DIR_SDK_SAMPAPP_VJ_DSCONN=%TARGET_DIR_SDK_SAMPAPP_VJ%\dsconn
  72. call :mkdir %TARGET_DIR_SDK%
  73. call :mkdir %TARGET_DIR_SDK_INCLUDE%
  74. call :mkdir %TARGET_DIR_SDK_LIB%\i386
  75. call :mkdir %TARGET_DIR_SDK_LIB%\alpha
  76. call :mkdir %TARGET_DIR_SDK_LIB%\win95
  77. call :mkdir %TARGET_DIR_SDK_LIB%\win98
  78. call :mkdir %TARGET_DIR_SDK_ODL%
  79. call :mkdir %TARGET_DIR_SDK_SPEC%
  80. call :mkdir %TARGET_DIR_SDK_SAMPPROV%
  81. call :mkdir %TARGET_DIR_SDK_SAMPPROV%\setup
  82. call :mkdir %TARGET_DIR_SDK_SAMPAPP%
  83. call :mkdir %TARGET_DIR_SDK_SAMPAPP_CXX%
  84. call :mkdir %TARGET_DIR_SDK_SAMPAPP_CXX_ADSCMD%
  85. call :mkdir %TARGET_DIR_SDK_SAMPAPP_CXX_ADSQRY%
  86. call :mkdir %TARGET_DIR_SDK_SAMPAPP_VB%
  87. call :mkdir %TARGET_DIR_SDK_SAMPAPP_VB_DSBROWSE%
  88. call :mkdir %TARGET_DIR_SDK_SAMPAPP_VB_INCLUDE%
  89. call :mkdir %TARGET_DIR_SDK_SAMPAPP_VB_DSBROWSE%\i386
  90. call :mkdir %TARGET_DIR_SDK_SAMPAPP_VJ%
  91. call :mkdir %TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD%
  92. call :mkdir %TARGET_DIR_SDK_SAMPAPP_VJ_DSCONN%
  93. goto :EOF
  94. REM ------------------------
  95. REM
  96. REM Copy Platform-Specific
  97. REM
  98. REM ------------------------
  99. :do_platform
  100. REM
  101. REM %1 is one of: i386 alpha win95 win98
  102. REM %2 is one of: x86 alpha win95
  103. REM %3 is one of: fre chk
  104. set PLATFORM=%1
  105. set ARCH=%2
  106. set TYPE=%3
  107. set BUILD_MACHINE=%ARCH%%TYPE%
  108. echo.
  109. echo Doing %BUILD_MACHINE%...
  110. echo.
  111. if /i "%TYPE%" == "fre" call :do_platformlibs
  112. call :do_dirs_platform
  113. REM
  114. REM copy all the binaries
  115. REM
  116. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\activeds.dll
  117. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\adsnt.dll
  118. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\adsnw.dll
  119. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\adsnds.dll
  120. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\adsldp.dll
  121. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\adsldpc.dll
  122. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\activeds.tlb
  123. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\adsmsext.dll
  124. REM
  125. REM OLE DB/ADO COMPONENTS
  126. REM
  127. REM No longer needed
  128. REM call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msdatt.dll
  129. REM call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msdatl.dll
  130. REM call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msdadc.dll
  131. REM call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msdaer.dll
  132. REM call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msdaerr.dll
  133. REM call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msdaenum.dll
  134. REM call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msado10.dll
  135. REM call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msader10.dll
  136. REM call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msdatl2.dll
  137. REM
  138. REM copy symbols
  139. REM
  140. call :copyto %TARGET_DIR_SYMBOLS%\. %SYMBOLS_PICKUP%\*.dbg
  141. REM
  142. REM Now copy the setup files.
  143. REM
  144. call :copyto %TARGET_DIR_BIN%\. %ADS_DIR%\setup\setup.cmd
  145. if /i "%PLATFORM%" == "win95" call :do_win95_specific
  146. if /i "%PLATFORM%" == "win98" call :do_win98_specific
  147. if /i "%PLATFORM%" == "i386" call :do_winnt_specific
  148. if /i "%PLATFORM%" == "alpha" call :do_winnt_specific
  149. REM
  150. REM copy oledsver.bat
  151. REM
  152. rem FOR INTERNAL USE ONLY:
  153. echo @echo Active Directory Version: %BUILD_NUM%>%TARGET_DIR_BIN%\oledsver.bat
  154. goto :EOF
  155. REM --------------------
  156. REM
  157. REM Copy Platform LIBs
  158. REM
  159. REM --------------------
  160. :do_platformlibs
  161. if /i "%PLATFORM%" == "alpha" goto :alphalibs
  162. set BUILD_LIBS=\\NTSPECXF\%BUILD_SHARE%\nt\public\sdk\lib\i386
  163. set OTHER_LIBS=%ADS_DIR%\nt40\public\sdk\lib\i386
  164. goto :continue
  165. :alphalibs
  166. set BUILD_LIBS=\\ntspecaf\%BUILD_SHARE%\nt\public\sdk\lib\%PLATFORM%
  167. set OTHER_LIBS=%ADS_DIR%\nt40\public\sdk\lib\%PLATFORM%
  168. :continue
  169. REM
  170. REM copy the target SDK lib files
  171. REM
  172. call :copyto %TARGET_DIR_SDK_LIB%\%PLATFORM%\. %BUILD_LIBS%\activeds.lib
  173. call :copyto %TARGET_DIR_SDK_LIB%\%PLATFORM%\. %BUILD_LIBS%\adsiid.lib
  174. call :copyto %TARGET_DIR_SDK_LIB%\%PLATFORM%\. %OTHER_LIBS%\wldap32.lib
  175. call :copyto %TARGET_DIR_SDK_LIB%\%PLATFORM%\. %OTHER_LIBS%\oledb.lib
  176. call :copyto %TARGET_DIR_SDK_LIB%\%PLATFORM%\. %OTHER_LIBS%\oledbd.lib
  177. echo.
  178. goto :EOF
  179. REM -------------------
  180. REM
  181. REM Copy Common Stuff
  182. REM
  183. REM -------------------
  184. :do_common
  185. call :do_dirs_common
  186. echo.
  187. echo Doing common files...
  188. echo.
  189. REM
  190. REM copy release notes
  191. REM
  192. REM call :copyto %TARGET_DIR_SDK%\. %ADS_RELNOTES%
  193. REM
  194. REM copy spec
  195. REM
  196. REM call :copyto %TARGET_DIR_SDK_SPEC%\. %ADS_SPEC%
  197. REM
  198. REM copy SDK include files
  199. REM
  200. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\activeds.h
  201. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\iads.h
  202. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\adshlp.h
  203. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\adsnms.h
  204. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\adsiid.h
  205. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\adssts.h
  206. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\adserr.h
  207. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\adsdb.h
  208. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\winldap.h
  209. REM
  210. REM copy OLEDB public include files
  211. REM
  212. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\oledb.h
  213. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\oledberr.h
  214. call :copyto %TARGET_DIR_SDK_INCLUDE%\. %PUB_INC_DIR%\transact.h
  215. REM
  216. REM copy odl files
  217. REM
  218. call :copyto %TARGET_DIR_SDK_ODL%\. %ADS_DIR%\types\*.odl
  219. call :copyto %TARGET_DIR_SDK_ODL%\. %ADS_DIR%\types\header.h
  220. REM
  221. REM copy sample provider code
  222. REM
  223. call :copyto %TARGET_DIR_SDK_SAMPPROV% %ADS_DIR%\samples\provider\*.cpp
  224. call :copyto %TARGET_DIR_SDK_SAMPPROV% %ADS_DIR%\samples\provider\*.h
  225. call :copyto %TARGET_DIR_SDK_SAMPPROV% %ADS_DIR%\samples\provider\*.def
  226. call :copyto %TARGET_DIR_SDK_SAMPPROV% %ADS_DIR%\samples\provider\adssmp.mak
  227. call :copyto %TARGET_DIR_SDK_SAMPPROV%\setup %ADS_DIR%\samples\provider\setup\*.*
  228. REM
  229. REM copy vb applications
  230. REM
  231. call :copyto %TARGET_DIR_SDK_SAMPAPP_VB_DSBROWSE% %ADS_DIR%\samples\vb\dsbrowse\*
  232. call :copyto %TARGET_DIR_SDK_SAMPAPP_VB_INCLUDE% %ADS_DIR%\samples\vb\include\*
  233. call :copyto %TARGET_DIR_SDK_SAMPAPP_VB_DSBROWSE%\i386 %ADS_DIR%\samples\vb\dsbrowse\i386\*
  234. REM
  235. REM copy vj applications
  236. REM
  237. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD%\BCardQuery.html %ADS_DIR%\samples\vj\bizcard\bizcard.htm
  238. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD%\BCardQuery.mak %ADS_DIR%\samples\vj\bizcard\bizcard.mak
  239. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD%\BCardQuery.java %ADS_DIR%\samples\vj\bizcard\bizcard.jav
  240. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD%\FieldsDialog.java %ADS_DIR%\samples\vj\bizcard\fielddlg.jav
  241. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD%\AdoRecordSet.java %ADS_DIR%\samples\vj\bizcard\adorset.jav
  242. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD%\DialogLayout.java %ADS_DIR%\samples\vj\bizcard\dlglyout.jav
  243. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD%\QueryData.java %ADS_DIR%\samples\vj\bizcard\qdata.jav
  244. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ_BIZCARD% %ADS_DIR%\samples\vj\bizcard\libs\dsconn.dll
  245. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ_DSCONN% %ADS_DIR%\samples\vj\dsconn\*
  246. call :copyto %TARGET_DIR_SDK_SAMPAPP_VJ% %ADS_DIR%\samples\vj\*
  247. REM
  248. REM copy C++ applications
  249. REM
  250. call :copyto %TARGET_DIR_SDK_SAMPAPP_CXX_ADSCMD% %ADS_DIR%\samples\vc\adscmd\*.*xx
  251. call :copyto %TARGET_DIR_SDK_SAMPAPP_CXX_ADSCMD% %ADS_DIR%\samples\vc\adscmd\adscmd.mak
  252. call :copyto %TARGET_DIR_SDK_SAMPAPP_CXX_ADSCMD% %ADS_DIR%\samples\vc\adscmd\readme.txt
  253. call :copyto %TARGET_DIR_SDK_SAMPAPP_CXX_ADSQRY% %ADS_DIR%\samples\vc\adsqry\*.*xx
  254. call :copyto %TARGET_DIR_SDK_SAMPAPP_CXX_ADSQRY% %ADS_DIR%\samples\vc\adsqry\adsqry.mak
  255. call :copyto %TARGET_DIR_SDK_SAMPAPP_CXX_ADSQRY% %ADS_DIR%\samples\vc\adsqry\readme.txt
  256. goto :EOF
  257. :do_win95_specific
  258. call :copyto %TARGET_DIR_BIN%\. %ADS_DIR%\setup\activeds.inf
  259. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\ads95.exe
  260. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\wldap32.dll
  261. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\nwapi32.dll
  262. goto :common_win9598
  263. :do_win98_specific
  264. call :copyto %TARGET_DIR_BIN%\. %ADS_DIR%\setup\ads98.inf
  265. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\ads98.exe
  266. goto :common_win9598
  267. :common_win9598
  268. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\nwapilyr.dll
  269. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\radmin32.dll
  270. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\rlocal32.dll
  271. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\msvcrt.dll
  272. call :copyto %TARGET_DIR_BIN%\. %BUILD_DIR%\x86%TYPE%\devtest\adscmd.exe
  273. call :copyto %TARGET_DIR_BIN%\. %BUILD_DIR%\x86%TYPE%\devtest\adsqry.exe
  274. call :copyto %TARGET_DIR_BIN%\. %BUILD_DIR%\x86%TYPE%\adsvw.exe
  275. goto :EOF
  276. :do_winnt_specific
  277. call :copyto %TARGET_DIR_BIN%\. %ADS_DIR%\setup\activeds.inf
  278. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\ads.exe
  279. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\nwapi32.dll
  280. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\wldap32.dll
  281. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\devtest\adscmd.exe
  282. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\devtest\adsqry.exe
  283. call :copyto %TARGET_DIR_BIN%\. %BUILD_PICKUP%\adsvw.exe
  284. goto :EOF
  285. :copyto
  286. if "%1" == "" goto copyusage
  287. if "%2" == "" goto copyusage
  288. copy %2 %1 > NUL
  289. if errorlevel 1 goto copyerror
  290. echo Copied %2
  291. echo to %1
  292. goto :EOF
  293. :rcopyto
  294. if "%1" == "" goto rcopyusage
  295. if "%2" == "" goto rcopyusage
  296. xcopy /s %2 %1 > NUL
  297. if errorlevel 1 goto copyerror
  298. echo Copied %2
  299. echo to %1
  300. goto :EOF
  301. :copytousage
  302. echo ERROR: usage: call :copyto ^<dest^> ^<source^>
  303. set /A ERRORCOUNT=%ERRORCOUNT%+1
  304. goto :EOF
  305. :copyallusage
  306. echo ERROR: usage: call :rcopyto ^<dest^> ^<source^>
  307. set /A ERRORCOUNT=%ERRORCOUNT%+1
  308. goto :EOF
  309. :copyerror
  310. echo ERROR: Cannot copy %2
  311. echo to %1
  312. set /A ERRORCOUNT=%ERRORCOUNT%+1
  313. goto :EOF
  314. :mkdir
  315. if "%1" == "" goto mkdirusage
  316. if not exist %1 mkdir %1
  317. goto :EOF
  318. :mkdirusage
  319. echo ERROR: usage: call :mkdir ^<dir^>
  320. set /A ERRORCOUNT=%ERRORCOUNT%+1
  321. goto :EOF
  322. :usage
  323. echo usage: %0 ^<Dest_version^> ^<Src_Version^>
  324. goto end
  325. :alreadyexists
  326. echo %DROP_TARGET% already exists.
  327. echo Use a different build number.
  328. goto end
  329. :baddropdir
  330. echo Bad directory: %DROP_DIR%
  331. goto end
  332. :badadsdir
  333. echo Bad directory: %ADS_DIR%
  334. goto end
  335. :badbuilddir
  336. echo Bad directory: %BUILD_DIR%
  337. goto end
  338. :end
  339. endlocal