forked from johannesPettersson80/codesys-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_server.bat
More file actions
44 lines (35 loc) · 1.02 KB
/
Copy pathstart_server.bat
File metadata and controls
44 lines (35 loc) · 1.02 KB
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
@echo off
REM Start the CODESYS API server (Python 3 version)
SETLOCAL EnableDelayedExpansion
echo CODESYS API Server Launcher
echo ==========================
echo.
REM Check Python version
python -c "import sys; print(sys.version_info[0])" > temp.txt
SET /p PYTHON_MAJOR_VERSION=<temp.txt
DEL temp.txt
IF %PYTHON_MAJOR_VERSION% LSS 3 (
echo ERROR: This script requires Python 3.
echo You are using Python 2.x.
echo Please install Python 3 and try again.
goto :EOF
)
echo Python %PYTHON_MAJOR_VERSION% detected.
REM Check if required files exist
IF NOT EXIST HTTP_SERVER.py (
echo ERROR: HTTP_SERVER.py not found.
echo Please make sure you are in the correct directory.
goto :EOF
)
REM Check if required directories exist
IF NOT EXIST requests (
echo Creating requests directory...
mkdir requests
)
IF NOT EXIST results (
echo Creating results directory...
mkdir results
)
echo Starting CODESYS API server...
python HTTP_SERVER.py
ENDLOCAL