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