-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCOMPILER_EN_EXE.ps1
More file actions
117 lines (108 loc) · 6.38 KB
/
COMPILER_EN_EXE.ps1
File metadata and controls
117 lines (108 loc) · 6.38 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
# Book Writer Pro - Compilation en EXE
# PowerShell script (plus fiable que .bat pour Unicode)
Write-Host ""
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Cyan
Write-Host "📦 BOOK WRITER PRO - Compilation en EXE" -ForegroundColor Green
Write-Host "🌍 Edition Mondiale - 17 langues" -ForegroundColor Yellow
Write-Host "💚 Créé par PHOBOS avec Maman Margot" -ForegroundColor Magenta
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Cyan
Write-Host ""
# Vérifier PyInstaller
Write-Host "⏳ Vérification de PyInstaller..." -ForegroundColor Yellow
$pyinstaller = pip show pyinstaller 2>&1
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ PyInstaller n'est pas installé." -ForegroundColor Red
Write-Host "📥 Installation de PyInstaller en cours..." -ForegroundColor Yellow
pip install pyinstaller
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ Erreur installation PyInstaller !" -ForegroundColor Red
pause
exit 1
}
Write-Host "✅ PyInstaller installé avec succès !" -ForegroundColor Green
} else {
Write-Host "✅ PyInstaller déjà installé." -ForegroundColor Green
}
Write-Host ""
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Cyan
Write-Host "🔨 COMPILATION EN COURS..." -ForegroundColor Green
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Cyan
Write-Host ""
Write-Host "📝 Options de compilation :" -ForegroundColor Yellow
Write-Host " - Mode : --onefile (un seul fichier EXE)" -ForegroundColor Gray
Write-Host " - Interface : --windowed (pas de console)" -ForegroundColor Gray
Write-Host " - Nom : BookWriterPro_v1.0.exe" -ForegroundColor Gray
Write-Host " - Inclut : data/, fonts/, core/, gui/, exporters/, locales/" -ForegroundColor Gray
Write-Host ""
Write-Host "⏳ Compilation... (peut prendre 15-20 minutes)" -ForegroundColor Yellow
Write-Host ""
# Compilation avec PyInstaller
$result = pyinstaller --noconfirm `
--onefile `
--windowed `
--name "BookWriterPro_v1.0" `
--add-data "data;data" `
--add-data "fonts;fonts" `
--add-data "core;core" `
--add-data "gui;gui" `
--add-data "exporters;exporters" `
--add-data "importers;importers" `
--add-data "locales;locales" `
--hidden-import tkinter `
--hidden-import argostranslate `
--hidden-import reportlab `
--hidden-import ebooklib `
--hidden-import docx `
--hidden-import PIL `
--hidden-import pyttsx3 `
--hidden-import pydub `
--hidden-import torch `
--hidden-import diffusers `
--hidden-import transformers `
main.py
if ($LASTEXITCODE -ne 0) {
Write-Host ""
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Red
Write-Host "❌ ERREUR DE COMPILATION !" -ForegroundColor Red
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Red
Write-Host ""
Write-Host "💡 Solutions possibles :" -ForegroundColor Yellow
Write-Host " 1. Vérifiez que tous les modules sont installés" -ForegroundColor Gray
Write-Host " 2. Relancez ce script" -ForegroundColor Gray
Write-Host " 3. Consultez le fichier build\BookWriterPro_v1.0\warn.txt" -ForegroundColor Gray
Write-Host ""
pause
exit 1
}
Write-Host ""
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Green
Write-Host "✅ COMPILATION RÉUSSIE !" -ForegroundColor Green
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Green
Write-Host ""
# Vérifier taille fichier
if (Test-Path "dist\BookWriterPro_v1.0.exe") {
$fileSize = (Get-Item "dist\BookWriterPro_v1.0.exe").Length / 1MB
Write-Host "📦 Fichier EXE créé : dist\BookWriterPro_v1.0.exe" -ForegroundColor Green
Write-Host "📊 Taille : $([math]::Round($fileSize, 2)) MB" -ForegroundColor Cyan
} else {
Write-Host "⚠️ Fichier EXE introuvable dans dist\" -ForegroundColor Yellow
}
Write-Host ""
Write-Host "🎯 PROCHAINES ÉTAPES :" -ForegroundColor Yellow
Write-Host " 1. Testez l'EXE : dist\BookWriterPro_v1.0.exe" -ForegroundColor Gray
Write-Host " 2. Si ça fonctionne, uploadez sur GitHub Releases" -ForegroundColor Gray
Write-Host " 3. Partagez au monde entier ! 🌍" -ForegroundColor Gray
Write-Host ""
Write-Host "💡 STRUCTURE CRÉÉE :" -ForegroundColor Yellow
Write-Host " ├─ build\ (fichiers temporaires)" -ForegroundColor Gray
Write-Host " ├─ dist\ (📦 VOTRE EXE EST ICI !)" -ForegroundColor Green
Write-Host " │ └─ BookWriterPro_v1.0.exe" -ForegroundColor Cyan
Write-Host " └─ BookWriterPro_v1.0.spec (config PyInstaller)" -ForegroundColor Gray
Write-Host ""
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Green
Write-Host "🎉 SUCCÈS !" -ForegroundColor Green
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Green
Write-Host ""
Write-Host "💖 Bisous de Maman Margot ! Tu es un champion !" -ForegroundColor Magenta
Write-Host ""
pause