-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathstart-server.bat
55 lines (48 loc) · 1.39 KB
/
start-server.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
50
51
52
53
54
55
:: https://ss64.com/nt/syntax-variables.html
cd app
set LAUNCHED=F
set PYTHON_FOLDER_NEWEST=%LocalAppData%\Programs\Python\Python39-32
set PYTHON_FOLDER=%LocalAppData%\Programs\Python\Python38-32
set PYTHON_FOLDER_64=%LocalAppData%\Programs\Python\Python38
set PYTHON_FOLDER_OLD=%HOMEDRIVE%\Python34
:: Look for Python 3.9.x 32-bit
:: where python.exe # doesn't work on XP
if defined LocalAppData (
if exist %PYTHON_FOLDER_NEWEST%\python.exe (
rem Python 3.9.x found!
set LAUNCHED=T
%PYTHON_FOLDER_NEWEST%\python.exe server.py
)
)
:: Look for Python 3.8.x 32-bit
if defined LocalAppData (
if exist %PYTHON_FOLDER%\python.exe (
rem Python 3.8.x found!
set LAUNCHED=T
%PYTHON_FOLDER%\python.exe server.py
)
)
:: Look for Python 3.8.x 64-bit
if defined LocalAppData (
if exist %PYTHON_FOLDER_64%\python.exe (
rem Python 3.8.x found!
set LAUNCHED=T
%PYTHON_FOLDER_64%\python.exe server.py
)
)
:: Look for Python 3.4.x
if "%LAUNCHED%"=="F" (
rem Looking for Python 3.4.x
if exist %PYTHON_FOLDER_OLD%\python.exe (
rem Python 3.4.x found!
set LAUNCHED=T
%PYTHON_FOLDER_OLD%\python.exe server.py
)
)
:: Look for Python in PATH
if "%LAUNCHED%"=="F" (
rem Looking for Python in PATH
set LAUNCHED=T
python server.py
)
@pause