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.

138 lines
3.3 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. set UIStress=no
  11. if /i "%~1" == "UISTRESS" (
  12. set UISTRESS=yes
  13. set DestDir=%windir%\system32
  14. ) else (
  15. if /i "%DestDir%" == "" (
  16. set DestDir=c:\Debuggers
  17. )
  18. )
  19. if not exist "%DestDir%" md "%DestDir%"
  20. if not exist "%DestDir%" (
  21. echo DBGINSTALL: ERROR: Cannot create the directory %DestDir%
  22. goto errend
  23. )
  24. )
  25. if /I "%PROCESSOR_ARCHITECTURE%" == "x86" goto x86
  26. if /I "%PROCESSOR_ARCHITECTURE%" == "alpha" goto alpha
  27. if /I "%PROCESSOR_ARCHITECTURE%" == "alpha64" goto alpha64
  28. if /I "%PROCESSOR_ARCHITECTURE%" == "ia64" goto ia64
  29. :alpha64
  30. set MSIName=dbg_axp64.msi
  31. xcopy /S "%SrcDir%\axp64" "%DestDir%"
  32. goto end
  33. :ia64
  34. set SetupName=setup_ia64.exe
  35. set MSIName=dbg_ia64.msi
  36. goto StartInstall
  37. :alpha
  38. set SetupName=setup_x86.exe
  39. set MSIName=dbg_alpha.msi
  40. goto StartInstall
  41. :x86
  42. set SetupName=setup_x86.exe
  43. set MSIName=dbg_x86.msi
  44. goto StartInstall
  45. :StartInstall
  46. if not exist "%SrcDir%%MSIName%" (
  47. echo DBGINSTALL: ERROR: "%SrcDir%%MSIName%" does not exist
  48. goto errend
  49. )
  50. if /i "%UISTRESS%" == "yes" (
  51. REM UI Stress install
  52. REM This only installs the private extensions to an extension
  53. REM subdirectory of %windir%\system32
  54. REM Make sure that ntsd isn't running and using a current userexts.dll
  55. if exist %windir%\system32\winxp.old rd /s /q %windir%\system32\winxp.old >nul
  56. if exist %windir%\system32\winxp rename %windir%\system32\winxp winxp.old >nul
  57. if exist %windir%\system32\winxp rd /s /q %windir%\system32\winxp >nul
  58. if exist %windir%\system32\winxp (
  59. echo DBGINSTALL: ERROR: %windir%\system32\winxp is in use
  60. echo DBGINSTALL: ERROR: debugger install will not succeed
  61. goto errend
  62. )
  63. echo DBGINSTALL: Installing "%SrcDir%%MSIName%" to %windir%\system32
  64. echo DBGINSTALL: for UI Stress - symsrv.dll and extensions only
  65. start /wait "Dbginstall" "%SrcDir%%SetupName%" /z /u /q 1>nul
  66. if not exist %windir%\system32\winxp\userexts.dll (
  67. echo DBGINSTALL: ERROR: There were errors in the debugger install
  68. echo DBGINSTALL: ERROR: See http://dbg/top10.html for help
  69. goto errend
  70. )
  71. ) else (
  72. REM Quiet install for dbg.msi
  73. echo DBGINSTALL: Installing "%SrcDir%%MSIName%" to "%DestDir%"
  74. start /wait "Dbginstall" "%SrcDir%%SetupName%" /z /q /i "%DestDir%"1>nul
  75. if not exist "%DestDir%"\kd.exe (
  76. echo DBGINSTALL: ERROR: There were errors in the debugger install
  77. echo DBGINSTALL: ERROR: See http://dbg/top10.html for help
  78. goto errend
  79. )
  80. )
  81. goto end
  82. :Usage
  83. echo.
  84. echo USAGE: dbginstall [^<InstallDir^> ^| UISTRESS ]
  85. echo.
  86. echo Installs dbg.msi. Default is c:\Debuggers if no install
  87. echo directory is given.
  88. echo.
  89. echo This script will remove previous installs of the
  90. echo Debugging Tools, but will leave the files there.
  91. echo This allows the debuggers to exist in more than one location
  92. echo on a particular machine for testing purposes.
  93. echo.
  94. echo ^<InstallDir^> Install directory
  95. echo.
  96. goto errend
  97. :end
  98. echo DBGINSTALL: Finished -- Debuggers are in "%DestDir%"
  99. endlocal
  100. goto :EOF
  101. :errend
  102. endlocal
  103. goto :EOF