-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSTLViewer.bat
59 lines (48 loc) · 1.46 KB
/
STLViewer.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
56
57
58
59
@echo off
REM Check if Python is installed
python --version >nul 2>&1
IF ERRORLEVEL 1 (
echo Python is not installed. Please install Python from https://www.python.org/downloads/
pause
exit /b
)
REM Create a virtual environment in the current folder
echo Creating a virtual environment...
python -m venv venv
REM Check if the virtual environment was successfully created
IF NOT EXIST venv (
echo Failed to create virtual environment. Ensure you have Python installed.
pause
exit /b
)
REM Activate the virtual environment
echo Activating the virtual environment...
call venv\Scripts\activate
REM Install the dependencies
echo Installing dependencies from requirements.txt...
pip install --upgrade pip
pip install -r requirements.txt
REM Check if requirements.txt was successfully processed
IF ERRORLEVEL 1 (
echo Failed to install dependencies. Please check your Python installation or requirements.txt.
pause
exit /b
)
REM Run the application
echo Running the application...
python main.py
REM Check if the Python script executed successfully
IF ERRORLEVEL 1 (
echo An error occurred while running the application. Please check the Python code or requirements.
pause
exit /b
)
REM Keep the terminal open after the app closes
echo Application has closed. Press any key to exit.
pause
REM Deactivate the virtual environment after use
echo Deactivating the virtual environment...
deactivate
echo The application has been closed.
pause
exit /b