mirror of
https://github.com/Stone-Red-Code/HotspotAutoLogin.git
synced 2026-11-01 23:05:40 +01:00
Added virtual env. support
This commit is contained in:
@@ -1,15 +1,25 @@
|
||||
@echo off
|
||||
IF NOT EXIST .venv\Scripts\activate (
|
||||
set NAME=HotspotAutoLogin
|
||||
set "requirementsFile=requirements.txt"
|
||||
set VENV_PATH=.venv
|
||||
set ACTIVATE_PATH=%VENV_PATH%\Scripts\activate
|
||||
|
||||
IF NOT EXIST %ACTIVATE_PATH% (
|
||||
echo Creating virtual environment...
|
||||
virtualenv .venv
|
||||
echo Virtual environment created.
|
||||
virtualenv %VENV_PATH%
|
||||
)
|
||||
|
||||
echo Activating virtual environment...
|
||||
call .venv\Scripts\activate
|
||||
call %ACTIVATE_PATH%
|
||||
|
||||
echo Installing requirements...
|
||||
pip install -r requirements.txt
|
||||
echo Checking the requirements...
|
||||
for /f "delims=" %%i in (%requirementsFile%) do (
|
||||
pip freeze | findstr /c:%%i > nul
|
||||
if errorlevel 1 (
|
||||
echo Installing missing or outdated package: %%i
|
||||
pip install %%i --upgrade --quiet
|
||||
)
|
||||
)
|
||||
|
||||
echo Starting HotspotAutoLogin...
|
||||
start /B "" ".venv/Scripts/pythonw.exe" HotspotAutoLogin.pyw
|
||||
echo Starting %NAME%...
|
||||
start /B "" "%VENV_PATH%/Scripts/pythonw.exe" HotspotAutoLogin.pyw
|
||||
Reference in New Issue
Block a user