GitMe: check if cygwin is in PATH; if so abort installer.
[git/jnareb-git.git] / msys.bat
blob6355eb17771ae406c55c80022fe27dc73ad9f8da
1 @echo off\r
2 rem Copyright (C):  2001, 2002  Earnie Boyd\r
3 rem   mailto:earnie@users.sf.net\r
4 rem This file is part of Minimal SYStem\r
5 rem   http://www.mingw.org/msys.shtml\r
6 rem\r
7 rem File:           msys.bat\r
8 rem Revision:       2.0\r
9 rem Revision Date:  April 17th, 2002\r
11 rem ember to set the "Start in:" field of the shortcut.\r
12 rem A value similar to C:\msys\1.0\bin is what the "Start in:" field needs\r
13 rem to represent.\r
15 rem ember value of GOTO: is used to know recursion has happened.\r
16 if "%1" == "GOTO:" goto %2\r
18 rem ember command.com only uses the first eight characters of the label.\r
19 set OS_VERSION="NT"\r
20 goto _WindowsNT\r
22 rem ember that we only execute here if we are in command.com.\r
23 :_Windows\r
24 set OS_VERSION="9x"\r
26 if "x%COMSPEC%" == "x" set COMSPEC=command.com\r
27 start %COMSPEC% /e:4096 /c %0 GOTO: _Resume %0 %1 %2 %3 %4 %5 %6 %7 %8 %9\r
28 goto EOF\r
30 rem ember that we execute here if we recursed.\r
31 :_Resume\r
32 for %%F in (1 2 3) do shift\r
34 rem ember that we get here even in command.com.\r
35 :_WindowsNT\r
37 if "x%MSYSTEM%" == "x" set MSYSTEM=MINGW32\r
38 if "%1" == "MSYS" set MSYSTEM=MSYS\r
40 if NOT "x%DISPLAY%" == "x" set DISPLAY=\r
42 rem We here assume old behavior, to make sure that older platforms can still use\r
43 rem this batch file to start their MSys environment.\r
44 set BIN=""\r
45 if EXIST bin\nul set BIN="bin\"\r
46 if EXIST %BIN%bash.exe goto startbash\r
47 if EXIST %BIN%rxvt.exe goto startrxvt\r
49 rem If we're not on win9x type OSs, lets try a little better at finding bash/rxvt\r
50 if "win%OS_VERSION%"=="win9x" goto failed\r
51 set BIN="%~dp0bin\"\r
52 if EXIST %BIN%bash.exe goto startbash\r
53 if EXIST %BIN%rxvt.exe goto startrxvt\r
55 :failed\r
56 echo Cannot find the rxvt.exe or bash.exe binary -- aborting.\r
57 pause\r
58 rem exit 1\r
59 rem we skip using exit 1 here, since it will close the console you were working on\r
60 rem which probably isn't what you wanted. If the bat file was run from a shortcut\r
61 rem the window will still close, like you would expect it to. Sorry, you cant test\r
62 rem for exit values anymore, but hey, you can just un-rem the line above then! :-)\r
63 goto EOF\r
65 rem If you don't want to use rxvt then rename the file rxvt.exe to something\r
66 rem else.  Then bash.exe will be used instead.\r
67 :startrxvt\r
69 rem Setup the default colors for rxvt.\r
70 if "x%MSYSBGCOLOR%" == "x" set MSYSBGCOLOR=White\r
71 if "x%MSYSFGCOLOR%" == "x" set MSYSFGCOLOR=Black\r
72 if "x%MINGW32BGCOLOR%" == "x" set MINGW32BGCOLOR=LightYellow\r
73 if "x%MINGW32FGCOLOR%" == "x" set MINGW32FGCOLOR=Navy\r
74 if "%MSYSTEM%" == "MSYS" set BGCOLOR=%MSYSBGCOLOR%\r
75 if "%MSYSTEM%" == "MSYS" set FGCOLOR=%MSYSFGCOLOR%\r
76 if "%MSYSTEM%" == "MINGW32" set BGCOLOR=%MINGW32BGCOLOR%\r
77 if "%MSYSTEM%" == "MINGW32" set FGCOLOR=%MINGW32FGCOLOR%\r
79 start %BIN%rxvt -backspacekey \b -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-12 -tn msys -geometry 80x25 -e /bin/bash --login -i\r
80 exit\r
82 :startbash\r
83 call %BIN%bash --login -i\r
85 :EOF\r
87 rem ChangeLog:\r
88 rem 2002.03.07  Earnie Boyd  mailto:earnie@users.sf.net\r
89 rem     * Move the @echo off to the top.\r
90 rem     * Change the binmode setting to nobinmode.\r
91 rem     * Remove the angle brackets around email address to workaround MS\r
92 rem     buggy command processor.\r
93 rem\r
94 rem 2002.03.12  Earnie Boyd  mailto:earnie@users.sf.net\r
95 rem     * Add filter logic to find rxvt.exe\r
96 rem\r
97 rem 2002.03.13  Earnie Boyd  mailto:earnie@users.sf.net\r
98 rem     * Revert the nobinmode change.\r
99 rem\r
100 rem 2002.03.20  Earnie Boyd  mailto:earnie@users.sf.net\r
101 rem     * Add logic for stating bash.\r
102 rem\r
103 rem 2002.04.11  Earnie Boyd  mailto;earnie@users.sf.net\r
104 rem     * Add logic for setting MSYSTEM value based on parameter.\r
105 rem\r
106 rem 2002.04.15  Olivier Gautherot  mailto:olivier_gautherot@mentorg.com\r
107 rem     * Reduce number test conditions for finding an executable.\r
108 rem\r
109 rem 2002.04.15  Earnie Boyd  mailto:earnie@users.sf.net\r
110 rem     * Unset DISPLAY if set before starting shell.\r
111 rem\r
112 rem 2002.04.16  Earnie Boyd  mailto:earnie@users.sf.net\r
113 rem     * Remove use of DEFINED in conditional statments for variables for\r
114 rem     command.com support.\r
115 rem     * Add check for nonexistance of USERNAME variable for Win9x support.\r
116 rem\r
117 rem 2002.04.17  Earnie Boyd  mailto:earnie@users.sf.net\r
118 rem     * Add foreground and background color defaults based on MSYSTEM value.\r
119 rem\r
120 rem 2002.04.22  Earnie Boyd  mailto:earnie@users.sf.net\r
121 rem     * More Win 9x changes.\r
122 rem\r
123 rem 2002.05.04  Earnie Boyd  mailto:earnie@users.sf.net\r
124 rem     * Remove the SET of USERNAME and HOME.\r
125 rem\r
126 rem 2002.11.18  Earnie Boyd  mailto:earnie@users.sf.net\r
127 rem     * Add command.com detection and restart with a larger environment to\r
128 rem     avoid errors on w9x.\r
129 rem     Many thanks to Randy W. Sims mailto:RandyS@ThePierianSpring.org.\r
130 rem     See Randy's response to "RE: [Mingw-msys] Installation on WindowsME"\r
131 rem     from 11/06/2002 in the archives of mingw-msys@lists.sf.net.\r
132 rem\r
133 rem 2002.11.19  Paul Garceau  mailto:pgarceau@attbi.com\r
134 rem     * Fix a typo: Change COMPSPEC to COMSPEC.\r
135 rem\r
136 rem 2002.11.25  Earnie Boyd  mailto:earnie@users.sf.net\r
137 rem     * Remove the SET CYGWIN since it doesn't matter any longer.\r
138 rem\r
139 rem 2003.02.03  Earnie Boyd  mailto:earnie@users.sf.net\r
140 rem     * Win9x doesn't like ``EXISTS dir'' so change it to ``EXISTS dir\nul''.\r
141 rem     Thanks to Nicolas Weber mailto:nicolasweber@gmx.de.\r
142 rem\r
143 rem 2003.03.06  Earnie Boyd  mailto:earnie@users.sf.net\r
144 rem     * Add -backspacekey switch to rxvt startup.\r
145 rem     * Move RXVT color setup to startrxvt label\r
146 rem\r
147 rem 2004.01.30  Earnie Boyd  mailto:earnie@users.sf.net\r
148 rem     * Add -geometry parameter to work around an off by one issue with\r
149 rem       the default values.\r
150 rem     Thanks to Dave Schuyler mailto:parameter@users.sf.net\r