From 790d3026457af8be807c1a731928258c79e6da80 Mon Sep 17 00:00:00 2001 From: tuxgyver Date: Mon, 31 Aug 2026 12:05:11 +0200 Subject: [PATCH] fix: binaire Windows crashait au lancement (Qt platform plugin manquant) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le hook PyQt6 de pyinstaller-hooks-contrib échoue silencieusement à localiser Qt6/plugins/platforms quand PyInstaller tourne sous Wine, donc qwindows.dll n'était jamais embarqué dans l'exe. Résultat : "This application failed to start because no Qt platform plugin could be initialized" au premier lancement sur Windows. On force désormais l'ajout des dossiers platforms/ et styles/ via --add-data, avec un contrôle préalable que qwindows.dll existe bien côté Wine. Co-Authored-By: Claude Sonnet 5 --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 9ae7b20..079f7f8 100644 --- a/Makefile +++ b/Makefile @@ -75,16 +75,28 @@ linux: install icon @echo "" # ── Binaire Windows (via Wine + Python Windows) ────────────────────────────── +# Le hook PyQt6 de pyinstaller-hooks-contrib introspecte QLibraryInfo pour +# localiser Qt6/plugins/platforms au moment du build : sous Wine cette +# introspection échoue silencieusement, donc qwindows.dll n'est jamais copié +# et l'exe plante au lancement avec « no Qt platform plugin could be +# initialized ». On force sa copie via --add-data. +WINE_QT_PLUGINS := $(HOME)/.wine/drive_c/users/$(USER)/AppData/Local/Programs/Python/Python311/Lib/site-packages/PyQt6/Qt6/plugins + windows: icon @echo "" @echo " 🪟 Compilation Windows (Wine + PyInstaller)…" @echo "" @which wine > /dev/null 2>&1 \ || (echo " ❌ Wine non installé → sudo apt install wine"; exit 1) + @test -f "$(WINE_QT_PLUGINS)/platforms/qwindows.dll" \ + || (echo " ❌ qwindows.dll introuvable dans $(WINE_QT_PLUGINS)/platforms"; \ + echo " → Installez PyQt6 dans Wine avec : make setup-wine"; exit 1) @wine $(WINE_PYTHON) -m PyInstaller $(PI_OPTS) \ --onefile \ --windowed \ --icon=$(ICON) \ + --add-data "$(WINE_QT_PLUGINS)/platforms;PyQt6/Qt6/plugins/platforms" \ + --add-data "$(WINE_QT_PLUGINS)/styles;PyQt6/Qt6/plugins/styles" \ $(SRC) \ || (echo ""; \ echo " ❌ Échec : Python Windows introuvable dans Wine."; \