forked from learningequality/ka-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_windows.bat
49 lines (44 loc) · 1.33 KB
/
setup_windows.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@echo off
set "SCRIPT_DIR=%~dp0"
set "KALITE_DIR=%SCRIPT_DIR%\kalite"
setlocal enabledelayedexpansion
copy %0 "%KALITE_DIR%\writetest.temp" > nul
if %ERRORLEVEL% == 1 (
echo -------------------------------------------------------------------
echo You do not have permission to write to this directory!
echo -------------------------------------------------------------------
exit /B
) else (
if exist "%KALITE_DIR%\writetest.temp" (
del "%KALITE_DIR%\writetest.temp" > nul
)
)
rem Check for Python
rem
call "%SCRIPT_DIR%\scripts\python.bat"
if !ERRORLEVEL! EQU 1 (
echo -------------------------------------------------------------------
echo Error: You do not seem to have Python installed.
echo Please install version 2.6 or 2.7, and re-run this script.
echo -------------------------------------------------------------------
cd ..
exit /b
)
rem Setup script
rem
start /b /wait python.exe "%KALITE_DIR%\manage.py" setup
rem Run at startup
rem
:choice
echo.
echo Do you wish to set the KA Lite server to run in the background automatically
set /P c=when you start Windows [Y/N]?
if /I "%c%" EQU "Y" goto :yes
if /I "%c%" EQU "N" goto :no
goto :choice
:yes
"%SCRIPT_DIR%\scripts\createshortcut.vbs"
echo A link to start.bat was added to the Start Menu's Startup (all users) folder.
echo.
:no
pause