awlsim-win.cmd 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. @echo off
  2. setlocal ENABLEDELAYEDEXPANSION
  3. set basedir=%~dp0
  4. set awlsim_base=%basedir%
  5. set PYPROG=awlsim-gui
  6. for /D %%f in ( "progs\putty\*" ) do set PATH=%%f\putty;!PATH!
  7. set PATH=%PATH%;C:\WINDOWS;C:\WINDOWS\SYSTEM32
  8. for /D %%f in ( "C:\PYTHON*" ) do set PATH=!PATH!;%%f
  9. for /D %%f in ( "%USERPROFILE%\AppData\Local\Programs\Python\Python*" ) do set PATH=!PATH!;%%f;%%f\Scripts
  10. rem Set Cython paths
  11. if not exist %awlsim_base%\build goto no_cython
  12. for /D %%f in ( "%awlsim_base%\build\lib.*-3.*" ) do set PYTHONPATH=%%f\;!PYTHONPATH!
  13. set PYTHONPATH=.;%PYTHONPATH%
  14. set AWLSIM_CYTHON=1
  15. echo PYTHONPATH=%PYTHONPATH%
  16. :no_cython
  17. py -h >NUL 2>&1
  18. if %ERRORLEVEL% EQU 0 goto exec_py
  19. python3 -h >NUL 2>&1
  20. if %ERRORLEVEL% EQU 0 goto exec_python3
  21. python -h >NUL 2>&1
  22. if %ERRORLEVEL% EQU 0 goto exec_python
  23. echo Did not find Python 3.x in the PATH.
  24. echo Please make sure Python 3.x is installed correctly.
  25. pause
  26. goto end
  27. :exec_py
  28. @echo on
  29. py -3 -B %PYPROG% %1 %2 %3 %4 %5 %6 %7 %8 %9
  30. @goto end
  31. :exec_python3
  32. @echo on
  33. python3 -B %PYPROG% %1 %2 %3 %4 %5 %6 %7 %8 %9
  34. @goto end
  35. :exec_python
  36. @echo on
  37. python -B %PYPROG% %1 %2 %3 %4 %5 %6 %7 %8 %9
  38. @goto end
  39. :end