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.

134 lines
2.8 KiB

  1. echo off
  2. rem
  3. rem This is the installation script for the OLE/DB and ADO
  4. rem components reqruired by Active Directory
  5. rem
  6. setlocal
  7. if CMDEXTVERSION 1 goto cmdok
  8. echo.
  9. echo This script requires CMD version 4.0 or better with
  10. echo CMD extensions version 1 enabled.
  11. goto end
  12. :cmdok
  13. echo.
  14. echo ************************************
  15. echo * Copying OLE DB and ADO components
  16. echo ************************************
  17. echo.
  18. set WARNING=
  19. if defined _NTDRIVE goto ntroot
  20. set _NTDRIVE=d:
  21. set WARNING=1
  22. echo.
  23. echo WARNING: _NTDRIVE is not set, using %_NTDRIVE%
  24. :ntroot
  25. if defined _NTROOT goto ntdone
  26. set _NTROOT=\nt
  27. if not defined WARNING echo.
  28. echo WARNING: _NTROOT is not set, using %_NTROOT%
  29. :ntdone
  30. rem set ADS_DIR=%_NTDRIVE%%_NTROOT%\private\oleds
  31. rem set SETUP_ROOT=%ADS_DIR%\setup
  32. rem Identify Platform directory based on PROCESSOR_ARCHITECTURE
  33. rem default is win95
  34. set ISWIN95=
  35. if not "%1" == "" goto paramgiven
  36. goto noparamgiven
  37. :paramgiven
  38. set ISFORCED=1
  39. if /i "%1" == "win95" goto setwin95
  40. if /i "%1" == "i386" goto x86
  41. if /i "%1" == "mips" goto mips
  42. if /i "%1" == "alpha" goto alpha
  43. if /i "%1" == "ppc" goto ppc
  44. :noparamgiven
  45. set ISFORCED=
  46. if /i "%PROCESSOR_ARCHITECTURE%" == "x86" goto x86
  47. if /i "%PROCESSOR_ARCHITECTURE%" == "MIPS" goto mips
  48. if /i "%PROCESSOR_ARCHITECTURE%" == "ALPHA" goto alpha
  49. if /i "%PROCESSOR_ARCHITECTURE%" == "PPC" goto ppc
  50. :setwin95
  51. echo.
  52. echo Ole DB and ADO support is not yet there for Win95 Setup
  53. echo Exiting...
  54. goto end
  55. :x86
  56. set PLATFORM=i386
  57. goto next
  58. :mips
  59. set PLATFORM=mips
  60. goto next
  61. :alpha
  62. set PLATFORM=alpha
  63. goto next
  64. :ppc
  65. set PLATFORM=ppc
  66. goto next
  67. :next
  68. rem
  69. rem make platform-specific setup dir if it does not already exist
  70. rem
  71. if not exist %SETUP_ROOT%\%PLATFORM% md %SETUP_ROOT%\%PLATFORM%
  72. set ERRORCOUNT=0
  73. rem
  74. rem These are the OLE DB and ADO specific DLLs
  75. rem
  76. call :copyoleds oledbsdk\lib\%PLATFORM%\msdatt.dll
  77. call :copyoleds oledbsdk\lib\%PLATFORM%\msdatl.dll
  78. call :copyoleds oledbsdk\lib\%PLATFORM%\msdadc.dll
  79. call :copyoleds oledbsdk\lib\%PLATFORM%\msdaer.dll
  80. call :copyoleds oledbsdk\lib\%PLATFORM%\msdaerr.dll
  81. call :copyoleds oledbsdk\lib\%PLATFORM%\msdaenum.dll
  82. if "%PLATFORM%" == "mips" goto end
  83. call :copyoleds oledbsdk\lib\%PLATFORM%\msado10.dll
  84. call :copyoleds oledbsdk\lib\%PLATFORM%\msader10.dll
  85. goto end
  86. REM
  87. REM Subroutines:
  88. REM
  89. :copyoleds
  90. set SOURCE=%ADS_DIR%\%1
  91. set DEST=%SETUP_ROOT%\%PLATFORM%\.
  92. goto copygeneric
  93. :copysetup
  94. set SOURCE=%SETUP_ROOT%\%1
  95. set DEST=%SETUP_ROOT%\%PLATFORM%\.
  96. goto copygeneric
  97. :copygeneric
  98. copy %SOURCE% %DEST% > NUL
  99. if errorlevel 1 goto copyerror
  100. echo Copied %SOURCE%
  101. echo to %DEST%
  102. goto :EOF
  103. :copyerror
  104. echo ERROR: Cannot copy %SOURCE%
  105. echo to %DEST%
  106. set /A ERRORCOUNT=%ERRORCOUNT%+1
  107. goto :EOF
  108. :copyok
  109. :end
  110. endlocal