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.

193 lines
3.7 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. echo *******************************
  10. echo * Active Directory Build Install Script *
  11. echo *******************************
  12. echo.
  13. echo This script sets up a setup directory for
  14. echo the build for the local platform and
  15. echo installs the build on the local machine.
  16. rem Check that necessary vars are around
  17. set WARNING=
  18. if defined _NTDRIVE goto ntroot
  19. set _NTDRIVE=d:
  20. set WARNING=1
  21. echo.
  22. echo WARNING: _NTDRIVE is not set, using %_NTDRIVE%
  23. :ntroot
  24. if defined _NTROOT goto ntdone
  25. set _NTROOT=\nt
  26. if not defined WARNING echo.
  27. echo WARNING: _NTROOT is not set, using %_NTROOT%
  28. :ntdone
  29. set ADS_DIR=%_NTDRIVE%%_NTROOT%\private\oleds
  30. set SETUP_ROOT=%ADS_DIR%\setup
  31. rem Identify Platform directory based on PROCESSOR_ARCHITECTURE
  32. rem default is win95
  33. set ISWIN95=
  34. if not "%1" == "" goto paramgiven
  35. goto noparamgiven
  36. :paramgiven
  37. set ISFORCED=1
  38. if /i "%1" == "win95" goto setwin95
  39. if /i "%1" == "i386" goto x86
  40. if /i "%1" == "mips" goto mips
  41. if /i "%1" == "alpha" goto alpha
  42. if /i "%1" == "ppc" goto ppc
  43. :noparamgiven
  44. set ISFORCED=
  45. if /i "%PROCESSOR_ARCHITECTURE%" == "x86" goto x86
  46. if /i "%PROCESSOR_ARCHITECTURE%" == "MIPS" goto mips
  47. if /i "%PROCESSOR_ARCHITECTURE%" == "ALPHA" goto alpha
  48. if /i "%PROCESSOR_ARCHITECTURE%" == "PPC" goto ppc
  49. :setwin95
  50. set PLATFORM=win95
  51. set ISWIN95=1
  52. goto next
  53. :x86
  54. set PLATFORM=i386
  55. goto next
  56. :mips
  57. set PLATFORM=mips
  58. goto next
  59. :alpha
  60. set PLATFORM=alpha
  61. goto next
  62. :ppc
  63. set PLATFORM=ppc
  64. goto next
  65. :next
  66. echo.
  67. echo Setup Root is: %SETUP_ROOT%
  68. echo PLATFORM is: %PLATFORM%
  69. echo.
  70. echo If this is incorrect, press
  71. echo CTRL-C/CTRL-Break to abort.
  72. echo Otherwise, just
  73. pause
  74. rem
  75. rem make platform-specific setup dir if it does not already exist
  76. rem
  77. if not exist %SETUP_ROOT%\%PLATFORM% md %SETUP_ROOT%\%PLATFORM%
  78. set ERRORCOUNT=0
  79. echo.
  80. echo *** Copy all the dlls ***
  81. if defined ISWIN95 goto copywin95
  82. call :copylib activeds.dll
  83. call :copylib adsnt.dll
  84. call :copylib adsnw.dll
  85. call :copylib adsnds.dll
  86. call :copylib nwapi32.dll
  87. call :copylib adsldp.dll
  88. call :copylib adsldpc.dll
  89. call :copylib wldap32.dll
  90. goto copytlbs
  91. :copywin95
  92. call :copyads router\win95\obj\i386\activeds.dll
  93. call :copyads winnt\win95\obj\i386\adsnt.dll
  94. :copytlbs
  95. echo.
  96. echo *** Now copy all the tlbs ***
  97. call :copyads types\activeds.tlb
  98. :runinf
  99. echo.
  100. echo *** Now copy install script ***
  101. call :copysetup activeds.inf
  102. call :copysetup adsprb.txt
  103. echo @echo Active Directory Version: ??? > %SETUP_ROOT%\%PLATFORM%\adsver.bat
  104. if defined ISWIN95 goto runinf2
  105. call :copysetup setup.cmd
  106. :runinf2
  107. rem
  108. rem call ole db install routine
  109. rem
  110. call adoinst.cmd
  111. if defined ISFORCED goto end
  112. echo.
  113. echo *** About to initiate INF script ***
  114. if "%ERRORCOUNT%" == "0" goto runinf3
  115. echo There was/were %ERRORCOUNT% ERROR(S).
  116. echo If you wish to abort due to errors,
  117. echo Press CTRL-C/CTRL-Break.
  118. echo Otherwise, just
  119. :runinf3
  120. pause
  121. if defined ISWIN95 goto win95
  122. rundll32.exe advpack.dll,LaunchINFSection %SETUP_ROOT%\%PLATFORM%\activeds.inf, DefaultInstall
  123. goto end
  124. :win95
  125. RunDll setupx.dll,InstallHinfSection Uninstall 132 %SETUP_ROOT%\%PLATFORM%\activeds.inf
  126. goto end
  127. REM
  128. REM Subroutines:
  129. REM
  130. :copylib
  131. set SOURCE=%_NTDRIVE%%_NTROOT%\public\sdk\lib\%PLATFORM%\%1
  132. set DEST=%SETUP_ROOT%\%PLATFORM%\.
  133. goto copygeneric
  134. :copyads
  135. set SOURCE=%ADS_DIR%\%1
  136. set DEST=%SETUP_ROOT%\%PLATFORM%\.
  137. goto copygeneric
  138. :copysetup
  139. set SOURCE=%SETUP_ROOT%\%1
  140. set DEST=%SETUP_ROOT%\%PLATFORM%\.
  141. goto copygeneric
  142. :copygeneric
  143. copy %SOURCE% %DEST% > NUL
  144. if errorlevel 1 goto copyerror
  145. echo Copied %SOURCE%
  146. echo to %DEST%
  147. goto :EOF
  148. :copyerror
  149. echo ERROR: Cannot copy %SOURCE%
  150. echo to %DEST%
  151. set /A ERRORCOUNT=%ERRORCOUNT%+1
  152. goto :EOF
  153. :copyok
  154. :end
  155. endlocal