Make build_and_deploy.ps1 self-installing and fail loudly
pip install of pyinstaller/pystray/pillow was a separate manual step the README only mentioned in prose, so the script silently died on missing packages -- especially bad on Explorer double-click, where the window closes before any error is visible. Consolidate all dependencies into requirements.txt (also used by README's plain "pip install -r" flow), have the script install it itself, wrap the whole build in try/catch with exit-code checks after every native call, and pause on both success and failure unless -NoPause is passed. Also move the build output from %LOCALAPPDATA% into dist/ next to the script, so it's easy to find and matches the already-gitignored dist/ entry.
This commit is contained in:
parent
540ce5b1eb
commit
13c3745479
3 changed files with 96 additions and 31 deletions
24
README.md
24
README.md
|
|
@ -37,15 +37,18 @@ Windows-Maschine hartkodiert (`versapad_data.CONFIG_PATHS`,
|
|||
## Voraussetzungen
|
||||
|
||||
- Python 3.11 oder neuer
|
||||
- Pakete: `pyserial` (Board-Kommunikation), `pystray` + `pillow`
|
||||
(Tray-Icon/Desktop-App), optional `mcp` (nur für den MCP-Server)
|
||||
- Alle Pakete stehen in `requirements.txt` (`pyserial` fürs Board,
|
||||
`pystray` + `pillow` fürs Tray-Icon/Desktop-Fenster, `mcp` für den
|
||||
MCP-Server, `pyinstaller` fürs `.exe`-Bauen):
|
||||
|
||||
```bash
|
||||
pip install pyserial pystray pillow mcp
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Für den Browser-Modus (`server.py`) reicht die Python-Standardbibliothek —
|
||||
keine zusätzlichen Pakete nötig.
|
||||
keine zusätzlichen Pakete nötig. `build_and_deploy.ps1` installiert
|
||||
`requirements.txt` beim Bauen automatisch selbst — ein manuelles
|
||||
`pip install` vorher ist dafür nicht nötig.
|
||||
|
||||
## Starten
|
||||
|
||||
|
|
@ -65,8 +68,15 @@ Maschine/Python-Version unterschiedlich). Selbst bauen:
|
|||
.\build_and_deploy.ps1
|
||||
```
|
||||
|
||||
Das Skript baut mit PyInstaller (`--onedir --windowed`, eigenes Icon) und
|
||||
kopiert das Ergebnis nach `%LOCALAPPDATA%\VersaPadViewer\VersaPadViewer.exe`.
|
||||
Das Skript installiert/aktualisiert selbst alle nötigen Pakete aus
|
||||
`requirements.txt` (kein manuelles `pip install` vorher nötig), baut dann
|
||||
mit PyInstaller (`--onedir --windowed`, eigenes Icon) und kopiert das
|
||||
Ergebnis nach `dist\VersaPadViewer\VersaPadViewer.exe` im Projektordner.
|
||||
Bricht ein Schritt ab (fehlendes Python, PyInstaller-Fehler, ...), zeigt das
|
||||
Skript eine klare Fehlermeldung und wartet auf einen Tastendruck, statt sich
|
||||
bei Doppelklick im Explorer kommentarlos zu schließen (`-NoPause`
|
||||
unterdrückt das für automatisierte Aufrufe/CI).
|
||||
|
||||
**Wichtig:** Sowohl Bauen als auch Ausführen müssen auf einem lokalen
|
||||
Laufwerk passieren — von einem Netzlaufwerk (SMB-Share) aus scheitert
|
||||
PyInstaller beim Bauen (Pfadlängen-Problem mit Tcl/Tk-Zeitzonendaten) und
|
||||
|
|
@ -75,8 +85,6 @@ das Nachladen der Bundle-DLLs von einem Netzwerkpfad, ohne jede
|
|||
Fehlermeldung). `build_and_deploy.ps1` kopiert den Quellcode deshalb
|
||||
automatisch zuerst nach `%TEMP%` und baut nur dort.
|
||||
|
||||
Voraussetzung: `pip install pyinstaller` zusätzlich zu den obigen Paketen.
|
||||
|
||||
## Aufbau
|
||||
|
||||
| Datei | Zweck |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue