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.

72 lines
2.0 KiB

  1. @echo off
  2. if "%@eval[2+2]" == "4" goto 4nt
  3. REM ------------------------------------------
  4. REM Figure out what the root of the world is.
  5. REM This is computed as the parent of the
  6. REM directory in which we are found.
  7. REM ------------------------------------------
  8. call :ComputeVipBase %~f0
  9. set VIPBASE=%RESULT%
  10. REM ------------------------------------------
  11. REM BUILD.EXE insists on having some particular
  12. REM environment variables pointing to our root
  13. REM ------------------------------------------
  14. goto :skip4nt
  15. :4nt
  16. REM Extract the full path to VipEnv.cmd.
  17. set VIPBASE=%@path[%@truename[%0]]
  18. REM Strip off the trailing "\"
  19. set VIPBASE=%@left[%@eval[%@len[%VIPBASE]-1],%VIPBASE]
  20. REM Strip off the last subdirectory.
  21. set i=%@eval[%@len[%VIPBASE]-1]
  22. do until "%@instr[%i,1,%VIPBASE]"=="\"
  23. set i=%@eval[%i-1]
  24. enddo
  25. set VIPBASE=%@left[%i,%VIPBASE]
  26. unset i
  27. :skip4nt
  28. REM ------------------------------------------
  29. REM Setup path
  30. REM ------------------------------------------
  31. if NOT "%CONFIGPATHSET%"=="" goto :skipsetpath
  32. set PATH=%VIPBASE%\common;%PATH%
  33. set CONFIGPATHSET=1
  34. :skipsetpath
  35. REM ------------------------------------------
  36. REM Call catutil to generate catmeta.h
  37. REM ------------------------------------------
  38. call catutil.exe /header=%VIPBASE%\src\inc\catmeta.h /schema=%VIPBASE%\src\core\catinproc\catalog.xms /meta=%VIPBASE%\src\inc\catmeta_core.xml,%VIPBASE%\src\inc\netcfgschema.xml,%VIPBASE%\src\inc\iismeta.xml,%VIPBASE%\src\inc\AppCenterMeta.xml
  39. REM ------------------------------------------
  40. REM Helper functions
  41. REM ------------------------------------------
  42. REM ------------------------------------------
  43. REM Expand a string to a full path
  44. REM ------------------------------------------
  45. :FullPath
  46. set RESULT=%~f1
  47. goto :EOF
  48. REM ------------------------------------------
  49. REM Compute the VIPBASE environment variable
  50. REM given a path to this batch script.
  51. REM ------------------------------------------
  52. :ComputeVipBase
  53. set RESULT=%~dp1..
  54. Call :FullPath %RESULT%
  55. goto :EOF