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.

46 lines
1.1 KiB

  1. @echo off
  2. REM CMD needs a way to "export" variables like a descent Unix shell
  3. REM while using setlocal to prevent leaking local variables.
  4. REM That would make this script a lot simpler!
  5. REM Error output
  6. call :find Magellan injrt.dll
  7. call :find Injector sword.exe
  8. call :find Mage mage.exe
  9. echo.
  10. REM Actual setting
  11. call :set MAGELLAN_INC_PATH injrt.dll Inc
  12. call :set MAGELLAN_LIB_PATH injrt.dll Lib
  13. echo.
  14. REM Shorten setting
  15. call :shorten MAGELLAN_INC_PATH "%MAGELLAN_INC_PATH%"
  16. call :shorten MAGELLAN_LIB_PATH "%MAGELLAN_LIB_PATH%"
  17. goto :EOF
  18. :find
  19. if "%~dp$PATH:2"=="" (
  20. echo -------------------------------------------------
  21. echo %1 not found in PATH
  22. echo Please remedy this situation before using MiFault
  23. echo -------------------------------------------------
  24. ) else (
  25. echo %1 found at: %~dp$PATH:2
  26. )
  27. goto :EOF
  28. :set
  29. if "%~dp$PATH:2"=="" (
  30. goto :EOF
  31. ) else (
  32. echo Setting %1=%~dp$PATH:2%3
  33. set %1=%~dp$PATH:2%3
  34. )
  35. goto :EOF
  36. :shorten
  37. if "%~2"=="" goto :EOF
  38. echo Shortening %1 to %~s2
  39. set %1=%~s2
  40. goto :EOF