forked from BigPizzaV3/CodexPlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
97 lines (87 loc) · 2.01 KB
/
Copy pathsetup.bat
File metadata and controls
97 lines (87 loc) · 2.01 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@echo off
setlocal
cd /d "%~dp0"
set "VENV_DIR=%~dp0.venv"
set "VENV_PY=%VENV_DIR%\Scripts\python.exe"
:menu
cls
echo ========================================
echo Codex++ Setup
echo ========================================
echo.
echo [1] Install Codex++
echo [2] Uninstall Codex++
echo [3] Update Codex++
echo [4] Exit
echo.
set /p choice=Please select an option [1-4]:
if "%choice%"=="1" goto install
if "%choice%"=="2" goto uninstall
if "%choice%"=="3" goto update
if "%choice%"=="4" goto end
echo.
echo Invalid choice.
pause
goto menu
:install
echo.
call :ensure_venv
if errorlevel 1 goto error
echo Installing Codex++ into venv...
"%VENV_PY%" -m pip install -e .
if errorlevel 1 goto error
echo.
echo Installing Codex++ shortcut and uninstall entry...
"%VENV_PY%" -m codex_session_delete setup
if errorlevel 1 goto error
echo.
echo Codex++ installed successfully.
echo You can launch it from the Codex++ desktop shortcut.
pause
goto end
:uninstall
echo.
if exist "%VENV_PY%" (
set "RUNPY=%VENV_PY%"
) else (
echo Codex++ venv not found, falling back to system python.
set "RUNPY=python"
)
echo Uninstalling Codex++ shortcut and uninstall entry...
"%RUNPY%" -m codex_session_delete remove
if errorlevel 1 goto error
echo.
echo Codex++ uninstalled successfully.
pause
goto end
:update
echo.
call :ensure_venv
if errorlevel 1 goto error
echo Updating Codex++ from GitHub Release...
"%VENV_PY%" -m codex_session_delete update
if errorlevel 1 goto error
echo.
echo Codex++ update finished.
pause
goto end
:ensure_venv
if exist "%VENV_PY%" exit /b 0
echo.
echo Creating Python virtual environment at "%VENV_DIR%"...
python -m venv "%VENV_DIR%"
if errorlevel 1 (
echo Failed to create venv. Make sure Python 3.11+ is installed and available on PATH.
exit /b 1
)
echo Upgrading pip / setuptools / wheel inside venv...
"%VENV_PY%" -m pip install --upgrade pip setuptools wheel
if errorlevel 1 exit /b 1
exit /b 0
:error
echo.
echo Operation failed. Please check the error output above.
pause
exit /b 1
:end
endlocal