@echo off
setlocal enabledelayedexpansion


@REM resolve paths
set "SCRIPT_DIR=%~dp0"
pushd "!SCRIPTDIR!.."
set "SANDBOX_DIR=!CD!"
popd
echo SANDBOX_DIR path: !SANDBOX_DIR!

set "APP_DIR=!SCRIPT_DIR!"
set "VENV_DIR=!SANDBOX_DIR!\.tuning_venv"



if EXIST "!VENV_DIR!" (
	echo Using existing venv at !VENV_DIR!
) else (
	call "!SCRIPT_DIR!\python\tuning_utility\create_venv.cmd" cn
	if !ERRORLEVEL! NEQ 0 (
		pause
		exit /b !ERRORLEVEL!
	)
)
call "!VENV_DIR!\Scripts\activate.bat"

python tuning_gui.py
if !ERRORLEVEL! neq 0 (
	pause
)
exit /b !ERRORLEVEL!
