fix(launcher): activate venv and launch via uv run in run_uvr.bat

- Explicitly activate virtual environment via venv\Scripts\activate.bat prior to launch
- Execute application with 'uv run python UVR.py' to preserve environment context
- Fixes missing module resolution (e.g. natsort) when application restarts
This commit is contained in:
RevLayDust committed 2026-10-11 21:16:47 +07:00
1 parent a8555d1315
commit 78c358790d
1 file changed
+4 -3
+4 -3
View File
@@ -3,9 +3,9 @@ setlocal EnableExtensions
cd /d "%~dp0"
set "UVR_ROOT=%~dp0"
set "UVR_PYTHON=%UVR_ROOT%venv\Scripts\python.exe"
set "UVR_VENV=%UVR_ROOT%venv\Scripts\activate.bat"
set "UVR_LOG=%UVR_ROOT%uvr_run.log"
if not exist "%UVR_PYTHON%" (
if not exist "%UVR_VENV%" (
echo [ERROR] The UVR virtual environment was not found.
echo Run install/install_packages.bat first.
pause
@@ -13,7 +13,8 @@ if not exist "%UVR_PYTHON%" (
)
echo Starting Ultimate Vocal Remover...
"%UVR_PYTHON%" "%UVR_ROOT%UVR.py"
call "%UVR_VENV%"
call uv run python UVR.py
set "UVR_EXIT_CODE=%ERRORLEVEL%"
if not "%UVR_EXIT_CODE%"=="0" echo [ERROR] UVR exited with code %UVR_EXIT_CODE%. See uvr_run.log for details.
pause