HOWTO Install MinGW on a Windows machine not connected to the Internet (so you can't use the automatic installer) 1. On a machine that IS connected to the Internet, create a file structure like this mingw \install \mingw \msys 2. Go to http://mingw.org and download the following files (version numbers may change; get the latest version): From MinGW (put in mingw\install\mingw): binutils-2.20.51-1-mingw32-bin.tar.lzma bzip2-1.0.5-2-mingw32-bin.tar.gz bzip2-1.0.5-2-mingw32-dev.tar.gz bzip2-1.0.5-2-mingw32-doc.tar.gz expat-2.0.1-1-mingw32-bin.tar.gz expat-2.0.1-1-mingw32-doc.tar.gz gcc-4.5.0-1-mingw32-doc.tar.lzma gcc-c++-4.5.0-1-mingw32-bin.tar.lzma gcc-core-4.5.0-1-mingw32-bin.tar.lzma gdb-7.2-1-mingw32-bin.tar.lzma gdb-7.2-1-mingw32-doc.tar.lzma gettext-0.17-1-mingw32-bin.tar.lzma gettext-0.17-1-mingw32-dev.tar.lzma gettext-0.17-1-mingw32-doc.tar.lzma gmp-5.0.1-1-mingw32-dev.tar.lzma gmp-5.0.1-1-mingw32-doc.tar.lzma libarchive-2.8.3-1-mingw32-dev.tar.bz2 libarchive-2.8.3-1-mingw32-dll-2.tar.bz2 libarchive-2.8.3-1-mingw32-doc.tar.bz2 libasprintf-0.17-1-mingw32-dll-0.tar.lzma libbz2-1.0.5-2-mingw32-dll-2.tar.gz libcharset-1.13.1-1-mingw32-dll-1.tar.lzma libexpat-2.0.1-1-mingw32-dev.tar.gz libexpat-2.0.1-1-mingw32-dll-1.tar.gz libgcc-4.5.0-1-mingw32-dll-1.tar.lzma libgettextpo-0.17-1-mingw32-dll-0.tar.lzma libgmp-5.0.1-1-mingw32-dll-10.tar.lzma libgmpxx-5.0.1-1-mingw32-dll-4.tar.lzma libiconv-1.13.1-1-mingw32-bin.tar.lzma libiconv-1.13.1-1-mingw32-dev.tar.lzma libiconv-1.13.1-1-mingw32-dll-2.tar.lzma libiconv-1.13.1-1-mingw32-doc.tar.lzma libintl-0.17-1-mingw32-dll-8.tar.lzma libltdl-2.2.11a-1-mingw32-dev.tar.lzma libltdl-2.2.11a-1-mingw32-dll-7.tar.lzma liblzma-4.999.9beta_20100401-1-mingw32-dev.tar.bz2 liblzma-4.999.9beta_20100401-1-mingw32-dll-1.tar.bz2 libmpc-0.8.1-1-mingw32-dll-2.tar.lzma libmpfr-2.4.1-1-mingw32-dll-1.tar.lzma libpdcurses-3.4-1-mingw32-dev.tar.lzma libpdcurses-3.4-1-mingw32-dll.tar.lzma libpopt-1.15-1-mingw32-dev.tar.lzma libpopt-1.15-1-mingw32-dll-0.tar.lzma libpthread-2.8.0-3-mingw32-dll-2.tar.lzma libstdc++-4.5.0-1-mingw32-dll-6.tar.lzma libtool-2.2.11a-1-mingw32-bin.tar.lzma libtool-2.2.11a-1-mingw32-doc.tar.lzma libz-1.2.3-1-mingw32-dev.tar.gz libz-1.2.3-1-mingw32-dll-1.tar.gz make-3.82-3-mingw32-bin.tar.lzma mingw-utils-0.4-1-mingw32-bin.tar.lzma mingw-utils-0.4-1-mingw32-doc.tar.lzma mingwrt-3.18-mingw32-dev.tar.gz mingwrt-3.18-mingw32-dll.tar.gz mpc-0.8.1-1-mingw32-dev.tar.lzma mpc-0.8.1-1-mingw32-doc.tar.lzma mpfr-2.4.1-1-mingw32-dev.tar.lzma mpfr-2.4.1-1-mingw32-doc.tar.lzma popt-1.15-1-mingw32-doc.tar.lzma pthreads-w32-2.8.0-3-mingw32-dev.tar.lzma pthreads-w32-2.8.0-3-mingw32-doc.tar.lzma tcltk-8.4.1-1.exe w32api-3.15-1-mingw32-dev.tar.lzma wget-1.9.1.tar.gz xz-4.999.9beta_20100401-1-mingw32-bin.tar.bz2 xz-4.999.9beta_20100401-1-mingw32-doc.tar.bz2 zlib-1.2.3-1-mingw32-doc.tar.gz PDCurses-3.4-1-mingw32-bin.tar.lzma PDCurses-3.4-1-mingw32-doc.tar.lzma From MSYS (put in mingw\install\mingw): bash-3.1.17-3-msys-1.0.13-bin.tar.lzma bash-3.1.17-3-msys-1.0.13-doc.tar.lzma bison-2.4.2-1-msys-1.0.13-bin.tar.lzma bison-2.4.2-1-msys-1.0.13-doc.tar.lzma bzip2-1.0.5-2-msys-1.0.13-bin.tar.lzma bzip2-1.0.5-2-msys-1.0.13-doc.tar.lzma coreutils-5.97-3-msys-1.0.13-bin.tar.lzma coreutils-5.97-3-msys-1.0.13-doc.tar.lzma crypt-1.1_1-3-msys-1.0.13-bin.tar.lzma crypt-1.1_1-3-msys-1.0.13-doc.tar.lzma diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin.tar.lzma diffutils-2.8.7.20071206cvs-3-msys-1.0.13-doc.tar.lzma expat-2.0.1-1-msys-1.0.13-bin.tar.lzma expat-2.0.1-1-msys-1.0.13-doc.tar.lzma file-5.04-1-msys-1.0.13-bin.tar.lzma file-5.04-1-msys-1.0.13-doc.tar.lzma findutils-4.4.2-2-msys-1.0.13-bin.tar.lzma findutils-4.4.2-2-msys-1.0.13-doc.tar.lzma flex-2.5.35-2-msys-1.0.13-bin.tar.lzma flex-2.5.35-2-msys-1.0.13-doc.tar.lzma gawk-3.1.7-2-msys-1.0.13-bin.tar.lzma gawk-3.1.7-2-msys-1.0.13-doc.tar.lzma gdbm-1.8.3-3-msys-1.0.13-doc.tar.lzma gettext-0.17-2-msys-1.0.13-bin.tar.lzma gettext-0.17-2-msys-1.0.13-doc.tar.lzma grep-2.5.4-2-msys-1.0.13-bin.tar.lzma grep-2.5.4-2-msys-1.0.13-doc.tar.lzma groff-1.20.1-2-msys-1.0.13-bin.tar.lzma groff-1.20.1-2-msys-1.0.13-doc.tar.lzma guile-1.8.7-2-msys-1.0.15-doc.tar.lzma gzip-1.3.12-2-msys-1.0.13-bin.tar.lzma gzip-1.3.12-2-msys-1.0.13-doc.tar.lzma less-436-2-msys-1.0.13-bin.tar.lzma less-436-2-msys-1.0.13-doc.tar.lzma libarchive-2.8.3-1-msys-1.0.13-dll-2.tar.lzma libasprintf-0.17-2-msys-dll-0.tar.lzma libbz2-1.0.5-2-msys-1.0.13-dll-1.tar.lzma libcharset-1.13.1-2-msys-1.0.13-dll-1.tar.lzma libcrypt-1.1_1-3-msys-1.0.13-dll-0.tar.lzma libexpat-2.0.1-1-msys-1.0.13-dll-1.tar.lzma libgettextpo-0.17-2-msys-dll-0.tar.lzma libgmp-5.0.1-1-msys-1.0.13-dll-10.tar.lzma libiconv-1.13.1-2-msys-1.0.13-dll-2.tar.lzma libintl-0.17-2-msys-dll-8.tar.lzma liblzma-4.999.9beta_20100401-1-msys-1.0.13-dll-1.tar.gz libmagic-5.04-1-msys-1.0.13-dll-1.tar.lzma libpopt-1.15-2-msys-1.0.13-dll-0.tar.lzma libregex-1.20090805-2-msys-1.0.13-dll-1.tar.lzma libtermcap-0.20050421_1-2-msys-1.0.13-dll-0.tar.lzma libxml2-2.7.6-1-msys-1.0.13-bin.tar.lzma libxml2-2.7.6-1-msys-1.0.13-dll-2.tar.lzma locate-4.4.2-2-msys-1.0.13-bin.tar.lzma m4-1.4.14-1-msys-1.0.13-bin.tar.lzma m4-1.4.14-1-msys-1.0.13-doc.tar.lzma make-3.81-3-msys-1.0.13-bin.tar.lzma make-3.81-3-msys-1.0.13-doc.tar.lzma man-1.6f-2-msys-1.0.13-bin.tar.lzma man-1.6f-2-msys-1.0.13-doc.tar.lzma msysCORE-1.0.15-1-msys-1.0.15-bin.tar.lzma msysCORE-1.0.15-1-msys-1.0.15-doc.tar.lzma patch-2.6.1-1-msys-1.0.13-bin.tar.lzma patch-2.6.1-1-msys-1.0.13-doc.tar.lzma perl-5.6.1_2-2-msys-1.0.13-bin.tar.lzma perl-5.6.1_2-2-msys-1.0.13-doc.tar.lzma rxvt-2.7.2-3-msys-1.0.14-bin.tar.lzma rxvt-2.7.2-3-msys-1.0.14-doc.tar.lzma sed-4.2.1-2-msys-1.0.13-bin.tar.lzma sed-4.2.1-2-msys-1.0.13-doc.tar.lzma tar-1.23-1-msys-1.0.13-bin.tar.lzma tar-1.23-1-msys-1.0.13-doc.tar.lzma termcap-0.20050421_1-2-msys-1.0.13-bin.tar.lzma termcap-0.20050421_1-2-msys-1.0.13-doc.tar.lzma texinfo-4.13a-2-msys-1.0.13-bin.tar.lzma texinfo-4.13a-2-msys-1.0.13-doc.tar.lzma unzip-6.0-1-msys-1.0.13-bin.tar.lzma unzip-6.0-1-msys-1.0.13-doc.tar.lzma xz-4.999.9beta_20100401-1-msys-1.0.13-bin.tar.gz xz-4.999.9beta_20100401-1-msys-1.0.13-doc.tar.gz zip-3.0-1-msys-1.0.14-bin.tar.lzma zip-3.0-1-msys-1.0.14-doc.tar.lzma 3. Go to http://www.7-zip.org and get the command-line version (e.g., 7za465.zip). This assumes you have an unzip utility; if you don't, you can get the regular Windows version of 7-zip from the same site and install it. Then unzip this command-line zipfile and put the "7za.exe" file in mingw\install 4. Clip the following and save as "mingw_install.bat": ---------- 8X ---------- Start Clip ------------------ REM Destination Directory set D=C:\MINGW mkdir %D% mkdir %D%\bin REM Use 7-Zip for the de-archiver, since it can handle the LZMA files copy 7za.exe %D%\bin REM Get relevant MSYS packages REM Lines that are commented out are MSYS binaries, where the MinGW binaries REM are associated with the MinGW libraries for inclusion in projects. copy msys\bash*.* %D% copy msys\bison*.* %D% REM copy msys\bzip2*.* %D% copy msys\coreutils*.* %D% copy msys\crypt*.* %D% copy msys\diffutils*.* %D% REM copy msys\expat*.* %D% copy msys\file-*.* %D% copy msys\findutils*.* %D% copy msys\flex*.* %D% copy msys\gawk*.* %D% copy msys\gdbm*.* %D% REM copy msys\gettext*.* %D% copy msys\grep*.* %D% copy msys\groff*.* %D% copy msys\guile*.* %D% copy msys\gzip*.* %D% copy msys\less*.* %D% copy msys\libarchive*.* %D% copy msys\libasprintf*.* %D% copy msys\libbz2*.* %D% copy msys\libcharset*.* %D% copy msys\libcrypt*.* %D% copy msys\libexpat*.* %D% copy msys\libgettextpo*.* %D% copy msys\libgmp*.* %D% copy msys\libguile*.* %D% copy msys\libiconv*.* %D% copy msys\libintl*.* %D% copy msys\libmagic*.* %D% copy msys\libpopt*.* %D% copy msys\libregex*.* %D% copy msys\libtermcap*.* %D% copy msys\libxml2*.* %D% copy msys\locate*.* %D% copy msys\m4*.* %D% REM Keep MSYS "make" around, in case it works better than the MinGW "make". REM copy msys\make*.* %D% copy msys\man-*.* %D% copy msys\msyscore*.* %D% copy msys\patch*.* %D% copy msys\perl*.* %D% copy msys\rxvt*.* %D% copy msys\sed*.* %D% copy msys\tar*.* %D% copy msys\termcap*.* %D% copy msys\texinfo*.* %D% copy msys\unzip*.* %D% copy msys\zip-*.* %D% REM Get relevant MinGW packages copy mingw\binutils* %D% copy mingw\bzip2* %D% copy mingw\expat* %D% copy mingw\gcc* %D% copy mingw\gdb* %D% copy mingw\gettext* %D% copy mingw\gmp* %D% copy mingw\libarchive* %D% copy mingw\libasprintf* %D% copy mingw\libbz2* %D% copy mingw\libcharset* %D% copy mingw\libexpat* %D% copy mingw\libgcc* %D% copy mingw\libgettextpo* %D% copy mingw\libgmp* %D% copy mingw\libiconv* %D% copy mingw\libintl* %D% copy mingw\libltdl* %D% copy mingw\liblzma* %D% copy mingw\libmpc* %D% copy mingw\libmpfr* %D% copy mingw\libpdcurses* %D% copy mingw\libpopt* %D% copy mingw\libpthread* %D% copy mingw\libstdc* %D% copy mingw\libtool* %D% copy mingw\libz-* %D% copy mingw\make* %D% copy mingw\mingwrt* %D% copy mingw\mingw-utils* %D% copy mingw\mpc* %D% copy mingw\mpfr* %D% copy mingw\PDCurses* %D% copy mingw\popt* %D% copy mingw\pthreads* %D% copy mingw\w32api* %D% REM "wget" not included for standalone, behind-the-firewall systems REM copy mingw\wget* %D% copy mingw\xz* %D% copy mingw\zlib* %D% REM For some reason, the msys.bat is not included in recent release. REM Put it in from an old one copy msys.bat %D% REM Now go and unpack it all path set PATH=%D%\bin;%PATH% path cd %D% for %%f in (*.lzma) do 7za x %%f for %%f in (*.gz) do 7za x %%f for %%f in (*.zip) do 7za x %%f for %%f in (*.bz2) do 7za x %%f del *.lzma del *.gz del *.zip del *.bz2 for %%f in (*.tar) do 7za x %%f del *.tar ---------- 8X ---------- End Clip ------------------ 5. Clip the following and save as "msys.bat": (Note: The msysCORE archive ought to have this, and used to, but the version above doesn't, so this is from an older version. Works fine. ---------- 8X ---------- Start Clip ------------------ @echo off rem Copyright (C): 2001, 2002, 2003, 2004, 2005 Earnie Boyd rem mailto:earnie@users.sf.net rem This file is part of Minimal SYStem rem http://www.mingw.org/msys.shtml rem rem File: msys.bat rem Revision: 2.4 rem Revision Date: December 8th, 2005 rem ember to set the "Start in:" field of the shortcut. rem A value similar to C:\msys\1.0\bin is what the "Start in:" field needs rem to represent. rem ember value of GOTO: is used to know recursion has happened. if "%1" == "GOTO:" goto %2 if NOT "x%WD%" == "x" set WD= rem ember command.com only uses the first eight characters of the label. goto _WindowsNT rem ember that we only execute here if we are in command.com. :_Windows if "x%COMSPEC%" == "x" set COMSPEC=command.com start /min %COMSPEC% /e:4096 /c %0 GOTO: _Resume %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 goto EOF rem ember that we execute here if we recursed. :_Resume for %%F in (1 2 3) do shift if NOT EXIST %WD%msys-1.0.dll set WD=.\bin\ rem ember that we get here even in command.com. :_WindowsNT rem Hopefully a temporary workaround for getting MSYS shell to run on x64 rem (WoW64 cmd prompt sets PROCESSOR_ARCHITECTURE to x86) if not "x%PROCESSOR_ARCHITECTURE%" == "xAMD64" goto _NotX64 set COMSPEC=%WINDIR%\SysWOW64\cmd.exe %COMSPEC% /c %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 goto EOF :_NotX64 if NOT EXIST %WD%msys-1.0.dll set WD=%~dp0\bin\ rem ember Set up option to use rxvt based on value of %1 if "x%MSYSCON%" == "x" set MSYSCON=rxvt.exe if "x%1" == "x-norxvt" set MSYSCON=sh.exe if "x%1" == "x--norxvt" set MSYSCON=sh.exe if "x%MSYSCON%" == "xsh.exe" shift if "x%MSYSTEM%" == "x" set MSYSTEM=MINGW32 if "%1" == "MINGW32" set MSYSTEM=MINGW32 if "%1" == "MSYS" set MSYSTEM=MSYS if NOT "x%DISPLAY%" == "x" set DISPLAY= if "x%MSYSCON%" == "xrxvt.exe" goto startrxvt if "x%MSYSCON%" == "xsh.exe" goto startsh :unknowncon echo %MSYSCON% is an unknown option for msys.bat. pause exit 1 :notfound echo Cannot find the rxvt.exe or sh.exe binary -- aborting. pause exit 1 rem If you don't want to use rxvt then rename the file rxvt.exe to something rem else. Then sh.exe will be used instead. :startrxvt if NOT EXIST %WD%rxvt.exe goto startsh rem Setup the default colors for rxvt. if "x%MSYSBGCOLOR%" == "x" set MSYSBGCOLOR=White if "x%MSYSFGCOLOR%" == "x" set MSYSFGCOLOR=Black if "x%MINGW32BGCOLOR%" == "x" set MINGW32BGCOLOR=LightYellow if "x%MINGW32FGCOLOR%" == "x" set MINGW32FGCOLOR=Navy if "%MSYSTEM%" == "MSYS" set BGCOLOR=%MSYSBGCOLOR% if "%MSYSTEM%" == "MSYS" set FGCOLOR=%MSYSFGCOLOR% if "%MSYSTEM%" == "MINGW32" set BGCOLOR=%MINGW32BGCOLOR% if "%MSYSTEM%" == "MINGW32" set FGCOLOR=%MINGW32FGCOLOR% start %WD%rxvt -backspacekey  -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-12 -tn msys -geometry 80x25 -e /bin/sh --login -i exit :startsh if NOT EXIST %WD%sh.exe goto notfound start %WD%sh --login -i exit :EOF rem ChangeLog: rem 2002.03.07 Earnie Boyd mailto:earnie@users.sf.net rem * Move the @echo off to the top. rem * Change the binmode setting to nobinmode. rem * Remove the angle brackets around email address to workaround MS rem buggy command processor. rem rem 2002.03.12 Earnie Boyd mailto:earnie@users.sf.net rem * Add filter logic to find rxvt.exe rem rem 2002.03.13 Earnie Boyd mailto:earnie@users.sf.net rem * Revert the nobinmode change. rem rem 2002.03.20 Earnie Boyd mailto:earnie@users.sf.net rem * Add logic for stating bash. rem rem 2002.04.11 Earnie Boyd mailto;earnie@users.sf.net rem * Add logic for setting MSYSTEM value based on parameter. rem rem 2002.04.15 Olivier Gautherot mailto:olivier_gautherot@mentorg.com rem * Reduce number test conditions for finding an executable. rem rem 2002.04.15 Earnie Boyd mailto:earnie@users.sf.net rem * Unset DISPLAY if set before starting shell. rem rem 2002.04.16 Earnie Boyd mailto:earnie@users.sf.net rem * Remove use of DEFINED in conditional statments for variables for rem command.com support. rem * Add check for nonexistance of USERNAME variable for Win9x support. rem rem 2002.04.17 Earnie Boyd mailto:earnie@users.sf.net rem * Add foreground and background color defaults based on MSYSTEM value. rem rem 2002.04.22 Earnie Boyd mailto:earnie@users.sf.net rem * More Win 9x changes. rem rem 2002.05.04 Earnie Boyd mailto:earnie@users.sf.net rem * Remove the SET of USERNAME and HOME. rem rem 2002.11.18 Earnie Boyd mailto:earnie@users.sf.net rem * Add command.com detection and restart with a larger environment to rem avoid errors on w9x. rem Many thanks to Randy W. Sims mailto:RandyS@ThePierianSpring.org. rem See Randy's response to "RE: [Mingw-msys] Installation on WindowsME" rem from 11/06/2002 in the archives of mingw-msys@lists.sf.net. rem rem 2002.11.19 Paul Garceau mailto:pgarceau@attbi.com rem * Fix a typo: Change COMPSPEC to COMSPEC. rem rem 2002.11.25 Earnie Boyd mailto:earnie@users.sf.net rem * Remove the SET CYGWIN since it doesn't matter any longer. rem rem 2003.02.03 Earnie Boyd mailto:earnie@users.sf.net rem * Win9x doesn't like ``EXISTS dir'' so change it to ``EXISTS dir\nul''. rem Thanks to Nicolas Weber mailto:nicolasweber@gmx.de. rem rem 2003.03.06 Earnie Boyd mailto:earnie@users.sf.net rem * Add -backspacekey switch to rxvt startup. rem * Move RXVT color setup to startrxvt label rem rem 2004.01.30 Earnie Boyd mailto:earnie@users.sf.net rem * Add -geometry parameter to work around an off by one issue with rem the default values. rem Thanks to Dave Schuyler mailto:parameter@users.sf.net rem rem 2004.03.28 Earnie Boyd mailto:earnie@users.sf.net rem * Add -norxvt or --norxvt switch argument. rem Thanks to Keith Marshall mailto:Keith.Marshall@total.com. rem * Add method to determine absolute path of msys.bat so that we no rem longer need to change to the bin directory. This allows msys.bat to be rem called from any working directory. rem Thanks to Kevin Mack mailto:kevin.mack@us.cd-adapco.com rem rem 2005.07.06 Max TE Woodbury mailto:mtew@users.sf.net rem * Fixed WD check for command.com systems. rem * Minimized intermediate CMD window to reduce startup flashyness. rem * If rxvt.exe cannot be found, try sh.exe. rem rem 2005.12.06 Tuomo Latto mailto:nonperson@users.sf.net rem * Added a temporary workaround for getting MSYS shell to run on x64. rem rem 2005.12.07 Keith Marshall mailto:keithmarshall@users.sf.net rem * ``EXISTS %WD%\sh.exe'' should be ``EXISTS %WD%sh.exe''; corrected. rem * Modified Tuomo's patch, to avoid trashing Window settings in Win32. rem rem 2005.12.08 Tuomo Latto mailto:nonperson@users.sf.net rem * Keith's modified patch fails on x64; start did funny things. rem Reworked, for correct behaviour on both platforms. rem ---------- 8X ---------- End Clip ------------------ 6. Execute the "mingw_install.bat" command file. 7. After MinGW is installed, create a shortcut for the Desktop and/or Launch Bar for "msys.bat" and use one of the icons, all of which should now be in the "mingw" directory.