mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
buggy version of installation works.
This commit is contained in:
parent
b3c28028c8
commit
de7a717b16
5 changed files with 90 additions and 3 deletions
|
@ -14,6 +14,10 @@
|
|||
4=Cancel the installation if you already have the application.
|
||||
prefix=Do you already have the latest version of
|
||||
sufix=installed?
|
||||
downloading=is downloading...
|
||||
installing=is installing...
|
||||
unzipping=is unzipping...
|
||||
cleaning=is cleaning...
|
||||
[end]
|
||||
succesfull=The setup of the CodeCombat Dev. Environment was succesfull.
|
||||
thankyou=Thank you already for your contribution and see you soon.
|
|
@ -14,6 +14,10 @@
|
|||
4=Annuleer de installatie als je de applicatie al hebt.
|
||||
prefix=Heb je al de laatste versie van
|
||||
sufix=geinstalleerd?
|
||||
downloading=is aan het downloaden...
|
||||
installing=is aan het installeren...
|
||||
unzipping=is aan het uitpakken...
|
||||
cleaning=is aan het opkuisen...
|
||||
[end]
|
||||
succesfull=De installatie van de CodeCombat-Ontwikkelings omgeving was succesvol.
|
||||
thankyou=Alvast bedankt voor al je werk en tot binnenkort.
|
|
@ -1,7 +1,9 @@
|
|||
set "temp_directory=C:\\.coco\\"
|
||||
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%"
|
||||
md %temp_directory%
|
||||
)
|
||||
|
||||
call get_local_text install-process-prefix
|
||||
|
@ -10,4 +12,42 @@ call get_local_text install-process-sufix
|
|||
call ask_question "!install_process_prefix! %1 !install_process_sufix!"
|
||||
call print_dashed_seperator
|
||||
|
||||
rmdir /s /q "%temp_directory%"
|
||||
if "%result%"=="false" (
|
||||
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!
|
||||
|
||||
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!
|
||||
)
|
||||
)
|
||||
|
||||
call get_local_text install-process-cleaning
|
||||
echo %1 !install_process_cleaning!
|
||||
rmdir /s /q "!temp_directory!"
|
||||
|
||||
call print_dashed_seperator
|
3
scripts/windows/coco-dev-setup/batch/scripts/get_extension.bat
Executable file
3
scripts/windows/coco-dev-setup/batch/scripts/get_extension.bat
Executable file
|
@ -0,0 +1,3 @@
|
|||
for /f "delims=" %%a in ('..\\utilities\\get_extension.exe %1 %2') do (
|
||||
%%a
|
||||
)
|
36
scripts/windows/coco-dev-setup/src/get_extension.cpp
Executable file
36
scripts/windows/coco-dev-setup/src/get_extension.cpp
Executable file
|
@ -0,0 +1,36 @@
|
|||
#include "stdafx.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#define tstring std::wstring
|
||||
#define tcout std::wcout
|
||||
|
||||
int ErrorReport(const tstring & str, int value = 0)
|
||||
{
|
||||
tcout << str.c_str();
|
||||
return value;
|
||||
}
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
if(argc == 1)
|
||||
return ErrorReport(L"Please specify a download URL.");
|
||||
if(argc == 2)
|
||||
return ErrorReport(L"Please specify a name for your variable.");
|
||||
|
||||
tstring url, name, extension;
|
||||
url = argv[1];
|
||||
name = argv[2];
|
||||
|
||||
if(url.find(L"exe") != tstring::npos) extension = L"exe";
|
||||
else if(url.find(L"msi") != tstring::npos) extension = L"msi";
|
||||
else if(url.find(L"zip") != tstring::npos) extension = L"zip";
|
||||
|
||||
tcout << L"set \"" << name << L"=";
|
||||
tcout << extension << L"\"";
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue