-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_gui.ps1
More file actions
31 lines (28 loc) · 1.01 KB
/
run_gui.ps1
File metadata and controls
31 lines (28 loc) · 1.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
$ErrorActionPreference = "Stop"
Set-Location -Path $PSScriptRoot
Add-Type -AssemblyName System.Windows.Forms
$pythonExe = "python"
if (Test-Path ".\.venv\Scripts\python.exe") { $pythonExe = ".\.venv\Scripts\python.exe" }
if (Test-Path ".\venv\Scripts\python.exe") { $pythonExe = ".\venv\Scripts\python.exe" }
try {
$null = & $pythonExe --version
} catch {
[System.Windows.Forms.MessageBox]::Show(
"Python not found. Please install Python or create venv/.venv first.",
"Startup Error",
[System.Windows.Forms.MessageBoxButtons]::OK,
[System.Windows.Forms.MessageBoxIcon]::Error
) | Out-Null
exit 1
}
& $pythonExe web_launcher.py
if ($LASTEXITCODE -ne 0) {
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.MessageBox]::Show(
"GUI launcher failed. Please check dependencies (tkinter / uvicorn).",
"Startup Error",
[System.Windows.Forms.MessageBoxButtons]::OK,
[System.Windows.Forms.MessageBoxIcon]::Error
) | Out-Null
exit 1
}