|
| 1 | +: |
| 2 | +@echo off |
| 3 | + |
| 4 | +rem ember value of GOTO: is used to know recursion has happened. |
| 5 | +if "%1" == "GOTO:" goto %2 |
| 6 | + |
| 7 | +if NOT "x%WD%" == "x" set WD= |
| 8 | + |
| 9 | +rem ember command.com only uses the first eight characters of the label. |
| 10 | +goto _WindowsNT |
| 11 | + |
| 12 | +start /min %COMSPEC% /e:4096 /c %0 GOTO: _Resume %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 |
| 13 | +goto EOF |
| 14 | + |
| 15 | +rem ember that we execute here if we recursed. |
| 16 | +:_Resume |
| 17 | +for %%F in (1 2 3) do shift |
| 18 | +if NOT EXIST %WD%msys-2.0.dll set WD=.\usr\bin\ |
| 19 | + |
| 20 | +rem ember that we get here even in command.com. |
| 21 | +:_WindowsNT |
| 22 | + |
| 23 | +if NOT EXIST %WD%opt\bin\CmdInit.cmd %WD%usr\bin\touch.exe > %WD%opt\bin\CmdInit.cmd |
| 24 | + |
| 25 | +if NOT EXIST %WD%msys-2.0.dll set WD=%~dp0usr\bin\ |
| 26 | +set MSYSTEM=MINGW64 |
| 27 | +set MINGW32=/mingw32 |
| 28 | +set MINGW64=/mingw64 |
| 29 | +set PATH=%PATH%;. |
| 30 | +@if defined VS120COMNTOOLS ( |
| 31 | + @call "%VS120COMNTOOLS%vsvars32.bat" |
| 32 | +) |
| 33 | +@if defined VS140COMNTOOLS ( |
| 34 | + @call "%VS140COMNTOOLS%vsvars32.bat" |
| 35 | +) |
| 36 | +rem To activate windows native symlinks uncomment next line |
| 37 | +rem set MSYS=winsymlinks:nativestrict |
| 38 | +rem Set debugging program for errors |
| 39 | +rem set MSYS=error_start:%WD%../../mingw64/bin/qtcreator.exe^|-debug^|^<process-id^> |
| 40 | +set MSYSCON=mintty.exe |
| 41 | +if "x%1" == "x-consolez" set MSYSCON=console.exe |
| 42 | +if "x%1" == "x-mintty" set MSYSCON=mintty.exe |
| 43 | + |
| 44 | +if "x%MSYSCON%" == "xmintty.exe" goto startmintty |
| 45 | +if "x%MSYSCON%" == "xconsole.exe" goto startconsolez |
| 46 | + |
| 47 | +:startmintty |
| 48 | +if NOT EXIST %WD%mintty.exe goto startsh |
| 49 | +start %WD%mintty -i /msys2.ico /usr/bin/bash --login %* |
| 50 | +exit |
| 51 | + |
| 52 | +:startconsolez |
| 53 | +cd %WD%..\lib\ConsoleZ |
| 54 | +start console -t "MinGW" -r "%*" |
| 55 | +exit |
| 56 | + |
| 57 | +:startsh |
| 58 | +start %WD%sh --login -i %* |
| 59 | +exit |
| 60 | + |
| 61 | +:EOF |
0 commit comments