@if defined debug (echo on) else (echo off) @if defined _debug (echo on) else (echo off) :: See http://www.develer.com/oss/GccWinBinaries set MINGW_ROOT=c:\mingw set MSYS_ROOT=c:\msys set SOURCEFORGE_MIRROR=easynews set CACLS=cacls set SEVENZIP=c:\Progra~1\7-Zip\7z set WGET=wget for %%A in (%SEVENZIP%) do PATH=%%~pA;%PATH% copy /y nul nul >nul 2>nul %CACLS% /help >nul 2>nul if errorlevel 9009 ( echo %~nx0: cacls is not in your PATH. goto :eof ) %SEVENZIP% >nul 2>nul if errorlevel 9009 ( echo %~nx0: Please download and install 7z into %SEVENZIP% echo Visit http://www.7-zip.org/download.html goto :eof ) %WGET% --version >nul 2>nul if errorlevel 9009 ( echo %~nx0: Please download and install wget into your PATH. echo Visit http://users.ugent.be/~bpuype/wget/#download goto :eof ) set urls= set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/tdm-gcc/gcc-4.3.1-tdm-1-core.tar.gz set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/tdm-gcc/gcc-4.3.1-tdm-1-g++.tar.gz set urls=%urls% http://farfetch.intrepid.cx/gcc-4.1.2-mingw-setup.exe :: current release set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.4.exe set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/MSYS-1.0.10.exe set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/binutils-2.17.50-20060824-1.tar.gz set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/mingw-runtime-3.14.tar.gz set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/w32api-3.11.tar.gz set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/mingw-utils-0.3.tar.gz set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/mingw32-make-3.81-20080326-3.tar.gz ::set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/gdb-5.2.1-1.exe :: latest release: ::set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/binutils-2.18.50-20080109-2.tar.gz set urls=%urls% http://%SOURCEFORGE_MIRROR%.dl.sourceforge.net/sourceforge/mingw/gdb-6.8-mingw-3.tar.bz2 for %%A in (%urls%) do ( copy /y nul nul >nul 2>nul if not exist "%%~nxA" %WGET% "%%~A" if errorlevel 1 ( echo %~nx0: wget failed goto :eof ) if not exist "%%~nxA" ( echo %~nx0: wget failed goto :eof ) ) for %%A in (*.exe) do %CACLS% "%%~A" /C /E /G "%USERNAME%":F copy /y nul nul >nul 2>nul .\gcc-4.1.2-mingw-setup.exe /NOCANCEL /NORESTART /SILENT /SP- /LOG="gcc-4.1.2-mingw-setup.log" if errorlevel 1 ( echo %~nx0: gcc-4.1.2-mingw-setup.exe failed goto :eof ) if not exist "%MINGW_ROOT%" ( echo %~nx0: Directory not found: "%MINGW_ROOT%" goto :eof ) for %%A in (%urls%) do ( if "%%~xA" == ".7z" ( for %%B in (%%~A) do echo %SEVENZIP% x -y -o"%MINGW_ROOT%" "%%~nxB" for %%B in (%%~A) do %SEVENZIP% x -y -o"%MINGW_ROOT%" "%%~nxB" if errorlevel 1 ( echo %~nx0: %SEVENZIP% x -y "%%~nxB" failed goto :eof ) ) if "%%~xA" == ".gz" ( for %%B in (%%~A) do echo %SEVENZIP% x -y -o"%TEMP%" "%%~nxB" for %%B in (%%~A) do %SEVENZIP% x -y -o"%TEMP%" "%%~nxB" if errorlevel 1 ( echo %~nx0: %SEVENZIP% x -y -o"%TEMP%" "%%~nxB" failed goto :eof ) for %%C in (%%A) do %SEVENZIP% x -y -o"%MINGW_ROOT%" "%TEMP%\%%~nC" if errorlevel 1 ( echo %~nx0: %SEVENZIP% x -y -o"%MINGW_ROOT%" "%TEMP%\%%~nC" failed goto :eof ) for %%C in (%%A) do del /f "%TEMP%\%%~nC" ) if "%%~xA" == ".bz2" ( for %%B in (%%~A) do echo %SEVENZIP% x -y -o"%TEMP%" "%%~nxB" for %%B in (%%~A) do %SEVENZIP% x -y -o"%TEMP%" "%%~nxB" if errorlevel 1 ( echo %~nx0: %SEVENZIP% x -y -o"%TEMP%" "%%~nxB" failed goto :eof ) for %%C in (%%A) do %SEVENZIP% x -y -o"%MINGW_ROOT%" "%TEMP%\%%~nC" if errorlevel 1 ( echo %~nx0: %SEVENZIP% x -y -o"%MINGW_ROOT%" "%TEMP%\%%~nC" failed goto :eof ) for %%C in (%%A) do del /f "%TEMP%\%%~nC" ) ) .\MSYS-1.0.10.exe /NOCANCEL /NORESTART /SILENT /SP- /LOG="MSYS-1.0.10.exe.log" || goto :eof if not exist %MSYS_ROOT% goto :eof echo %~nx0: Directory not found: "%MSYS_ROOT%" goto :eof )