2014-01-30 15:36:40 -05:00
|
|
|
@echo off
|
2014-02-02 16:51:03 -05:00
|
|
|
setlocal EnableDelayedExpansion
|
2014-01-30 15:36:40 -05:00
|
|
|
|
2014-02-04 17:19:11 -05:00
|
|
|
Color 0A
|
|
|
|
|
2014-02-04 15:38:15 -05:00
|
|
|
mode con: cols=78 lines=60
|
|
|
|
|
2014-01-30 15:36:40 -05:00
|
|
|
:: Global Variables
|
|
|
|
set "temp-dir=C:\Coco-Temp"
|
|
|
|
set install-log=%temp-dir%\coco-dev-install-log.txt
|
|
|
|
|
2014-02-01 18:47:10 -05:00
|
|
|
:: set correct curl app
|
|
|
|
IF EXIST "%PROGRAMFILES(X86)%" (
|
2014-02-03 08:53:05 -05:00
|
|
|
(set "curl-app=utilities\curl\64bit\curl.exe")
|
2014-02-01 18:47:10 -05:00
|
|
|
) ELSE (
|
2014-02-03 08:53:05 -05:00
|
|
|
set "curl-app=utilities\curl\32bit\curl.exe"
|
2014-02-01 18:47:10 -05:00
|
|
|
)
|
2014-02-02 16:51:03 -05:00
|
|
|
|
2014-02-03 13:19:24 -05:00
|
|
|
set "ZU-app=utilities\7za.exe"
|
|
|
|
|
2014-02-04 19:48:11 -05:00
|
|
|
:: DEBUG:
|
2014-02-05 17:23:39 -05:00
|
|
|
:: + DEBUG FLOW OF PROGRAM
|
|
|
|
:: + DEBUG & GET GIT AUTOMATIC WORKING
|
2014-02-04 15:38:15 -05:00
|
|
|
|
2014-02-04 19:48:11 -05:00
|
|
|
:: TODO:
|
2014-02-02 19:01:42 -05:00
|
|
|
:: + Write code to install vs if it's not yet installed on users pc
|
2014-02-04 19:48:11 -05:00
|
|
|
:: + Write Tips...
|
2014-02-02 19:01:42 -05:00
|
|
|
:: + Write Git Checkout repository code:
|
|
|
|
:: 1) Let user specify destination
|
|
|
|
:: 2) do a git clone with the git application
|
|
|
|
:: + Configuraton and installation checklist:
|
|
|
|
:: 1) ... ?!
|
|
|
|
:: + Copy the automated dev batch file to root folder
|
|
|
|
:: => Let user define mongo-db directory
|
|
|
|
:: + Start the dev environment
|
|
|
|
:: + Exit message and warn user that he can quit the window now
|
2014-02-01 18:47:10 -05:00
|
|
|
|
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-02-03 19:24:25 -05:00
|
|
|
call:parse_aa_and_draw "config\header"
|
|
|
|
call:draw_dss
|
|
|
|
|
2014-02-03 20:20:24 -05:00
|
|
|
call:parse_file_new "config\config" cnfg n
|
|
|
|
|
|
|
|
call:log "Welcome to the automated Installation of the CodeCombat Dev. Environment!"
|
|
|
|
call:log_sse "v%%cnfg[1]%% authored by %%cnfg[2]%% and published by %%cnfg[3]%%."
|
2014-02-02 16:51:03 -05:00
|
|
|
|
2014-02-04 15:38:15 -05:00
|
|
|
:: Language Agreement Stuff
|
|
|
|
|
|
|
|
call:log "In order to continue the installation of the developers environment"
|
|
|
|
call:log "you will have to read and agree with the following license:
|
|
|
|
call:draw_dss
|
|
|
|
echo.
|
|
|
|
call:parse_aa_and_draw "license.txt"
|
|
|
|
echo.
|
|
|
|
call:draw_dss
|
2014-02-04 18:46:03 -05:00
|
|
|
call:strict_user_yn_question "Have you read the license and do you agree with it?"
|
2014-02-04 17:19:11 -05:00
|
|
|
|
2014-02-04 18:46:03 -05:00
|
|
|
if "%res%"=="false" (
|
2014-02-04 17:19:11 -05:00
|
|
|
call:log "Sorry to hear that, have a good day..."
|
|
|
|
call:log_sse "Installation and Setup of the CodeCombat environment is cancelled."
|
|
|
|
GOTO:END
|
|
|
|
)
|
2014-02-04 15:38:15 -05:00
|
|
|
|
2014-02-04 19:48:11 -05:00
|
|
|
:: Tips
|
|
|
|
call:log "Before we start the installation, here are some tips:"
|
|
|
|
echo.
|
|
|
|
|
|
|
|
call:parse_aa_and_draw "config\tips"
|
|
|
|
|
|
|
|
call:draw_ss
|
|
|
|
|
2014-02-02 16:51:03 -05:00
|
|
|
:: Read Language Index
|
|
|
|
call:parse_file_new "localisation\languages" lang lang_c
|
|
|
|
|
2014-02-02 17:40:58 -05:00
|
|
|
:: Read Download URLs
|
|
|
|
call:parse_file_new "config\downloads" downloads n
|
|
|
|
call:parse_file_new "config\downloads_32" downloads_32 n
|
|
|
|
call:parse_file_new "config\downloads_64" downloads_64 n
|
|
|
|
call:parse_file_new "config\downloads_vista_32" downloads_vista_32 n
|
|
|
|
call:parse_file_new "config\downloads_vista_64" downloads_vista_64 n
|
|
|
|
call:parse_file_new "config\downloads_7_32" downloads_7_32 n
|
|
|
|
call:parse_file_new "config\downloads_7_64" downloads_7_64 n
|
|
|
|
|
2014-02-02 16:51:03 -05:00
|
|
|
:: Parse all Localisation Files
|
|
|
|
for /L %%i in (1,1,%lang_c%) do (
|
|
|
|
call:parse_file "localisation\%%lang[%%i]%%" languages languages_c
|
|
|
|
)
|
|
|
|
|
|
|
|
set /A "wc = %languages_c% / %lang_c%"
|
|
|
|
|
|
|
|
:: Start install with language question (Localisation)
|
|
|
|
call:log "Which language do you prefer?"
|
|
|
|
|
|
|
|
set /A c=0
|
|
|
|
for /L %%i in (1,%wc%,%languages_c%) do (
|
|
|
|
set /A "n = %%i - 1"
|
|
|
|
call:log " [%%c%%] %%languages[%%i]%%"
|
|
|
|
set /A c+=1
|
|
|
|
)
|
|
|
|
|
2014-02-02 17:40:58 -05:00
|
|
|
set "lang_id=-1"
|
2014-02-02 18:37:15 -05:00
|
|
|
call:user_enter_language_id
|
2014-02-02 17:40:58 -05:00
|
|
|
goto:user_pick_language
|
|
|
|
|
2014-02-02 18:37:15 -05:00
|
|
|
:user_enter_language_id
|
|
|
|
set /p lang_id= "Enter the language ID and press <ENTER>: "
|
|
|
|
goto:eof
|
|
|
|
|
2014-02-02 17:40:58 -05:00
|
|
|
:user_pick_language
|
|
|
|
set res=false
|
|
|
|
if %lang_id% LSS 0 set res=true
|
|
|
|
if %lang_id% GEQ %lang_c% set res=true
|
|
|
|
if "%res%"=="true" (
|
|
|
|
call:log "Invalid id! Please enter a correct id from the numbers listed above..."
|
|
|
|
call:draw_dss
|
2014-02-02 18:37:15 -05:00
|
|
|
call:user_enter_language_id
|
2014-02-02 17:40:58 -05:00
|
|
|
goto:user_pick_language
|
|
|
|
)
|
|
|
|
|
|
|
|
call:get_lw word 0
|
|
|
|
call:log_ds "You choose '%word%', from now on all feedback will be logged in it."
|
|
|
|
|
|
|
|
call:log_lw 1
|
2014-02-02 16:51:03 -05:00
|
|
|
call:log_lw_sse 2
|
2014-01-30 16:09:32 -05:00
|
|
|
|
|
|
|
:: downloads for all version...
|
|
|
|
|
2014-02-04 18:46:03 -05:00
|
|
|
:: [TODO] The choice between Cygwin && Git ?! Is => HAVE EXTERNAL GIT APPLICATION LIST!!!
|
2014-02-01 20:55:42 -05:00
|
|
|
|
2014-02-02 16:51:03 -05:00
|
|
|
call:log_lw_sse 3
|
2014-02-01 20:55:42 -05:00
|
|
|
|
2014-02-02 18:37:15 -05:00
|
|
|
call:log_lw 6
|
|
|
|
call:log_lw 7
|
|
|
|
call:log_lw 8
|
2014-02-02 18:55:10 -05:00
|
|
|
call:install_software_o "git" "%%downloads[1]%%" exe 9
|
2014-02-02 18:37:15 -05:00
|
|
|
call:draw_dss
|
|
|
|
call:get_lw word 11
|
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-02-04 18:46:03 -05:00
|
|
|
call:user_set_git_path
|
|
|
|
|
|
|
|
:user_set_git_path_fail
|
|
|
|
if not exist "%git_exe_path%" (
|
|
|
|
call:log_lw 27
|
|
|
|
call:draw_dss
|
|
|
|
call:user_set_git_path
|
|
|
|
)
|
|
|
|
:: architecture specific downloads...
|
|
|
|
IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT)
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:user_set_git_path
|
|
|
|
set /p git_exe_path="%word%: "
|
|
|
|
call:user_set_git_path_fail
|
|
|
|
goto:eof
|
2014-01-30 15:36:40 -05:00
|
|
|
|
2014-02-01 21:46:45 -05:00
|
|
|
:go_to_platform
|
|
|
|
call:log_ds "Windows %~1 detected..."
|
|
|
|
GOTO %~2
|
|
|
|
goto:eof
|
2014-02-01 20:55:42 -05:00
|
|
|
|
2014-02-02 18:55:10 -05:00
|
|
|
:64BIT
|
|
|
|
call:log_ds "64-bit computer detected..."
|
|
|
|
|
|
|
|
call:install_software_o "node-js" "%%downloads_64[1]%%" msi 12
|
|
|
|
call:draw_dss
|
|
|
|
call:install_software_o "ruby" "%%downloads_64[2]%%" exe 13
|
2014-02-04 17:30:11 -05:00
|
|
|
call:draw_dss
|
|
|
|
call:install_software_o "python" "%%downloads_64[3]%%" msi 26
|
2014-02-02 18:55:10 -05:00
|
|
|
|
2014-01-30 15:36:40 -05:00
|
|
|
:: Some installations require specific windows versions
|
|
|
|
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
|
2014-02-02 18:55:10 -05:00
|
|
|
if "%version%" == "5.2" ( call:go_to_platform "XP" ver_XP_64 )
|
|
|
|
if "%version%" == "6.0" ( call:go_to_platform "Vista" ver_Vista_64 )
|
|
|
|
if "%version%" == "6.1" ( call:go_to_platform "7" ver_Win7_8_64 )
|
|
|
|
if "%version%" == "6.2" ( call:go_to_platform "8.0" ver_Win7_8_64 )
|
|
|
|
if "%version%" == "6.3" ( call:go_to_platform "8.1" ver_Win7_8_64 )
|
2014-01-30 15:36:40 -05:00
|
|
|
GOTO warn_and_exit
|
2014-02-02 18:55:10 -05:00
|
|
|
GOTO END
|
2014-01-30 15:36:40 -05:00
|
|
|
|
2014-02-02 18:55:10 -05:00
|
|
|
:32BIT
|
|
|
|
call:log_ds "32-bit computer detected..."
|
2014-01-30 15:36:40 -05:00
|
|
|
|
2014-02-02 18:55:10 -05:00
|
|
|
call:install_software_o "node-js" "%%downloads_32[1]%%" msi 12
|
2014-02-01 21:46:45 -05:00
|
|
|
call:draw_dss
|
2014-02-02 18:55:10 -05:00
|
|
|
call:install_software_o "ruby" "%%downloads_32[2]%%" exe 13
|
2014-02-04 17:30:11 -05:00
|
|
|
call:draw_dss
|
|
|
|
call:install_software_o "python" "%%downloads_32[3]%%" msi 26
|
2014-01-30 15:36:40 -05:00
|
|
|
|
2014-02-02 18:55:10 -05:00
|
|
|
:: Some installations require specific windows versions
|
|
|
|
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
|
|
|
|
if "%version%" == "5.2" ( call:go_to_platform "XP" ver_XP_32 )
|
|
|
|
if "%version%" == "6.0" ( call:go_to_platform "Vista" ver_Vista_32 )
|
|
|
|
if "%version%" == "6.1" ( call:go_to_platform "7" ver_Win7_8_32 )
|
|
|
|
if "%version%" == "6.2" ( call:go_to_platform "8.0" ver_Win7_8_32 )
|
|
|
|
if "%version%" == "6.3" ( call:go_to_platform "8.1" ver_Win7_8_32 )
|
|
|
|
GOTO warn_and_exit
|
2014-01-30 15:36:40 -05:00
|
|
|
GOTO END
|
|
|
|
|
|
|
|
:ver_Win7_8_32
|
2014-02-03 13:19:24 -05:00
|
|
|
call:install_packed_software_o "mongo-db" "%%downloads_7_32[1]%%" 25 14
|
|
|
|
set "mong-db-path = %packed_software_path%"
|
2014-02-01 21:46:45 -05:00
|
|
|
goto git_rep_checkout
|
2014-01-30 15:36:40 -05:00
|
|
|
|
|
|
|
:ver_Vista_32
|
2014-02-03 13:19:24 -05:00
|
|
|
call:install_packed_software_o "mongo-db" "%%downloads_vista_32[1]%%" 25 14
|
|
|
|
set "mong-db-path = %packed_software_path%"
|
2014-02-01 21:46:45 -05:00
|
|
|
goto git_rep_checkout
|
2014-01-30 15:36:40 -05:00
|
|
|
|
|
|
|
:ver_XP_32
|
2014-02-02 18:55:10 -05:00
|
|
|
call:log_lw_ds 15
|
2014-01-30 15:36:40 -05:00
|
|
|
goto END
|
|
|
|
|
|
|
|
:ver_Win7_8_64
|
2014-02-03 13:19:24 -05:00
|
|
|
call:install_packed_software_o "mongo-db" "%%downloads_7_64[1]%%" 25 14
|
|
|
|
set "mong-db-path = %packed_software_path%"
|
2014-02-01 21:46:45 -05:00
|
|
|
goto git_rep_checkout
|
2014-01-30 15:36:40 -05:00
|
|
|
|
|
|
|
:ver_Vista_64
|
2014-02-03 13:19:24 -05:00
|
|
|
call:install_packed_software_o "mongo-db" "%%downloads_vista_64[1]%%" 25 14
|
|
|
|
set "mong-db-path = %packed_software_path%"
|
2014-02-01 21:46:45 -05:00
|
|
|
goto git_rep_checkout
|
2014-01-30 15:36:40 -05:00
|
|
|
|
|
|
|
:ver_XP_64
|
2014-02-02 18:55:10 -05:00
|
|
|
call:log_lw_ds 15
|
2014-01-30 15:36:40 -05:00
|
|
|
goto END
|
|
|
|
|
2014-01-30 16:09:32 -05:00
|
|
|
:git_rep_checkout
|
2014-02-02 18:55:10 -05:00
|
|
|
call:log_lw_ss 16
|
|
|
|
call:log_lw_sse 17
|
2014-02-04 18:46:03 -05:00
|
|
|
|
2014-02-05 17:23:39 -05:00
|
|
|
set "PATH=%PATH%;%git_exe_path%\bin;%git_exe_path%\cmd" /M
|
2014-02-04 18:46:03 -05:00
|
|
|
|
|
|
|
call:user_set_git_repository
|
2014-02-04 19:48:11 -05:00
|
|
|
goto git_rep_checkout_auto
|
2014-02-04 18:46:03 -05:00
|
|
|
|
|
|
|
:user_set_git_repository
|
|
|
|
call:get_lw word 32
|
|
|
|
set /p git_repository_path="%word% "
|
|
|
|
call:user_set_git_repository_sc
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:user_set_git_repository_sc
|
2014-02-05 17:23:39 -05:00
|
|
|
if exist "%git_repository_path%" (
|
2014-02-04 18:46:03 -05:00
|
|
|
call:log_lw 33
|
|
|
|
call:draw_dss
|
|
|
|
call:user_set_git_repository
|
|
|
|
)
|
2014-02-04 19:48:11 -05:00
|
|
|
goto git_rep_checkout_auto
|
2014-02-04 18:46:03 -05:00
|
|
|
goto:eof
|
|
|
|
|
2014-02-04 19:48:11 -05:00
|
|
|
:git_rep_checkout_auto
|
|
|
|
git clone https://github.com/codecombat/codecombat.git "%git_repository_path%"
|
|
|
|
goto:git_repo_configuration
|
|
|
|
|
2014-02-04 18:46:03 -05:00
|
|
|
:git_repo_configuration
|
|
|
|
call:log_lw_ss 35
|
|
|
|
call:log_lw_sse 36
|
2014-01-30 15:36:40 -05:00
|
|
|
goto report_ok
|
|
|
|
|
|
|
|
:report_ok
|
2014-02-03 19:24:25 -05:00
|
|
|
call:log_lw 18
|
2014-02-02 18:55:10 -05:00
|
|
|
call:log_lw_sse 19
|
2014-02-03 19:24:25 -05:00
|
|
|
|
|
|
|
:: Open README file
|
|
|
|
call:open_readme
|
|
|
|
|
2014-01-30 15:36:40 -05:00
|
|
|
goto clean_up
|
|
|
|
|
2014-02-03 19:24:25 -05:00
|
|
|
:open_readme
|
2014-02-04 15:38:15 -05:00
|
|
|
call:open_txt_file "config/info"
|
2014-02-03 19:24:25 -05:00
|
|
|
goto:eof
|
|
|
|
|
2014-01-30 15:36:40 -05:00
|
|
|
:warn_and_exit
|
2014-02-02 18:55:10 -05:00
|
|
|
call:log_lw_ss 20
|
|
|
|
call:log_lw_sse 21
|
2014-01-30 16:17:48 -05:00
|
|
|
goto error_report
|
|
|
|
|
|
|
|
:error_report
|
2014-02-02 18:55:10 -05:00
|
|
|
call:log_lw_ds 22
|
2014-01-30 15:36:40 -05:00
|
|
|
goto END
|
|
|
|
|
|
|
|
:clean_up
|
2014-02-02 18:55:10 -05:00
|
|
|
call:log_lw_sse 23
|
2014-02-01 21:46:45 -05:00
|
|
|
rmdir %temp-dir% /s /q
|
2014-02-03 19:24:25 -05:00
|
|
|
PAUSE
|
2014-01-30 15:36:40 -05:00
|
|
|
goto END
|
|
|
|
|
2014-02-02 18:55:10 -05:00
|
|
|
:: ============================ INSTALL SOFTWARE FUNCTIONS ======================
|
|
|
|
|
2014-02-03 13:19:24 -05:00
|
|
|
:download_software
|
2014-02-02 16:51:03 -05:00
|
|
|
call:get_lw word 4
|
|
|
|
call:log "%word% %~1..."
|
2014-02-02 18:01:41 -05:00
|
|
|
%curl-app% -sS -k %~2 -o %temp-dir%\%~1-setup.%~3
|
2014-02-03 13:19:24 -05:00
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:install_software
|
|
|
|
call:download_software %~1 %~2 %~3
|
2014-02-02 16:51:03 -05:00
|
|
|
call:get_lw word 5
|
|
|
|
call:log "%word% %~1..."
|
2014-02-02 18:01:41 -05:00
|
|
|
START /WAIT %temp-dir%\%~1-setup.%~3
|
2014-02-01 20:55:42 -05:00
|
|
|
goto:eof
|
|
|
|
|
2014-02-02 18:55:10 -05:00
|
|
|
:install_software_o
|
|
|
|
call:get_lw word %~4
|
2014-02-04 17:19:11 -05:00
|
|
|
call:user_yn_question "%word%"
|
2014-02-02 18:55:10 -05:00
|
|
|
if "%res%"=="true" (
|
|
|
|
call:install_software %~1 %~2 %~3
|
|
|
|
) else (
|
|
|
|
call:log_lw 10
|
|
|
|
)
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:install_packed_software
|
2014-02-03 13:19:24 -05:00
|
|
|
call:download_software %~1 %~2 zip
|
|
|
|
|
|
|
|
call:draw_dss
|
|
|
|
|
|
|
|
call:get_lw word %~3
|
|
|
|
|
|
|
|
set /p packed_software_path="%word% "
|
|
|
|
|
|
|
|
:: remove chosen directory of user if it already exists (to prevent a window from popping up)
|
|
|
|
IF EXIST %packed_software_path% rmdir %packed_software_path% /s /q
|
|
|
|
|
|
|
|
%ZU-app% x %temp-dir%\%~1-setup.zip -o%packed_software_path%
|
|
|
|
|
|
|
|
call:draw_dss
|
|
|
|
|
|
|
|
for /f "delims=" %%a in ('dir "%packed_software_path%\" /on /ad /b') do @set temp_dir=%%a
|
|
|
|
for /f "delims=" %%a in ('dir "%packed_software_path%\%temp_dir%\" /on /ad /b') do (
|
|
|
|
xcopy %packed_software_path%\%temp_dir% %packed_software_path%\ /S /E
|
|
|
|
)
|
|
|
|
|
|
|
|
call:draw_dss
|
|
|
|
rmdir %packed_software_path%\%temp_dir%\ /s /q
|
2014-02-02 18:55:10 -05:00
|
|
|
goto:eof
|
|
|
|
|
2014-02-04 15:38:15 -05:00
|
|
|
:user_yn_question
|
|
|
|
set /p result="%~1 [Y/N]: "
|
|
|
|
call:draw_dss
|
2014-02-04 17:19:11 -05:00
|
|
|
set "res=false"
|
|
|
|
if "%result%"=="N" (set "res=true")
|
|
|
|
if "%result%"=="n" (set "res=true")
|
2014-02-04 15:38:15 -05:00
|
|
|
goto:eof
|
|
|
|
|
2014-02-04 18:46:03 -05:00
|
|
|
:strict_user_yn_question
|
|
|
|
set /p result="%~1 [Y/N]: "
|
|
|
|
call:draw_dss
|
|
|
|
set "res=unset"
|
|
|
|
if "%result%"=="N" (set "res=false")
|
|
|
|
if "%result%"=="n" (set "res=false")
|
|
|
|
if "%result%"=="Y" (set "res=true")
|
|
|
|
if "%result%"=="y" (set "res=true")
|
|
|
|
|
|
|
|
if "%res%"=="unset" (
|
|
|
|
call:log "Please answer the question with either Y or N..."
|
|
|
|
call:draw_dss
|
|
|
|
call:strict_user_yn_question "%~1"
|
|
|
|
)
|
|
|
|
goto:eof
|
|
|
|
|
2014-02-02 18:55:10 -05:00
|
|
|
:install_packed_software_o
|
2014-02-03 13:19:24 -05:00
|
|
|
call:get_lw word %~4
|
2014-02-04 17:19:11 -05:00
|
|
|
call:user_yn_question "%word%"
|
2014-02-02 18:55:10 -05:00
|
|
|
if "%res%"=="true" (
|
2014-02-03 13:19:24 -05:00
|
|
|
call:install_packed_software %~1 %~2 %~3
|
2014-02-02 18:55:10 -05:00
|
|
|
) else (
|
|
|
|
call:log_lw 10
|
|
|
|
)
|
|
|
|
goto:eof
|
|
|
|
|
2014-02-02 16:51:03 -05:00
|
|
|
:: ============================== FUNCTIONS ====================================
|
|
|
|
|
2014-02-01 20:55:42 -05:00
|
|
|
:log
|
2014-02-01 21:46:45 -05:00
|
|
|
echo %~1
|
|
|
|
echo %~1 >> %install-log%
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:draw_ss
|
2014-02-04 17:19:11 -05:00
|
|
|
echo.
|
2014-02-03 19:24:25 -05:00
|
|
|
call:log "-----------------------------------------------------------------------------"
|
2014-02-04 17:19:11 -05:00
|
|
|
echo.
|
2014-02-01 21:46:45 -05:00
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:draw_dss
|
2014-02-04 17:19:11 -05:00
|
|
|
echo.
|
2014-02-03 19:24:25 -05:00
|
|
|
call:log "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
|
2014-02-04 17:19:11 -05:00
|
|
|
echo.
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:draw_seperator
|
|
|
|
echo.
|
|
|
|
echo + + + + + + + +
|
|
|
|
echo.
|
2014-02-01 21:46:45 -05:00
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:log_ss
|
|
|
|
call:draw_ss
|
|
|
|
call:log "%~1"
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:log_sse
|
|
|
|
call:log "%~1"
|
|
|
|
call:draw_ss
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:log_ds
|
|
|
|
call:log_ss "%~1"
|
|
|
|
call:draw_ss
|
2014-02-01 20:55:42 -05:00
|
|
|
goto:eof
|
|
|
|
|
2014-02-02 16:51:03 -05:00
|
|
|
:: ============================== IO FUNCTIONS ====================================
|
|
|
|
|
2014-02-03 19:24:25 -05:00
|
|
|
:open_txt_file
|
|
|
|
start "" notepad.exe %~1
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:parse_aa_and_draw
|
|
|
|
set "file=%~1"
|
2014-02-04 15:38:15 -05:00
|
|
|
for /f "usebackq tokens=* delims=;" %%a in ("%file%") do (
|
2014-02-03 19:24:25 -05:00
|
|
|
echo.%%a
|
|
|
|
)
|
|
|
|
goto:eof
|
|
|
|
|
2014-02-02 16:51:03 -05:00
|
|
|
:parse_file
|
|
|
|
set "file=%~1"
|
|
|
|
for /F "usebackq delims=" %%a in ("%file%") do (
|
|
|
|
set /A %~3+=1
|
|
|
|
call set %~2[%%%~3%%]=%%a
|
|
|
|
)
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:parse_file_new
|
|
|
|
set /A %~3=0
|
|
|
|
call:parse_file %~1 %~2 %~3
|
|
|
|
goto:eof
|
|
|
|
|
2014-02-04 17:19:11 -05:00
|
|
|
:: ============================== LOCALISATION FUNCTIONS ================
|
2014-02-02 16:51:03 -05:00
|
|
|
|
|
|
|
:get_lw
|
|
|
|
call:get_lw_id %~1 %lang_id% %~2
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:get_lw_id
|
|
|
|
set /A count = %~2 * %wc% + %~3 + 1
|
|
|
|
set "%~1=!languages[%count%]!"
|
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:log_lw
|
|
|
|
call:get_lw str %~1
|
2014-02-02 18:37:15 -05:00
|
|
|
call:log "%str%"
|
2014-02-02 16:51:03 -05:00
|
|
|
goto:eof
|
|
|
|
|
2014-02-04 18:46:03 -05:00
|
|
|
:log_lw_prfx
|
|
|
|
call:get_lw str %~1
|
|
|
|
call:log "%~2%str%"
|
|
|
|
goto:eof
|
|
|
|
|
2014-02-02 16:51:03 -05:00
|
|
|
:log_lw_ss
|
|
|
|
call:get_lw str %~1
|
2014-02-02 18:37:15 -05:00
|
|
|
call:log_ss "%str%"
|
2014-02-02 16:51:03 -05:00
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:log_lw_ds
|
|
|
|
call:get_lw str %~1
|
2014-02-02 18:37:15 -05:00
|
|
|
call:log_ds "%str%"
|
2014-02-02 16:51:03 -05:00
|
|
|
goto:eof
|
|
|
|
|
|
|
|
:log_lw_sse
|
|
|
|
call:get_lw str %~1
|
2014-02-02 18:37:15 -05:00
|
|
|
call:log_sse "%str%"
|
2014-02-02 16:51:03 -05:00
|
|
|
goto:eof
|
|
|
|
|
2014-02-04 17:19:11 -05:00
|
|
|
:: ============================== WINDOWS FUNCTIONS ======================
|
|
|
|
|
|
|
|
:set_env_var
|
|
|
|
setx -m %~1 %~2
|
|
|
|
goto:eof
|
|
|
|
|
2014-02-02 16:51:03 -05:00
|
|
|
:: ============================== EOF ====================================
|
|
|
|
|
2014-01-30 15:36:40 -05:00
|
|
|
:END
|
2014-02-04 17:19:11 -05:00
|
|
|
set /p input="You can close this window now..."
|
2014-01-30 15:36:40 -05:00
|
|
|
endlocal
|