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.

119 lines
3.3 KiB

  1. @echo off
  2. if /i NOT "%_echo%" == "" echo on
  3. if /i NOT "%verbose%" == "" echo on
  4. REM ---------------------------------------------------------------------------
  5. REM chkcab.cmd - IIS CAB verification script.
  6. REM invoked by makecab.cmd
  7. REM
  8. REM ERROR FILE: %ThisFileName%.err
  9. REM LOG FILE: %ThisFileName%.log
  10. REM ---------------------------------------------------------------------------
  11. for %%a in (./ .- .) do if ".%1." == "%%a?." goto :Usage
  12. set ThisFileName=chkcab.cmd
  13. set ErrorString1=
  14. set ErrorString2=
  15. set ErrorCount=0
  16. REM We should be in the dump directory
  17. if exist dump cd dump
  18. REM ------------------------------------------
  19. REM Create the error file
  20. REM ------------------------------------------
  21. echo start > %ThisFileName%.err
  22. date /T >> %ThisFileName%.err
  23. time /T >> %ThisFileName%.err
  24. REM ------------------------------------------
  25. REM Verify files
  26. REM ------------------------------------------
  27. :Verify_Start
  28. set DirToCheck1=Binaries
  29. REM
  30. REM Check if Binaries Dirs exists
  31. REM
  32. call :CheckFileOrDir %DirToCheck1%
  33. REM
  34. REM Check for key files
  35. REM
  36. for %%a in (%DirToCheck1%) do (
  37. call :CheckFileOrDir %%a\iis.dll
  38. call :CheckFileOrDir %%a\iis_s.inf
  39. call :CheckFileOrDir %%a\iis_w.inf
  40. call :CheckFileOrDir %%a\adsiis.dll
  41. call :CheckFileOrDir %%a\asp.dll
  42. call :CheckFileOrDir %%a\ftpsvc2.dll
  43. call :CheckFileOrDir %%a\iisadmin.dll
  44. call :CheckFileOrDir %%a\iisrtl.dll
  45. call :CheckFileOrDir %%a\iisui.dll
  46. call :CheckFileOrDir %%a\inetmgr.dll
  47. )
  48. REM
  49. REM Check if *.cab exists
  50. REM
  51. for %%a in (%DirToCheck1%) do (
  52. call :CheckFileOrDir %%a\iis6.cab
  53. )
  54. :Verify_End
  55. goto ShowTheErrors
  56. REM ------------------------------------------
  57. REM FUNCTION: File/Directory Verification
  58. REM ------------------------------------------
  59. :CheckFileOrDir
  60. REM Check if file or dir exists
  61. set CheckFileOrDirReturn=0
  62. set CheckFileOrDir_What=%1
  63. set ErrorString1="Error: The File/DIR %CheckFileOrDir_What% does not exist!!!"
  64. set ErrorString2="DO: Check makecab1.cmd.err. check Makecab1.cmd.log file. Re-Run Makecab.cmd"
  65. if NOT exist %CheckFileOrDir_What% set CheckFileOrDirReturn=1
  66. if "%CheckFileOrDirReturn%" == "1" (
  67. call :SaveError %ErrorString1%
  68. call :SaveError %ErrorString2%
  69. )
  70. if /i "%CheckFileOrDirReturn%" == "1" set /a ErrorCount=%ErrorCount% + 1
  71. goto :EOF
  72. REM ------------------------------------------
  73. REM FUNCTION: Echo error to the error file
  74. REM ------------------------------------------
  75. :SaveError
  76. echo %1 >> %ThisFileName%.err
  77. msgbox16.exe %1
  78. goto :EOF
  79. REM ------------------------------------------
  80. REM Display errors
  81. REM ------------------------------------------
  82. :ShowTheErrors
  83. if NOT "%ErrorCount%" == "0" (
  84. msgbox16 "The Errors are in %ThisFileName%.err, Please check it."
  85. echo There are errors in %ThisFileName%.err, Please check it.
  86. echo Re-run the makecab script, and if problems still occur notify AaronL"
  87. )
  88. echo end >> %ThisFileName%.err
  89. date /T >> %ThisFileName%.err
  90. time /T >> %ThisFileName%.err
  91. goto :TheEnd
  92. REM ------------------------------------------------
  93. REM Display Usage:
  94. REM ------------------------------------------------
  95. :Usage
  96. echo.
  97. echo chkcab.cmd : script to check IIS CAB files were generated properly
  98. echo from makecab1.cmd.
  99. echo This script is invoked automatically by makecab.cmd
  100. echo.
  101. :TheEnd