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.

84 lines
2.9 KiB

  1. @echo off
  2. echo Installing Windows NT SMTPSVC Server Performance Counters ....
  3. if "%1" == "quiet" goto Continue
  4. echo Press any key to continue or CTRL-C to exit.
  5. pause >nul
  6. :Continue
  7. :Evars -------------------------------------------------------------------------
  8. :. Only NT would have this evar set.
  9. if "%PROCESSOR_ARCHITECTURE%" == "" goto ErrProcessor
  10. :Conditions --------------------------------------------------------------------
  11. :. Check if NT is installed properly.
  12. if not exist %SystemRoot%\System32\lodctr.exe goto ErrWinDir
  13. if not exist %SystemRoot%\System32\ntoskrnl.exe goto ErrWinDir
  14. :ChkFiles ----------------------------------------------------------------------
  15. :. Check if the user is in the setup directory.
  16. if not exist smtpictr.bat goto ErrChkFiles
  17. :. Check if all the tools are there.
  18. if not exist smtpctrs.h goto ErrChkFiles
  19. if not exist smtpctrs.ini goto ErrChkFiles
  20. if not exist smtpctrs.reg goto ErrChkFiles
  21. if not exist regini.exe goto ErrChkFiles
  22. :. Check if all deliverables (required files) are there.
  23. if not exist smtpctrs.dll goto ErrChkFiles
  24. :Start Installation ------------------------------------------------------------
  25. :. Install the DLL.
  26. xcopy smtpctrs.dll %SystemRoot%\System32 /d /v
  27. if not exist %SystemRoot%\System32\smtpctrs.dll goto Failure
  28. :. Add the service to the Registry.
  29. regini smtpctrs.reg >nul
  30. if errorlevel 1 goto Failure
  31. lodctr smtpctrs.ini
  32. if errorlevel 1 goto Failure
  33. :Success
  34. echo.
  35. echo Successfully installed Windows NT SMTPSVC Server Performance Counters.
  36. goto CleanUp
  37. :Failure
  38. echo.
  39. echo ERROR: Unable to install the Windows NT SMTPSVC Server Performance Counters.
  40. goto CleanUp
  41. :. Errors ----------------------------------------------------------------------
  42. :ErrChkFiles
  43. echo ERROR: One or more files required by this installation is not found
  44. echo in the current directory.
  45. echo.
  46. echo Be sure that %0 is started from the installation directory.
  47. echo If installing the debug version, go to WINDEBUG;
  48. echo if installing the release version, go to WINREL.
  49. echo If this error still occurs, you may be missing files.
  50. goto CleanUp
  51. :ErrProcessor
  52. echo ERROR: The PROCESSOR_ARCHITECTURE environment variable is not set.
  53. echo Windows NT may not be installed properly.
  54. goto CleanUp
  55. :ErrWinDir
  56. echo ERROR: Unable to find required files in %SystemRoot%\System32.
  57. echo Windows NT may not be installed properly.
  58. goto CleanUp
  59. :ErrSmtpSvc
  60. echo ERROR: Unable to find %SystemRoot%\System32\smtpsvc.dll.
  61. echo The Windows NT SMTPSVC Server may not be installed properly.
  62. goto CleanUp
  63. :CleanUp -----------------------------------------------------------------------
  64. for %%v in (CFGFILE REGFILES) do set %%v=
  65. :End ---------------------------------------------------------------------------