--- /dev/null
+@echo OFF\r
+::\r
+:: Setup wget first - this has to be done manually\r
+:: http://gnuwin32.sourceforge.net/packages/wget.htm\r
+:: http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-setup.exe\r
+::\r
+:: Simple script to check required built environment in default locations\r
+:: Versions downloaded are specified absolutely as otherwise it's tricky to try and work out the latest/stable version\r
+:: In principal the idea is to try and automate the process as much as possible\r
+::\r
+set PATH=%PATH%;%ProgramFiles%\GnuWin32\bin\r
+\r
+set MINGW=%SystemDrive%\MinGW\r
+set MINGW_BIN=%MinGW%\bin\r
+\r
+set ERRORLEVEL=0\r
+\r
+if not exist cache mkdir cache\r
+pushd cache\r
+\r
+echo =+=+=\r
+echo Checking mingw...\r
+echo =+=+=\r
+set MINGW_EXE=MinGW-5.1.6.exe\r
+set BIN_UTILS=binutils-2.19.1-mingw32-bin.tar.gz\r
+set GCC_CORE=gcc-core-3.4.5-20060117-3.tar.gz\r
+set GCC_GPP=gcc-g++-3.4.5-20060117-3.tar.gz\r
+set MINGWRTDLL=mingwrt-3.15.2-mingw32-dll.tar.gz\r
+set MINGWRTDEV=mingwrt-3.15.2-mingw32-dll.tar.gz\r
+set W32API=w32api-3.13-mingw32-dev.tar.gz\r
+\r
+if not exist "%MINGW_BIN%" (\r
+ :: Here we download all default components manually in an attempt to get autoinstall to work...\r
+ if not exist %MINGW_EXE% (\r
+ wget "http://sourceforge.net/projects/mingw/files/OldFiles/MinGW 5.1.6/%MINGW_EXE%"\r
+ )\r
+ if not exist %BIN_UTILS% (\r
+ wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/binutils/binutils-2.19.1/%BIN_UTILS%/download"\r
+ )\r
+ if not exist %GCC_CORE% (\r
+ wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version3/Current Release_ gcc-3.4.5-20060117-3/%GCC_CORE%/download"\r
+ )\r
+ if not exist %GCC_GPP% (\r
+ wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version3/Current Release_ gcc-3.4.5-20060117-3/%GCC_GPP%/download"\r
+ )\r
+ if not exist %MINGWRTDEV% (\r
+ wget http://sourceforge.net/projects/mingw/files/MinGW/Base/mingw-rt/mingwrt-3.15.2/%MINGWRTDEV%/download\r
+ )\r
+ if not exist %MINGWRTDLL% (\r
+ wget http://sourceforge.net/projects/mingw/files/MinGW/Base/mingw-rt/mingwrt-3.15.2/%MINGWRTDLL%/download\r
+ )\r
+ if not exist %W32API% (\r
+ wget http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/w32api-3.13/%W32API%/download\r
+ )\r
+ :: Can't get it to silent install. As a NSIS installer it supports /S, but it doesn't seem to work - it just hangs\r
+ :: Have to click through manually\r
+ %MINGW_EXE%\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking MSYS...\r
+echo =+=+=\r
+set MSYS_EXE=MSYS-1.0.11.exe\r
+if not exist "%SystemDrive%\msys" (\r
+ if not exist %MSYS_EXE% (\r
+ wget http://downloads.sourceforge.net/mingw/%MSYS_EXE%\r
+ )\r
+ if not [%WINELOADER%]==[] (\r
+ echo Running under WINE - Requires MSYS install fixes: run msys-pi-wine.sh when msys install halts..."\r
+ echo Ctrl-C to stop and then rerun the installation if necessary\r
+ )\r
+ %MSYS_EXE% /sp- /silent\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+:: We need a program to be able to extract not only zips, but bz2 and *lzma*\r
+set PATH=%PATH%;%ProgramFiles%\7-Zip\r
+echo =+=+=\r
+echo Checking 7Zip is Available...\r
+echo =+=+=\r
+set ZIP_INST=7z920.exe\r
+if not exist "%ProgramFiles%\7-Zip\7z.exe" (\r
+ if not exist %ZIP_INST% (\r
+ wget http://downloads.sourceforge.net/sevenzip/%ZIP_INST%\r
+ )\r
+ %ZIP_INST% /S\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+::\r
+echo =+=+=\r
+echo Checking gtk+-bundle...\r
+echo =+=+=\r
+set GTK_ZIP=gtk+-bundle_2.24.10-20120208_win32.zip\r
+if not exist "%MINGW_BIN%\gtk-update-icon-cache.exe" (\r
+ if not exist %GTK_ZIP% (\r
+ wget http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/%GTK_ZIP%\r
+ )\r
+ 7z x %GTK_ZIP% -o"%MinGW%"\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+set EXPAT_ZIP=expat-dev_2.0.1-1_win32.zip\r
+echo =+=+=\r
+echo Checking expat-dev...\r
+echo =+=+=\r
+if not exist "%MINGW%\include\expat.h" (\r
+ if not exist %EXPAT_ZIP% (\r
+ wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%EXPAT_ZIP%\r
+ )\r
+ 7z x %EXPAT_ZIP% -o"%MinGW%"\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+set GTT_ZIP=gettext-tools-dev_0.18.1.1-2_win32.zip\r
+echo =+=+=\r
+echo Checking gettext-tools-dev...\r
+echo =+=+=\r
+if not exist "%MINGW_BIN%\libgettextlib-0-18-1.dll" (\r
+ if not exist %GTT_ZIP% (\r
+ wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%GTT_ZIP%\r
+ )\r
+ 7z x -y %GTT_ZIP% -o"%MinGW%"\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking intltool...\r
+echo =+=+=\r
+set INTLTOOL_ZIP=intltool_0.40.4-1_win32.zip\r
+if not exist "%MINGW_BIN%\intltoolize" (\r
+ if not exist %INTLTOOL_ZIP% (\r
+ wget http://ftp.acc.umu.se/pub/GNOME/binaries/win32/intltool/0.40/%INTLTOOL_ZIP%\r
+ )\r
+ 7z x %INTLTOOL_ZIP% -o"%MinGW%"\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking iconv...\r
+echo =+=+=\r
+set ICONV_ZIP=libiconv-1.9.2-1-bin.zip\r
+if not exist "%MINGW_BIN%\iconv.exe" (\r
+ if not exist %ICONV_ZIP% (\r
+ wget http://sourceforge.net/projects/gnuwin32/files/libiconv/1.9.2-1/%ICONV_ZIP%\r
+ )\r
+ 7z x -y %ICONV_ZIP% -o"%MinGW%"\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking libintl...\r
+echo =+=+=\r
+:: Needed by iconv\r
+set LIBINTL_ZIP=libintl-0.14.4-bin.zip\r
+if not exist "%MINGW_BIN%\libintl3.dll" (\r
+ if not exist %LIBINTL_ZIP% (\r
+ wget http://sourceforge.net/projects/gnuwin32/files/libintl/0.14.4/%LIBINTL_ZIP%\r
+ )\r
+ 7z x -y %LIBINTL_ZIP% -o"%MinGW%"\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking libcurl...\r
+echo =+=+=\r
+set CURL_TAR=libcurl-7.14.0_nossl-1sid.tar\r
+set CURL_BZ2=%CURL_TAR%.bz2\r
+if not exist "%MINGW_BIN%\libcurl.dll" (\r
+ if not exist %CURL_BZ2% (\r
+ wget http://downloads.sourceforge.net/devpaks/libcurl-7.14.0_nossl-1sid.DevPak?download\r
+ move libcurl-7.14.0_nossl-1sid.DevPak %CURL_BZ2%\r
+ )\r
+ echo Extracting libcurl...\r
+ 7z e %CURL_BZ2%\r
+ 7z x %CURL_TAR% -o"libcurl"\r
+ if ERRORLEVEL 1 goto Error\r
+ @echo ON\r
+ move libcurl\include "%MinGW%\include\curl\r
+ copy /Y libcurl\bin\*.* "%MinGW_BIN%"\r
+ copy /Y libcurl\lib\*.* "%MinGW%\lib"\r
+ copy /Y libcurl\docs\*.* "%MinGW%\doc"\r
+ rmdir /S /Q libcurl\r
+ del %CURL_TAR%\r
+ @echo OFF\r
+)\r
+\r
+echo =+=+=\r
+echo Checking libexif...\r
+echo =+=+=\r
+set EXIF=libexif-0.6.20_winxp_mingw\r
+set EXIF_7Z=%EXIF%.7z\r
+if not exist "%MINGW_BIN%\libexif-12.dll" (\r
+ if not exist %EXIF_7Z% (\r
+ wget "http://sourceforge.net/projects/maille/files/Extern libs/%EXIF_7Z%/download"\r
+ )\r
+ echo Extracting libexif...\r
+ 7z x %EXIF_7Z%\r
+ if ERRORLEVEL 1 goto Error\r
+\r
+ echo Using *xcopy* (to get all subdirs) libexif into place...\r
+ @echo ON\r
+ xcopy /Y /S %EXIF%\*.* "%MinGW%"\r
+ rmdir /S /Q %EXIF%\r
+ @echo OFF\r
+)\r
+\r
+echo =+=+=\r
+echo Checking libstdc++...\r
+echo =+=+=\r
+set STDCPP_TAR=libstdc++-4.6.2-1-mingw32-dll-6.tar\r
+set STDCPP_LZ=%STDCPP_TAR%.lzma\r
+if not exist "%MINGW_BIN%\libstdc++-6.dll" (\r
+ if not exist %STDCPP_LZ% (\r
+ wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.6.2-1/%STDCPP_LZ%\r
+ )\r
+ echo Extracting lidstdc++...\r
+ 7z e %STDCPP_LZ%\r
+ 7z x %STDCPP_TAR% -o"%MinGW%"\r
+ if ERRORLEVEL 1 goto Error\r
+ del %STDCPP_TAR%\r
+)\r
+\r
+echo =+=+=\r
+echo Checking Gnome Doc Utils...\r
+echo =+=+=\r
+set GNOME_DOC_ZIP=gnome-doc-utils-0.12.0.zip\r
+if not exist "%MINGW_BIN%\gnome-doc-prepare" (\r
+ if not exist %GNOME_DOC_ZIP% (\r
+ wget http://ftp.gnome.org/pub/gnome/binaries/win32/gnome-doc-utils/0.12/%GNOME_DOC_ZIP%\r
+ )\r
+ echo Extracting Gnome Doc Utils...\r
+ 7z x %GNOME_DOC_ZIP% -o"%MinGW%"\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+:: Note GPSBabel can not be directly downloaded via wget\r
+:: ATM get it manually from here:\r
+:: http://www.gpsbabel.org/download.html\r
+set GPSBABEL_INST=GPSBabel-1.4.4-Setup.exe\r
+if not exist "%ProgramFiles%\GPSBabel" (\r
+ echo Installing GPSBabel...\r
+ if exist %GPSBABEL_INST% (\r
+ %GPSBABEL_INST% /silent\r
+ if ERRORLEVEL 1 goto Error\r
+ )\r
+)\r
+\r
+echo =+=+=\r
+echo Checking Perl Installation...\r
+echo =+=+=\r
+set PERL_MSI=ActivePerl-5.14.3.1404-MSWin32-x86-296513.msi\r
+if not exist "%SystemDrive%\Perl" (\r
+ if not exist %PERL_MSI% (\r
+ wget http://downloads.activestate.com/ActivePerl/releases/5.14.3.1404/%PERL_MSI%\r
+ )\r
+ echo Installing Perl takes a little time...\r
+ msiexec /qb /i %PERL_MSI% PERL_PATH=Yes PERL_EXT=Yes\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking NSIS installed...\r
+echo =+=+=\r
+set NSIS_INST=nsis-2.46-setup.exe\r
+if not exist "%ProgramFiles%\NSIS" (\r
+ if not exist %NSIS_INST% (\r
+ wget http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download\r
+ )\r
+ echo Installing NSIS...\r
+ %NSIS_INST% /S\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking NSIS Plugins installed...\r
+echo =+=+=\r
+set FPDLLZIP=FindProc.zip\r
+if not exist "%ProgramFiles%\NSIS\Plugins\FindProcDLL.dll" (\r
+ if not exist %FPDLLZIP% (\r
+ wget http://nsis.sourceforge.net/mediawiki/images/3/3c/%FPDLLZIP%\r
+ )\r
+ echo Extracting NSIS Plugins...\r
+ 7z e %FPDLLZIP% -o"%ProgramFiles%\NSIS\Plugins"\r
+ if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+popd\r
+\r
+echo Fixing Perl reference\r
+REM Sadly '-i' for in place changes doesn't seem available with Windows sed 3.02\r
+set PATH=%PATH%;C:\msys\1.0\bin\r
+sed -e 's:#! /bin/perl:#! /opt/perl/bin/perl:' %MINGW_BIN%\glib-mkenums > tmp.enums\r
+if ERRORLEVEL 1 goto Error\r
+xcopy /Y tmp.enums %MINGW_BIN%\glib-mkenums\r
+if ERRORLEVEL 1 goto Error\r
+del tmp.enums\r
+\r
+:: Potentially Clean Up\r
+:: If any parameters given on the command line then remove all downloaded items\r
+:Clean\r
+if not [%1]==[] (\r
+ echo Removing downloaded files\r
+ if exist cache rmdir /S /Q cache\r
+)\r
+\r
+goto End\r
+\r
+:Error\r
+echo exitting due to error: %ERRORLEVEL%\r
+exit\r
+\r
+:End\r
+echo Finished\r