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.

86 lines
2.2 KiB

  1. @echo off
  2. if defined _echo echo on
  3. if defined verbose echo on
  4. setlocal ENABLEEXTENSIONS
  5. REM Set Command line arguments
  6. set SrcDir=%~dp0
  7. set DestDir=%~f1
  8. for %%a in (./ .- .) do if ".%~1." == "%%a?." goto Usage
  9. REM Check the command line arguments
  10. if /i "%DestDir%" == "" (
  11. set DestDir=c:\Debuggers
  12. )
  13. REM Don't let this be installed to a system directory
  14. set systemdir=
  15. if /i "%windir%\system32" == "%DestDir%" set systemdir=yes
  16. if /i "%windir%\system32\" == "%DestDir%" set systemdir=yes
  17. if /i "%windir%\syswow64" == "%DestDir%" set systemdir=yes
  18. if /i "%windir%\syswow64\" == "%DestDir%" set systemdir=yes
  19. if defined systemdir (
  20. echo The debuggers cannot be installed to the system directory.
  21. echo Please choose a different directory than %DestDir% and try again.
  22. goto errend
  23. )
  24. if not exist "%DestDir%" md "%DestDir%"
  25. if not exist "%DestDir%" (
  26. echo DBGINSTALL: ERROR: Cannot create the directory %DestDir%
  27. goto errend
  28. )
  29. )
  30. set SetupName=setup_%PROCESSOR_ARCHITECTURE%.exe
  31. set MSIName=dbg_%PROCESSOR_ARCHITECTURE%.msi
  32. if not exist "%SrcDir%%MSIName%" (
  33. echo DBGINSTALL: ERROR: "%SrcDir%%MSIName%" does not exist
  34. goto errend
  35. )
  36. REM Quiet install for dbg.msi
  37. echo DBGINSTALL: Installing "%SrcDir%%MSIName%" to "%DestDir%"
  38. start /wait "Dbginstall" "%SrcDir%%SetupName%" /z /q /i "%DestDir%"1>nul
  39. if not exist "%DestDir%"\kd.exe (
  40. echo DBGINSTALL: ERROR: There were errors in the debugger install
  41. echo DBGINSTALL: ERROR: See http://dbg/top10.html for help
  42. goto errend
  43. )
  44. goto end
  45. :Usage
  46. echo.
  47. echo USAGE: dbginstall [^<InstallDir^>]
  48. echo.
  49. echo Installs dbg.msi. Default is c:\Debuggers if no install
  50. echo directory is given.
  51. echo.
  52. echo This script will remove previous installs of the
  53. echo Debugging Tools, but will leave the files there.
  54. echo This allows the debuggers to exist in more than one location
  55. echo on a particular machine for testing purposes.
  56. echo.
  57. echo ^<InstallDir^> Install directory
  58. echo.
  59. goto errend
  60. :end
  61. echo DBGINSTALL: Finished -- Debuggers are in "%DestDir%"
  62. endlocal
  63. goto :EOF
  64. :errend
  65. endlocal
  66. goto :EOF