mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
Download app cleaned up
This commit is contained in:
parent
ffa8094a1d
commit
366a3676d8
1 changed files with 37 additions and 75 deletions
|
@ -6,99 +6,61 @@ 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
|
||||
|
||||
call ask_question "!install_process_prefix! %1 !install_process_sufix!"
|
||||
|
||||
if "%result%"=="true" (
|
||||
goto:exit_installation
|
||||
)
|
||||
|
||||
call print_dashed_seperator
|
||||
|
||||
if "%result%"=="false" (
|
||||
call 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!"
|
||||
%curl_app% -k %2 -o !install_file!
|
||||
|
||||
call get_local_text install-process-downloading
|
||||
echo %1 !install_process_downloading!
|
||||
set "install_file=%temp_directory%%1.%download_extension%"
|
||||
%curl_app% -k %2 -o !install_file!
|
||||
if "%download_extension%"=="zip" (
|
||||
set "package_path=!temp_directory!%1\"
|
||||
|
||||
pause
|
||||
if "%1"=="mongodb" (
|
||||
pause
|
||||
call get_local_text install-process-unzipping
|
||||
echo %1 !install_process_unzipping!
|
||||
%zu_app% x !install_file! -o!package_path! -y
|
||||
|
||||
set "package_path=!temp_directory!%1\"
|
||||
if exist "!package_path!" (
|
||||
rmdir /s /q !package_path!
|
||||
)
|
||||
for /f "delims=" %%a in ('dir !package_path! /on /ad /b') do @set mongodb_original_directory=%%a
|
||||
|
||||
%zu_app% x %install_file% -o%package_path% -y
|
||||
call print_dashed_seperator
|
||||
goto:get_mongodb_path
|
||||
|
||||
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%
|
||||
)
|
||||
: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
|
||||
goto:clean_up
|
||||
) else (
|
||||
if "%download_extension%"=="zip" (
|
||||
call get_local_text install-process-unzipping
|
||||
echo %1 !install_process_unzipping!
|
||||
md %mongodb_path%
|
||||
|
||||
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
|
||||
)
|
||||
%systemroot%\System32\xcopy %mongodb_original_directory% %path% /r /h /s /e /y
|
||||
goto:clean_up
|
||||
)
|
||||
|
||||
call get_local_text install-process-installing
|
||||
echo %1 !install_process_installing!
|
||||
echo.
|
||||
start /WAIT !install_file!
|
||||
goto:clean_up
|
||||
|
||||
:clean_up
|
||||
call get_local_text install-process-cleaning
|
||||
echo %1 !install_process_cleaning!
|
||||
rmdir /s /q "!temp_directory!"
|
||||
goto:exit_installation
|
||||
|
||||
call print_dashed_seperator
|
||||
goto:eof
|
||||
:exit_installation
|
||||
call print_dashed_seperator
|
Loading…
Add table
Add a link
Reference in a new issue