2014-01-30 15:36:40 -05:00
|
|
|
@echo off
|
|
|
|
setlocal
|
|
|
|
|
|
|
|
:: Global Variables
|
|
|
|
set "temp-dir=C:\Coco-Temp"
|
|
|
|
set install-log=%temp-dir%\coco-dev-install-log.txt
|
2014-01-30 16:09:32 -05:00
|
|
|
set "tab-string= "
|
2014-01-30 16:17:48 -05:00
|
|
|
set "seperator-string=----------------------------------------------------------------------------"
|
|
|
|
set "seperator-string-cmd=-------------------------------------------"
|
2014-01-30 15:36:40 -05:00
|
|
|
|
|
|
|
:: Create The Temporary Directory
|
|
|
|
IF EXIST %temp-dir% rmdir %temp-dir% /s /q
|
|
|
|
mkdir %temp-dir%
|
|
|
|
|
|
|
|
:: Create Log File
|
|
|
|
copy /y nul %install-log% > nul
|
|
|
|
|
2014-01-30 16:17:48 -05:00
|
|
|
echo Full-Automatic Install of the CodeCombat Dev. Environment has begun...
|
|
|
|
echo This can take a wile... Please stay tuned...
|
|
|
|
echo Don't close any windows please...!
|
|
|
|
echo %seperator-string-cmd%
|
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
|
|
|
echo Full-Automatic Install has begun... Don't close any windows please! >> %install-log%
|
|
|
|
echo %seperator-string% >> %install-log%
|
|
|
|
|
|
|
|
:: downloads for all version...
|
|
|
|
|
|
|
|
:: [TODO] The choice between Cygwin && Git ?! Is
|
|
|
|
echo downloading: Git... >> %install-log%
|
|
|
|
echo %seperator-string% >> %install-log%
|
|
|
|
curl https://msysgit.googlecode.com/files/Git-1.8.5.2-preview20131230.exe -o %temp-dir%\git-setup.exe
|
2014-01-30 15:36:40 -05:00
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
:: [TODO] Add downloads for windows visual studio ?!
|
2014-01-30 15:36:40 -05:00
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
|
|
|
|
:: architecture specific downloads...
|
2014-01-30 15:36:40 -05:00
|
|
|
IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT)
|
|
|
|
|
|
|
|
:64BIT
|
2014-01-30 16:09:32 -05:00
|
|
|
echo 32-bit computer detected... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %tab-string%downloading: node-js... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
curl http://nodejs.org/dist/v0.10.24/x64/node-v0.10.24-x64.msi -o %temp-dir%\node-js-setup.exe
|
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %tab-string%downloading: ruby... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
curl http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353-x64.exe?direct -o %temp-dir%\ruby-setup.exe
|
|
|
|
|
|
|
|
:: Some installations require specific windows versions
|
|
|
|
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
|
2014-01-30 16:09:32 -05:00
|
|
|
if "%version%" == "5.2" (
|
|
|
|
echo %tab-string%Windows XP detected... >> %install-log%
|
|
|
|
GOTO ver_XP_64
|
|
|
|
)
|
|
|
|
if "%version%" == "6.0" (
|
|
|
|
echo %tab-string%Windows Vista detected... >> %install-log%
|
|
|
|
GOTO ver_Vista_64
|
|
|
|
)
|
|
|
|
if "%version%" == "6.1" (
|
|
|
|
echo %tab-string%Windows 7 detected... >> %install-log%
|
|
|
|
GOTO ver_Win7_8_64
|
|
|
|
)
|
|
|
|
if "%version%" == "6.2" (
|
|
|
|
echo %tab-string%Windows 8.0 detected... >> %install-log%
|
|
|
|
GOTO ver_Win7_8_64
|
|
|
|
)
|
|
|
|
if "%version%" == "6.3" (
|
|
|
|
echo %tab-string%Windows 8.1 detected... >> %install-log%
|
|
|
|
GOTO ver_Win7_8_64
|
|
|
|
)
|
2014-01-30 15:36:40 -05:00
|
|
|
|
|
|
|
GOTO warn_and_exit
|
|
|
|
GOTO END
|
|
|
|
|
|
|
|
:32BIT
|
2014-01-30 16:09:32 -05:00
|
|
|
echo 64-bit computer detected... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %tab-string%downloading: node-js... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
curl http://nodejs.org/dist/v0.10.24/node-v0.10.24-x86.msi -o %temp-dir%\node-js-setup.exe
|
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %tab-string%downloading: ruby... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
curl http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353.exe?direct -o %temp-dir%\ruby-setup.exe
|
|
|
|
|
|
|
|
:: Some installations require specific windows versions
|
|
|
|
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
|
2014-01-30 16:09:32 -05:00
|
|
|
|
|
|
|
if "%version%" == "5.1" (
|
|
|
|
echo %tab-string%Windows XP detected... >> %install-log%
|
|
|
|
GOTO ver_XP_32
|
|
|
|
)
|
|
|
|
if "%version%" == "6.0" (
|
|
|
|
echo %tab-string%Windows Vista detected... >> %install-log%
|
|
|
|
GOTO ver_Vista_32
|
|
|
|
)
|
|
|
|
if "%version%" == "6.1" (
|
|
|
|
echo %tab-string%Windows 7 detected... >> %install-log%
|
|
|
|
GOTO ver_Win7_8_32
|
|
|
|
)
|
|
|
|
if "%version%" == "6.2" (
|
|
|
|
echo %tab-string%Windows 8.0 detected... >> %install-log%
|
|
|
|
GOTO ver_Win7_8_32
|
|
|
|
)
|
|
|
|
if "%version%" == "6.3" (
|
|
|
|
echo %tab-string%Windows 8.1 detected... >> %install-log%
|
|
|
|
GOTO ver_Win7_8_32
|
|
|
|
)
|
2014-01-30 15:36:40 -05:00
|
|
|
|
|
|
|
GOTO warn_and_exit
|
|
|
|
GOTO END
|
|
|
|
|
|
|
|
:ver_Win7_8_32
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %tab-string%%tab-string%downloading: mongo-db... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
curl http://fastdl.mongodb.org/win32/mongodb-win32-i386-2.5.4.zip -o %temp-dir%\mongodb-setup.zip
|
|
|
|
goto instal_dev_environment
|
|
|
|
|
|
|
|
:ver_Vista_32
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %tab-string%%tab-string%downloading: mongo-db... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
curl http://fastdl.mongodb.org/win32/mongodb-win32-i386-2.5.4.zip -o %temp-dir%\mongodb-setup.zip
|
|
|
|
goto instal_dev_environment
|
|
|
|
|
|
|
|
:ver_XP_32
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
echo Sadly we can't support Windows XP... Please upgrade your OS! >> %install-log%
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
goto END
|
|
|
|
|
|
|
|
:ver_Win7_8_64
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %tab-string%%tab-string%downloading: mongo-db... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
curl http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.5.4.zip -o %temp-dir%\mongodb-setup.zip
|
|
|
|
goto instal_dev_environment
|
|
|
|
|
|
|
|
:ver_Vista_64
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %tab-string%%tab-string%downloading: mongo-db... >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
curl http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2.5.4.zip -o %temp-dir%\mongodb-setup.zip
|
|
|
|
goto instal_dev_environment
|
|
|
|
|
|
|
|
:ver_XP_64
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
echo Sadly we can't support Windows XP... Please upgrade your OS! >> %install-log%
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
goto END
|
|
|
|
|
|
|
|
:instal_dev_environment
|
2014-01-30 16:17:48 -05:00
|
|
|
echo %seperator-string-cmd%
|
|
|
|
echo Downloads complete...
|
|
|
|
echo Installation of the software begins now...
|
|
|
|
echo %seperator-string-cmd%
|
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
|
|
|
echo Downloads complete... Moving on to the installation! >> %install-log%
|
|
|
|
echo %seperator-string% >> %install-log%
|
|
|
|
goto git_rep_checkout
|
|
|
|
|
|
|
|
:git_rep_checkout
|
2014-01-30 16:17:48 -05:00
|
|
|
echo %seperator-string-cmd%
|
|
|
|
echo Software has been installed...
|
|
|
|
echo Checking out the Git Repository....
|
|
|
|
echo %seperator-string-cmd%
|
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
|
|
|
echo Software Installations Complete... Moving on to the Code Combat Repository Checkout! >> %install-log%
|
|
|
|
echo %seperator-string% >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
goto report_ok
|
|
|
|
|
|
|
|
:report_ok
|
2014-01-30 16:17:48 -05:00
|
|
|
echo %seperator-string-cmd%
|
|
|
|
echo Installation of the Developers Environment is complete!
|
|
|
|
echo Bye Bye!
|
|
|
|
echo %seperator-string-cmd%
|
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
echo Installation of the Windows CodeCombat Developers environment succesfull... >> %install-log%
|
|
|
|
echo Thank you in advance for your contribution! >> %install-log%
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
goto clean_up
|
|
|
|
|
|
|
|
:warn_and_exit
|
2014-01-30 16:17:48 -05:00
|
|
|
echo %seperator-string-cmd%
|
|
|
|
echo OS Cannot be determined...
|
|
|
|
echo %seperator-string-cmd%
|
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
2014-01-30 15:36:40 -05:00
|
|
|
echo Machine OS cannot be determined... >> %install-log%
|
|
|
|
echo Report your OS to the developers @ CodeCombat.com... >> %install-log%
|
2014-01-30 16:09:32 -05:00
|
|
|
echo %seperator-string% >> %install-log%
|
2014-01-30 16:17:48 -05:00
|
|
|
goto error_report
|
|
|
|
|
|
|
|
:error_report
|
|
|
|
echo Installation has been stopped...
|
|
|
|
echo Please check the log file for details!
|
|
|
|
PAUSE
|
2014-01-30 15:36:40 -05:00
|
|
|
goto END
|
|
|
|
|
|
|
|
:: Clean Up The Mess
|
|
|
|
:clean_up
|
2014-01-30 16:09:32 -05:00
|
|
|
echo ... Cleaning up has been disabled... Terminating Script! >> %install-log%
|
|
|
|
echo %seperator-string% >> %install-log%
|
|
|
|
::rmdir %temp-dir% /s /q
|
2014-01-30 15:36:40 -05:00
|
|
|
goto END
|
|
|
|
|
|
|
|
:END
|
|
|
|
|
|
|
|
endlocal
|