Advertisement
overloop

mingw32-4.6.2.bat

Sep 14th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.15 KB | None | 0 0
  1. @echo off
  2.  
  3. set MINGW-ROOT=C:\MinGW
  4. set PATH=%PATH%;C:\Program Files\7-Zip;%~dp0
  5.  
  6. if not exist "%MINGW-ROOT%" mkdir "%MINGW-ROOT%"
  7. if not exist "%MINGW-ROOT%" goto error-notroot
  8.  
  9. if exist "%MINGW-ROOT%\bin" goto skip-extracting
  10.  
  11. 7z.exe x -o"%MINGW-ROOT%" "%~dp0\mingw32-4.6.2.zip"
  12.  
  13. if not exist "%MINGW-ROOT%\bin" goto error-no7z
  14.  
  15. :skip-extracting
  16. "%MINGW-ROOT%\bin\mingw-get.exe" install "gcc-c++=4.6.2-1"
  17. "%MINGW-ROOT%\bin\mingw-get.exe" install "mingw32-make=3.82.90-2"
  18.  
  19. if not exist "%MINGW-ROOT%\bin\g++.exe" goto error-nogcc
  20. if not exist "%MINGW-ROOT%\bin\mingw32-make.exe" goto error-nomake
  21.  
  22. echo installation successfully complete
  23. echo add %MINGW-ROOT%\bin to PATH environment variable (advanced tab on system settings dialog)
  24. echo create environment variable MAKE_COMMAND=mingw32-make -j4
  25. sysdm.cpl
  26.  
  27. goto end
  28.  
  29. :error-notroot
  30. echo ERROR: have no rights to create directory %MINGW-ROOT%, run script as admin, please
  31. goto end
  32.  
  33. :error-no7z
  34. echo ERROR: can't see 7z.exe around, install 7z, please
  35. goto end
  36.  
  37. :error-nogcc
  38. echo ERROR: g++ was not installed
  39. goto end
  40.  
  41. :error-nomake
  42. echo ERROR: make was not installed
  43. goto end
  44.  
  45. :end
  46. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement