|
| 1 | +@echo off |
| 2 | + |
| 3 | +set "WD=%__CD__%" |
| 4 | +if NOT EXIST "%WD%msys-2.0.dll" set "WD=%~dp0usr\bin\" |
| 5 | + |
| 6 | +rem To activate windows native symlinks uncomment next line |
| 7 | +rem set MSYS=winsymlinks:nativestrict |
| 8 | + |
| 9 | +rem Set debugging program for errors |
| 10 | +rem set MSYS=error_start:%WD%../../mingw64/bin/qtcreator.exe^|-debug^|^<process-id^> |
| 11 | + |
| 12 | +rem To export full current PATH from environment into MSYS2 uncomment next line |
| 13 | +rem set SET_FULL_PATH=1 |
| 14 | + |
| 15 | +:checkparams |
| 16 | +rem Shell types |
| 17 | +if "x%~1" == "x-msys" shift& set MSYSTEM=MSYS& goto :checkparams |
| 18 | +if "x%~1" == "x-msys2" shift& set MSYSTEM=MSYS& goto :checkparams |
| 19 | +if "x%~1" == "x-mingw32" shift& set MSYSTEM=MINGW32& goto :checkparams |
| 20 | +if "x%~1" == "x-mingw64" shift& set MSYSTEM=MINGW64& goto :checkparams |
| 21 | +if "x%~1" == "x-mingw" shift& ( |
| 22 | + if exist "%WD%..\..\mingw64" (set MSYSTEM=MINGW64) else (set MSYSTEM=MINGW32) |
| 23 | +)& goto :checkparams |
| 24 | +rem Console types |
| 25 | +if "x%~1" == "x-consolez" shift& set MSYSCON=console.exe& goto :checkparams |
| 26 | +if "x%~1" == "x-mintty" shift& set MSYSCON=mintty.exe& goto :checkparams |
| 27 | +if "x%~1" == "x-defterm" shift& set MSYSCON=defterm& goto :checkparams |
| 28 | + |
| 29 | + |
| 30 | +rem Autodetect shell type if not specified |
| 31 | +if not defined MSYSTEM ( |
| 32 | + if exist "%WD%..\..\mingw64" ( |
| 33 | + set MSYSTEM=MINGW64 |
| 34 | + ) else if exist "%WD%..\..\mingw32" ( |
| 35 | + set MSYSTEM=MINGW32 |
| 36 | + ) else (set MSYSTEM=MSYS) |
| 37 | +) |
| 38 | + |
| 39 | +rem Setup proper title |
| 40 | +if "%MSYSTEM%" == "MSYS" ( |
| 41 | + set CONTITLE=MSys2 |
| 42 | +) else if "%MSYSTEM%" == "MINGW32" ( |
| 43 | + set "CONTITLE=MinGW x32" |
| 44 | +) else if "%MSYSTEM%" == "MINGW64" ( |
| 45 | + set "CONTITLE=MinGW x64" |
| 46 | +) |
| 47 | + |
| 48 | +if "x%MSYSCON%" == "xmintty.exe" goto startmintty |
| 49 | +if "x%MSYSCON%" == "xconsole.exe" goto startconsolez |
| 50 | +if "x%MSYSCON%" == "xdefterm" goto startsh |
| 51 | + |
| 52 | +if NOT EXIST "%WD%mintty.exe" goto startsh |
| 53 | +set MSYSCON=mintty.exe |
| 54 | +:startmintty |
| 55 | +start "%CONTITLE%" "%WD%mintty" -i /msys2.ico /usr/bin/bash --login %1 %2 %3 %4 %5 %6 %7 %8 %9 |
| 56 | +exit /b %ERRORLEVEL% |
| 57 | + |
| 58 | +:startconsolez |
| 59 | +cd %WD%..\lib\ConsoleZ |
| 60 | +start console -t "%CONTITLE%" -r %1 %2 %3 %4 %5 %6 %7 %8 %9 |
| 61 | +exit /b %ERRORLEVEL% |
| 62 | + |
| 63 | +:startsh |
| 64 | +set MSYSCON= |
| 65 | +start "%CONTITLE%" "%WD%bash" --login %1 %2 %3 %4 %5 %6 %7 %8 %9 |
| 66 | +exit /b %ERRORLEVEL% |
| 67 | + |
| 68 | +:EOF |
0 commit comments