-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
150 lines (126 loc) · 4.13 KB
/
Copy pathinstall.bat
File metadata and controls
150 lines (126 loc) · 4.13 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
@echo off
REM FPPT One-Click Install for Windows
REM Requires: Python 3.10+
echo ========================================
echo FPPT Installer (Windows)
echo ========================================
echo.
REM Step 1: Check Python version (multi-command detection + auto-install)
echo [1/5] Checking Python...
set "PYTHON_CMD="
REM Try py -3 first (Windows Python Launcher, always on PATH)
py -3 --version >nul 2>&1
if %errorlevel% equ 0 (
set "PYTHON_CMD=py -3"
goto :python_found
)
REM Try python3
python3 --version >nul 2>&1
if %errorlevel% equ 0 (
set "PYTHON_CMD=python3"
goto :python_found
)
REM Try python
python --version >nul 2>&1
if %errorlevel% equ 0 (
set "PYTHON_CMD=python"
goto :python_found
)
REM --- Python not found. Try winget auto-install. ---
echo Python not found on this system.
winget --version >nul 2>&1
if %errorlevel% neq 0 goto :winget_not_found
echo.
echo ======================================================
echo Found winget package manager.
echo I can install Python 3.12 automatically for you.
echo.
echo Press any key to install Python 3.12 now,
echo or press Ctrl+C to cancel and install manually.
echo ======================================================
pause >nul
echo.
echo Installing Python 3.12 via winget...
echo (This may take a few minutes)
winget install --id Python.Python.3.12 --accept-source-agreements --accept-package-agreements --disable-interactivity
if %errorlevel% neq 0 (
echo WARNING: winget returned an error. Trying to continue anyway...
)
REM Add winget default install location to current session PATH
set "PATH=%LOCALAPPDATA%\Programs\Python\Python312;%LOCALAPPDATA%\Programs\Python\Python312\Scripts;%PATH%"
REM Re-check for python
python --version >nul 2>&1
if %errorlevel% equ 0 (
set "PYTHON_CMD=python"
goto :python_found
)
REM Try py launcher again
py -3 --version >nul 2>&1
if %errorlevel% equ 0 (
set "PYTHON_CMD=py -3"
goto :python_found
)
REM Try full path to known winget location
"%LOCALAPPDATA%\Programs\Python\Python312\python.exe" --version >nul 2>&1
if %errorlevel% equ 0 (
set "PYTHON_CMD=%LOCALAPPDATA%\Programs\Python\Python312\python.exe"
goto :python_found
)
echo Install completed but Python cannot be found on PATH.
echo Please restart your terminal and run install.bat again.
exit /b 1
:winget_not_found
echo.
echo Please install Python 3.10+ manually:
echo 1. Visit https://www.python.org/downloads/
echo 2. Download the latest Python 3.12 installer
echo 3. Run the installer -- CHECK "Add Python to PATH"
echo 4. Restart your terminal
echo 5. Run install.bat again
exit /b 1
:python_found
REM Display version
%PYTHON_CMD% --version 2>&1
for /f "tokens=2" %%v in ('%PYTHON_CMD% --version 2^>^&1') do set PYVER=%%v
echo Found Python %PYVER%
REM Version >= 3.10 check
%PYTHON_CMD% -c "import sys; sys.exit(0 if sys.version_info >= (3,10) else 1)"
if %errorlevel% neq 0 (
echo ERROR: Python 3.10+ required. Found %PYVER%
echo Please install Python 3.10 or newer from https://python.org
exit /b 1
)
REM Step 2: Create virtual environment
echo [2/5] Creating virtual environment...
%PYTHON_CMD% -m venv venv
if %errorlevel% neq 0 (
echo ERROR: Failed to create venv
exit /b 1
)
REM Step 3: Install Python dependencies
echo [3/5] Installing Python dependencies...
venv\Scripts\pip install -r requirements.txt
if %errorlevel% neq 0 (
echo ERROR: Failed to install dependencies
exit /b 1
)
REM Step 4: Install Playwright browsers
echo [4/5] Installing Playwright Chromium...
venv\Scripts\playwright install chromium
if %errorlevel% neq 0 (
echo WARNING: Playwright browser install failed. Some features may be unavailable.
)
REM Step 5: Verify
echo [5/5] Verifying installation...
venv\Scripts\python -c "import flask, pptx, yaml, requests, webview; print('OK')"
if %errorlevel% neq 0 (
echo ERROR: Verification failed
exit /b 1
)
echo.
echo ========================================
echo Installation complete!
echo.
echo Desktop: Double-click start.bat to launch FPPT Assistant
echo AI Use: Import SKILL.md into your AI agent terminal
echo ========================================