diff --git a/scripts/windows/coco-dev-setup/batch/config/downloads.coco b/scripts/windows/coco-dev-setup/batch/config/downloads.coco index 2837959f7..6f4d23b22 100755 --- a/scripts/windows/coco-dev-setup/batch/config/downloads.coco +++ b/scripts/windows/coco-dev-setup/batch/config/downloads.coco @@ -2,11 +2,11 @@ [32] nodejs=http://nodejs.org/dist/v0.10.25/node-v0.10.25-x86.msi ruby=http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353.exe?direct - python=http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi + python=https://www.python.org/ftp/python/2.7.6/python-2.7.6.msi [64] nodejs=http://nodejs.org/dist/v0.10.25/x64/node-v0.10.25-x64.msi ruby=http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353-x64.exe?direct - python=http://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi + python=https://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi winsdk=http://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/winsdk_web.exe [general] gitbash=https://msysgit.googlecode.com/files/Git-1.8.5.2-preview20131230.exe diff --git a/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_app.bat b/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_app.bat index c2dc4c834..8d505cbfb 100755 --- a/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_app.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_app.bat @@ -1,11 +1,23 @@ -set "temp_directory=c:\\.coco\\" -set "curl_app=..\\utilities\\curl.exe" -set "zu_app=..\\utilities\\7za.exe" +set "temp_directory=c:\.coco\" +set "curl_app=..\utilities\curl.exe" +set "zu_app=..\utilities\7za.exe" if NOT exist "%temp_directory%" ( md %temp_directory% ) +:: ================================================================= +:: NOTE +:: ----------------------------------------------------------------- +:: For now only mongodb is downloaded in packaged format +:: Mongodb doesn't require any packaging so we just hardcode +:: the exception in this file. + +:: If we have ever another install file, that is packaged, +:: We'll have to make sure that mongodb is handled as an exception, +:: rather than that it's behaviour is the default for zip files. +:: ================================================================= + call get_local_text install-process-prefix call get_local_text install-process-sufix @@ -13,41 +25,80 @@ call ask_question "!install_process_prefix! %1 !install_process_sufix!" call print_dashed_seperator if "%result%"=="false" ( - get_extension %2 download_extension + call get_extension %2 download_extension call get_local_text install-process-downloading echo %1 !install_process_downloading! - set "install_file=!temp_directory!%1.!download_extension!" + set "install_file=%temp_directory%%1.%download_extension%" %curl_app% -k %2 -o !install_file! - if "%download_extension%"=="zip" ( + pause + if "%1"=="mongodb" ( + pause call get_local_text install-process-unzipping echo %1 !install_process_unzipping! - set "package_path=!temp_directory!%1\\" + set "package_path=!temp_directory!%1\" if exist "!package_path!" ( rmdir /s /q !package_path! ) - %zu_app% x !install_file! -o!package_path! - pause - ) + %zu_app% x %install_file% -o%package_path% -y - call get_local_text install-process-installing - echo %1 !install_process_installing! - echo. - if "%download_extension%"=="zip" ( - for /f "tokens=*" %%a in ( dir %package_path% /b *.exe' ) do ( - set unpacked_installed_file=%%a + for /f "delims=" %%a in ('dir %package_path% /on /ad /b') do @set mongodb_original_directory=%%a + + call print_dashed_seperator + goto:get_mongodb_path + + :get_mongodb_path + set /p "mongodb_path=define path: " + if exist "%mongodb_path%" ( + call ask_question "That path already exists, are you sure you want to overwrite it?" + if "%result%"=="false" ( + call print_dashed_seperator + goto:get_mongodb_path + ) else ( + rmdir /s /q %mongodb_path% + ) + ) + md %mongodb_path% ) - start /WAIT %unpacked_installed_file% + %systemroot%\System32\xcopy %mongodb_original_directory% %path% /r /h /s /e /y + goto:clean_up ) else ( - start /WAIT !install_file! + if "%download_extension%"=="zip" ( + call get_local_text install-process-unzipping + echo %1 !install_process_unzipping! + + set "package_path=!temp_directory!%1\\" + if exist "!package_path!" ( + rmdir /s /q !package_path! + ) + + %zu_app% x !install_file! -o!package_path! + pause + ) + + call get_local_text install-process-installing + echo %1 !install_process_installing! + echo. + if "%download_extension%"=="zip" ( + for /f "tokens=*" %%a in ( dir %package_path% /b *.exe' ) do ( + set unpacked_installed_file=%%a + ) + start /WAIT %unpacked_installed_file% + ) else ( + start /WAIT !install_file! + ) + + goto:clean_up ) ) -call get_local_text install-process-cleaning -echo %1 !install_process_cleaning! -rmdir /s /q "!temp_directory!" +:clean_up + call get_local_text install-process-cleaning + echo %1 !install_process_cleaning! + rmdir /s /q "!temp_directory!" -call print_dashed_seperator \ No newline at end of file + call print_dashed_seperator +goto:eof \ No newline at end of file diff --git a/scripts/windows/coco-dev-setup/batch/scripts/package_install_test.bat b/scripts/windows/coco-dev-setup/batch/scripts/package_install_test.bat new file mode 100755 index 000000000..2190151ab --- /dev/null +++ b/scripts/windows/coco-dev-setup/batch/scripts/package_install_test.bat @@ -0,0 +1,35 @@ +@echo off +setlocal EnableDelayedExpansion +set "temp_directory=c:\.coco\" +set "curl_app=..\utilities\curl.exe" +set "zu_app=..\utilities\7za.exe" + +set "install_file=c:\.coco\mongodb.zip" +set "package_path=%temp_directory%mongodb" + +%zu_app% x %install_file% -o%package_path% -y + +for /f "delims=" %%a in ('dir %package_path% /on /ad /b') do @set mongodb_original_directory=%%a + +call print_dashed_seperator +goto:get_mongodb_path + +:get_mongodb_path + set /p "mongodb_path=define path: " + if exist "%mongodb_path%" ( + call ask_question "That path already exists, are you sure you want to overwrite it?" + if "%result%"=="false" ( + call print_dashed_seperator + goto:get_mongodb_path + ) else ( + rmdir /s /q %mongodb_path% + ) + ) + md %mongodb_path% +) + +%systemroot%\System32\xcopy %mongodb_original_directory% %path% /r /h /s /e /y + +pause + +endlocal \ No newline at end of file