@echo off

set platform=x64
if NOT EXIST "%ProgramFiles(x86)%" set platform=x86

echo.
echo Installing UConn GitHub for Windows...
echo.

rem Prompt for Name and Email.
echo.
echo You need to enter some information so Git can be configured for you.
echo.
set /P name=Please enter your name: 
set /P email=Please enter your email address: 

rem Install Programs.
echo.
echo Installing Git...
start /w Git-1.8.0-preview20121022.exe /silent
echo Installing GitExtensions...
start /w msiexec /I GitExtensions243SetupComplete.msi SSHCLIENT="OpenSSH" INSTALLMSYSGIT="0" INSTALLKDIFF3="0" ALLUSERS="1" /quiet /passive
echo Installing KDiff3...
start /w KDiff3-32bit-Setup_0.9.97.exe /S

if "%platform%"=="x64" goto path64
goto path86

:path64
set GITPATH=C:\Program Files (x86)\Git\bin
goto :path

:path86
set GITPATH=C:\Program Files\Git\bin
goto :path

:path
setx PATH "%PATH%;%GITPATH%" -m >NUL

rem SET GIT CONFIGURATION
:config
"%GITPATH%\git" config --global core.editor notepad.exe
"%GITPATH%\git" config --global core.name %name%
"%GITPATH%\git" config --global core.email %email%

:finish
echo.
echo Done!  You can now close this window and start using Git and UConn GitHub.
echo Be sure to visit http://github.uconn.edu to get started!
echo.

pause >NUL