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.

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