mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-07-01 03:04:52 +02:00
feat: Add Windows compatibility, PyInstaller build setup, and custom icon
- Add Windows LibreOffice detection fallback for soffice path - Check standard install locations (%PROGRAMFILES%, %PROGRAMFILES(X86)%) - Graceful fallback with clear error messages - Add PyInstaller build infrastructure - build/ccma.spec: PyInstaller configuration with icon generation - build/build.ps1: Automated build script for standalone exe - main.py: Entry point for PyInstaller - Supports versioning and architecture tagging - Create custom CCMA icon - Person + Gear symbol representing member administration - Cyan/White/Orange color scheme - Auto-converts PNG to ICO during build - Update documentation - README: Windows PowerShell setup instructions - README: Linux/macOS bash setup instructions - README: Standalone executable build guide - pyproject.toml: Add 'build' extra with pyinstaller+pillow - Add regression tests - Test office executable detection and Windows fallback - Verify all tests pass (80 passed)
This commit is contained in:
@@ -12,6 +12,29 @@ Requires Python 3.11+ with Tk support.
|
||||
PDF generation from document templates additionally requires LibreOffice or
|
||||
OpenOffice with a `soffice` command available on the system.
|
||||
|
||||
### Windows (PowerShell)
|
||||
|
||||
```powershell
|
||||
python -m venv .venv
|
||||
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
|
||||
.\.venv\Scripts\ccma.exe
|
||||
```
|
||||
|
||||
For development tools and tests, install the `dev` extra as well:
|
||||
|
||||
```powershell
|
||||
.\.venv\Scripts\python.exe -m pip install -e .[dev]
|
||||
```
|
||||
|
||||
Alternatively, without installation:
|
||||
|
||||
```powershell
|
||||
$env:PYTHONPATH = "src"
|
||||
.\.venv\Scripts\python.exe -m ccma
|
||||
```
|
||||
|
||||
### Linux/macOS
|
||||
|
||||
```bash
|
||||
python -m venv .venv
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
@@ -30,6 +53,32 @@ Alternatively, without installation:
|
||||
PYTHONPATH=src python -m ccma
|
||||
```
|
||||
|
||||
If LibreOffice is installed on Windows but `soffice` is not in `PATH`, CCMA
|
||||
also checks the default install locations under `%PROGRAMFILES%` and
|
||||
`%PROGRAMFILES(X86)%`.
|
||||
|
||||
## Building standalone executables
|
||||
|
||||
To bundle CCMA into a single-file Windows executable with PyInstaller, use the
|
||||
build script in the `build/` directory:
|
||||
|
||||
### Windows standalone build
|
||||
|
||||
```powershell
|
||||
cd build
|
||||
.\build.ps1
|
||||
```
|
||||
|
||||
This creates two executables in the `dist/` directory:
|
||||
- `ccma.exe` (generic)
|
||||
- `ccma-<version>-windows-<arch>.exe` (version and architecture-specific, e.g. `ccma-0.1.0-windows-amd64.exe`)
|
||||
|
||||
The build script automatically:
|
||||
- Creates a venv if missing
|
||||
- Installs dependencies and PyInstaller
|
||||
- Generates a Windows icon from the splash image
|
||||
- Runs PyInstaller to bundle the application
|
||||
|
||||
On first start, select or create the central member-store directory. The
|
||||
`VERSION` file is the single source for application and package versions.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user