metadidomi-builder 1.4.171125 → 1.4.201125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,7 @@
6
6
  [![Sponsor Lygos](https://img.shields.io/badge/Sponsor-Lygos-blue?style=for-the-badge)](https://pay.lygosapp.com/$etsmeta)
7
7
  ![Version](https://img.shields.io/badge/version-1.1.171125-blue)
8
8
  ![License](https://img.shields.io/badge/license-MIT-green)
9
+ ![Keywords](https://img.shields.io/badge/keywords-electron_python_js_html_css_c_code_installer_protection_obfuscation-blue)
9
10
 
10
11
  ---
11
12
 
@@ -13,15 +14,14 @@
13
14
 
14
15
  1. **[À Propos](#-à-propos)** - Présentation générale
15
16
  2. **[Installation](#-installation)** - Mise en place
16
- 3. **[Démarrage Rapide](#-démarrage-rapide)** - Premiers pas
17
- 4. **[Configuration](#-configuration)** - Personnalisation
18
- 5. **[Modes de Construction](#-modes-de-construction)** - Options de build
19
- 6. **[Gestion des Dépendances](#-gestion-des-dépendances)** - Electron et Python
20
- 7. **[Protection du Code](#-système-de-protection-avancé)** - Sécurité
21
- 8. **[Packaging Python](#-packaging-dapplications-python)** - Applications Python
22
- 9. **[Comparaison](#-comparaison-avec-electron-builder)** - vs electron-builder
23
- 10. **[Roadmap](#-roadmap)** - Futures versions
24
- 11. **[Support](#-support-et-contribution)** - Aide et contact
17
+ 3. **[Afficher les Commandes Disponibles](#afficher-toutes-les-commandes-disponibles)** - Liste interactive des commandes
18
+ 4. **[Démarrage Rapide Electron](#-démarrage-rapide---applications-electron)** - Premiers pas Electron
19
+ 5. **[Modes de Construction](#-modes-de-construction)** - Options de build Electron
20
+ 6. **[Protection du Code](#-système-de-protection-avancé)** - Sécurité (Electron et Python)
21
+ 7. **[Packaging Python](#-packaging-dapplications-python)** - Applications Python
22
+ 8. **[Comparaison vs electron-builder](#-comparaison-avec-electron-builder)** - Différences et choix
23
+ 9. **[Roadmap](#-roadmap-vision-multi-plateforme)** - Futures versions
24
+ 10. **[Support](#-support)** - Aide et contact
25
25
 
26
26
  ---
27
27
 
@@ -47,29 +47,134 @@ Votre soutien permet de :
47
47
 
48
48
  ## 🚀 Installation
49
49
 
50
- ### Dépendances Minimales
50
+ ### Installation via npm (Recommandée)
51
51
 
52
52
  **Pour le développement :** Seuls `electron@^39.1.1` et Python 3.11+ sont requis.
53
+ [![](https://img.shields.io/badge/info-Commandes%20disponibles-blue)]
53
54
 
55
+ ### Afficher toutes les commandes disponibles
56
+
57
+ > **Important :** Avant d'utiliser ces commandes, ajoutez les scripts suivants dans la section `scripts` de votre `package.json` :
58
+ >
59
+ > ```json
60
+ > "help": "node node_modules/metadidomi-builder/build_tools/commands-help.js",
61
+ > "help:electron": "node node_modules/metadidomi-builder/build_tools/commands-help.js --type=electron",
62
+ > "help:python": "node node_modules/metadidomi-builder/build_tools/commands-help.js --type=python",
63
+ > "help:all": "node node_modules/metadidomi-builder/build_tools/commands-help.js --all"
64
+ > ```
65
+
66
+ Pour voir toutes les commandes adaptées à votre projet (Electron ou Python), utilisez la commande d'aide interactive :
67
+
68
+ ```powershell
69
+ npm run help # Affiche toutes les commandes disponibles
70
+ npm run help:electron # Affiche uniquement les commandes Electron
71
+ npm run help:python # Affiche uniquement les commandes Python
72
+ npm run help:all # Affiche tout (mode universel)
73
+ ```
74
+
75
+ **Exemple d'affichage** :
76
+ ```
77
+ > npm run help
78
+
79
+ ─────────────────────────────
80
+ METADIDOMI BUILDER - COMMANDES DISPONIBLES
81
+ ─────────────────────────────
82
+
83
+ 1. BUILD
84
+ Crée un installateur Windows NSIS professionnel
85
+ Commande: npm run build
86
+ Alternatives: npx metadidomi-builder
87
+ Sortie: ./dist/MonApp-Setup-1.0.0.exe
88
+
89
+ 2. BUILD:PYTHON
90
+ Build d'application Python en mode console
91
+ Commande: npm run build:python
92
+ Alternatives: npx metadidomi-builder-python
93
+ Sortie: ./dist/MonApp-Setup-1.0.0.exe
94
+
95
+ ...etc
96
+ ```
97
+
98
+ La commande détecte automatiquement le type de projet et affiche les commandes adaptées, avec explications et exemples.
99
+
100
+ Pour plus d'exemples, consultez la section "Exemples Pratiques" plus bas.
101
+
102
+ #### Option 1 : Installation dans votre projet
103
+
104
+ ```powershell
105
+ # Installez le builder comme dépendance de développement
106
+ npm install --save-dev metadidomi-builder
107
+
108
+ # Ajoutez des scripts dans votre package.json
109
+ # "scripts": {
110
+ # "build": "metadidomi-builder",
111
+ # "build:lite": "set LITE_BUILD=true && metadidomi-builder",
112
+ # "build:portable": "set CREATE_PORTABLE_EXE=true && metadidomi-builder",
113
+ # "build:python": "node node_modules/metadidomi-builder/build_tools_py/builder.py",
114
+ # "build:python:gui": "node node_modules/metadidomi-builder/build_tools_py/builder.py --gui"
115
+ # }
116
+
117
+ # Puis lancez avec :
118
+ npm run build # Build Electron standard
119
+ # ou
120
+ npm run build:lite # Build Electron optimisé
121
+ npm run build:portable # Exécutable portable
122
+ npm run build:python # Build Python (console)
123
+ npm run build:python:gui # Build Python (GUI)
124
+ ```
125
+
126
+ #### Option 2 : Utilisation directe avec npx
127
+
128
+ ```powershell
129
+ # Lancez directement sans installation
130
+ npx metadidomi-builder
131
+ ```
132
+
133
+ #### Option 3 : Installation Globale
134
+
135
+ ```powershell
136
+ # Installez globalement
137
+ npm install -g metadidomi-builder
138
+
139
+ # Lancez depuis n'importe où
140
+ metadidomi-builder
141
+ ```
142
+
143
+ ### Installation Manuelle (Avancé)
144
+
145
+ Si vous préférez installer manuellement :
146
+
147
+ 1. **Clonez le repository**
148
+ ```powershell
149
+ git clone https://github.com/METADIDOMIOFFICIEL/Metadidomi-Builder.git
150
+ cd metadidomi-builder
151
+ ```
152
+
153
+ 2. **Installez les dépendances**
54
154
  ```powershell
55
155
  npm install
56
156
  ```
57
- # � INSTALLATION DES DÉPENDANCES VENDOR
58
157
 
59
- Si lors de l'installation le dossier `build_tools/vendor` n'est pas présent, suivez ces instructions :
158
+ 3. **Téléchargez les modules vendor** (si absent)
159
+ - Téléchargez `vendor.zip` depuis :
160
+ https://github.com/METADIDOMIOFFICIEL/Metadidomi-Builder/releases/download/1.3.171125/vendor.zip
161
+ - Extrayez dans `build_tools/vendor/`
60
162
 
61
- . Téléchargez le fichier `vendor.zip` depuis :
62
- https://github.com/METADIDOMIOFFICIEL/Metadidomi-Builder/releases/download/1.3.171125/vendor.zip
163
+ 4. **Lancez le builder**
164
+ ```powershell
165
+ # Depuis le dossier d'installation
166
+ node build_tools/builder.js
63
167
 
64
- 💡 **Suite** :
65
- Vous pouvez aussi extraire manuellement le contenu de `vendor.zip` dans le dossier `build_tools/vendor`.
168
+ # Ou depuis votre app (en spécifiant le chemin)
169
+ node "C:\chemin-vers\metadidomi-builder\build_tools\builder.js"
170
+ ```
66
171
 
67
172
  ### Modules Embarqués - 100% Offline
68
173
 
69
- Toutes les dépendances essentielles sont incluses dans `build_tools/vendor/` :
174
+ Toutes les dépendances essentielles sont incluses dans `node_modules/metadidomi-builder/build_tools/vendor/` (installation npm) ou `build_tools/vendor/` (installation manuelle) :
70
175
 
71
176
  ```
72
- build_tools/vendor/
177
+ build_tools/vendor/ (ou node_modules/metadidomi-builder/build_tools/vendor/)
73
178
  ├── asar/ # Packaging et archivage
74
179
  ├── bytenode/ # Compilation JavaScript → bytecode V8
75
180
  ├── electron-asar/ # ASAR officiel Electron
@@ -97,22 +202,26 @@ Le builder intègre un **système automatique de signature** avec deux modes :
97
202
 
98
203
  #### Mode 1 : Auto-signé (Défaut - Développement)
99
204
  - ✅ Généré automatiquement lors du premier build
100
- - 📁 Stocké dans `build_tools/certs/cert-[hash].pfx`
101
- - 🔑 Mot de passe dans `build_tools/certs/cert-[hash].key`
205
+ - 📁 Stocké dans `node_modules/metadidomi-builder/build_tools/certs/cert-[hash].pfx` (npm) ou `build_tools/certs/cert-[hash].pfx` (manuel)
206
+ - 🔑 Mot de passe dans `cert-[hash].key`
102
207
  - ⚡ Aucune configuration requise
103
208
 
104
209
  #### Mode 2 : Certificat Personnalisé (Production)
105
210
 
106
211
  ```powershell
107
212
  # Option 1 : Fichier dans le dossier par défaut
108
- # Placer: build_tools/certs/signing.pfx
213
+ # Npm: Placer dans node_modules/metadidomi-builder/build_tools/certs/signing.pfx
214
+ # Manuel: Placer dans build_tools/certs/signing.pfx
109
215
 
110
216
  # Option 2 : Variables d'environnement
111
217
  $env:PFX_PATH="chemin/vers/certificat.pfx"
112
218
  $env:PFX_PASS="mot-de-passe-certificat"
113
219
 
114
- # Lancer le build
115
- node build_tools/builder.js
220
+ # Lancer le build avec npm
221
+ npm run build
222
+
223
+ # Ou avec npx
224
+ npx metadidomi-builder
116
225
  ```
117
226
 
118
227
  **Priorité de signature :**
@@ -123,16 +232,46 @@ node build_tools/builder.js
123
232
 
124
233
  ---
125
234
 
235
+ [⬆️ Retour en haut](#-multi-builder-premium)
236
+
126
237
  ## ⚡ Démarrage Rapide
127
238
 
128
- ### Pour les Pressés (< 5 min)
239
+ ### Pour les Pressés (< 5 min) - Installation npm
240
+
241
+ ```powershell
242
+ # 1. Installez le builder
243
+ npm i metadidomi-builder
244
+
245
+ # 2. Lancez le builder
246
+ npm run build
247
+
248
+ # 3. C'est tout ! ✅
249
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
250
+ ```
251
+
252
+ **OU directement avec npx :**
129
253
 
130
254
  ```powershell
131
255
  # 1. Allez dans votre dossier d'application
132
256
  cd D:\mon-app
133
257
 
134
- # 2. Lancez le builder
135
- node D:\chemin-vers\metadidomi-builder\build_tools\builder.js
258
+ # 2. Lancez le builder directement
259
+ npx metadidomi-builder
260
+
261
+ > **À savoir :**
262
+
263
+ # 3. C'est tout ! ✅
264
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
265
+ ```
266
+
267
+ ### Alternative : Installation Manuelle
268
+
269
+ ```powershell
270
+ # 1. Allez dans votre dossier d'application
271
+ cd D:\mon-app
272
+
273
+ # 2. Lancez le builder manuellement
274
+ node "C:\chemin-vers\metadidomi-builder\build_tools\builder.js"
136
275
 
137
276
  # 3. C'est tout ! ✅
138
277
  # Résultat: ./dist/MonApp-Setup-1.0.0.exe
@@ -149,6 +288,94 @@ mon-app/
149
288
 
150
289
  **Si aucun fichier n'existe, le builder génère une application de démo complète et fonctionnelle !** 🎉
151
290
 
291
+ ### ⚠️ Éviter les Boucles Infinies de Build
292
+
293
+ **IMPORTANT :** Configurez correctement votre `package.json` pour éviter que le builder relance indéfiniment des builds.
294
+
295
+ #### ❌ MAUVAIS - Créé une boucle infinie
296
+
297
+ ```json
298
+ {
299
+ "name": "mon-app",
300
+ "version": "1.0.0",
301
+ "scripts": {
302
+ "start": "npm run build",
303
+ "build": "metadidomi-builder"
304
+ }
305
+ }
306
+ ```
307
+
308
+ **Problème :** `npm run build` → `metadidomi-builder` → (re)crée `package.json` → retrigger scripts → boucle infinie ❌
309
+
310
+ #### ✅ BON - Structure Correcte
311
+
312
+ ```json
313
+ {
314
+ "name": "mon-app",
315
+ "version": "1.0.0",
316
+ "main": "main.js",
317
+ "scripts": {
318
+ "start": "electron .",
319
+ "dev": "electron .",
320
+ "build": "metadidomi-builder",
321
+ "build:lite": "set LITE_BUILD=true && metadidomi-builder",
322
+ "build:portable": "set CREATE_PORTABLE_EXE=true && metadidomi-builder"
323
+ },
324
+ "dependencies": {
325
+ "electron": "^31.0.0"
326
+ }
327
+ }
328
+ ```
329
+
330
+ **Points clés :**
331
+ - ✅ `"start"` lance **Electron**, pas le builder
332
+ - ✅ `"build"` lance **SEULEMENT** le builder
333
+ - ✅ Les scripts ne s'appellent pas mutuellement
334
+ - ✅ Pas de hook `prestart` ou `postinstall` qui relancerait build
335
+ - ✅ Le builder ne modifie PAS le package.json existant
336
+
337
+ #### 🛡️ Règles de Sécurité pour npm scripts
338
+
339
+ | Script | Doit faire | Doit PAS faire |
340
+ |--------|-----------|---|
341
+ | `start` | Lancer Electron ou l'app | Lancer le builder |
342
+ | `build` | Lancer le builder | Lancer d'autres scripts |
343
+ | `dev` | Mode développement Electron | Lancer le builder |
344
+ | `test` | Exécuter les tests | Lancer le builder |
345
+
346
+ #### 🔒 Protéger votre package.json
347
+
348
+ **Ne pas ajouter ces hooks dangereux :**
349
+
350
+ ```json
351
+ {
352
+ "scripts": {
353
+ "prestart": "npm run build", // ❌ DANGER: boucle
354
+ "postinstall": "npm run build", // ❌ DANGER: boucle
355
+ "prepare": "npm run build" // ❌ DANGER: boucle
356
+ }
357
+ }
358
+ ```
359
+
360
+ #### ✅ Alternative Sûre : Scripts Séparés
361
+
362
+ Si vous voulez build ET lancer, créez deux scripts distincts :
363
+
364
+ ```json
365
+ {
366
+ "scripts": {
367
+ "build": "metadidomi-builder",
368
+ "start": "electron .",
369
+ "build-and-run": "npm run build && npm start"
370
+ }
371
+ }
372
+ ```
373
+
374
+ **Utilisation :**
375
+ ```powershell
376
+ npm run build-and-run # ✅ Build PUIS lance l'app (une fois seulement)
377
+ ```
378
+
152
379
  ---
153
380
 
154
381
  ## 📦 Gestion des Dépendances - Installation et Utilisation
@@ -284,7 +511,11 @@ axios.get('https://api.example.com/data')
284
511
 
285
512
  ### 2. Tester Localement Avant de Packager
286
513
  ```powershell
287
- # Python
514
+ # Python - Installation npm
515
+ .\node_modules\metadidomi-builder\build_tools\vendor\python_embeddable\python.exe -m pip install -r requirements.txt
516
+ python __main__.py
517
+
518
+ # Python - Installation manuelle
288
519
  .\build_tools\vendor\python_embeddable\python.exe -m pip install -r requirements.txt
289
520
  python __main__.py
290
521
 
@@ -320,6 +551,19 @@ import numpy as np
320
551
 
321
552
  ### Python
322
553
 
554
+ **Installation npm :**
555
+ ```powershell
556
+ # Voir les dépendances qui peuvent être mises à jour
557
+ .\node_modules\metadidomi-builder\build_tools\vendor\python_embeddable\python.exe -m pip list --outdated
558
+
559
+ # Mettre à jour une dépendance
560
+ .\node_modules\metadidomi-builder\build_tools\vendor\python_embeddable\python.exe -m pip install --upgrade requests
561
+
562
+ # Mettre à jour tous les packages
563
+ .\node_modules\metadidomi-builder\build_tools\vendor\python_embeddable\python.exe -m pip install --upgrade -r requirements.txt
564
+ ```
565
+
566
+ **Installation manuelle :**
323
567
  ```powershell
324
568
  # Voir les dépendances qui peuvent être mises à jour
325
569
  .\build_tools\vendor\python_embeddable\python.exe -m pip list --outdated
@@ -352,8 +596,21 @@ npm update
352
596
 
353
597
  #### ⭐ Standard (Défaut) - Installateur NSIS
354
598
 
599
+ **Avec npm :**
355
600
  ```powershell
356
- node build_tools/builder.js
601
+ npm run build
602
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
603
+ ```
604
+
605
+ **Avec npx :**
606
+ ```powershell
607
+ npx metadidomi-builder
608
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
609
+ ```
610
+
611
+ **Manuel :**
612
+ ```powershell
613
+ node node_modules/metadidomi-builder/build_tools/builder.js
357
614
  # Résultat: ./dist/MonApp-Setup-1.0.0.exe
358
615
  ```
359
616
 
@@ -361,9 +618,15 @@ Crée un **installateur professionnel** avec options d'installation, raccourcis,
361
618
 
362
619
  #### 💾 Portable - Exécutable Autonome
363
620
 
621
+ **Avec npm :**
364
622
  ```powershell
365
- $env:CREATE_PORTABLE_EXE="true"
366
- node build_tools/builder.js
623
+ $env:CREATE_PORTABLE_EXE="true"; npm run build
624
+ # Résultat: ./dist/MonApp.exe (portable, ~130MB)
625
+ ```
626
+
627
+ **Avec npx :**
628
+ ```powershell
629
+ $env:CREATE_PORTABLE_EXE="true"; npx metadidomi-builder
367
630
  # Résultat: ./dist/MonApp.exe (portable, ~130MB)
368
631
  ```
369
632
 
@@ -371,9 +634,9 @@ Exécutable indépendant sans installation requise.
371
634
 
372
635
  #### ⚡ LITE - Mode Optimisé
373
636
 
637
+ **Avec npm :**
374
638
  ```powershell
375
- $env:LITE_BUILD="true"
376
- node build_tools/builder.js
639
+ $env:LITE_BUILD="true"; npm run build
377
640
  # Résultat: ./dist/MonApp-Setup-1.0.0.exe (optimisé)
378
641
  # Rapport: electron-lite-deps-report.txt
379
642
  ```
@@ -382,46 +645,52 @@ Analyse et exclut automatiquement les modules inutiles. Génère un rapport dét
382
645
 
383
646
  #### 🚫 Sans Installateur
384
647
 
648
+ **Avec npm :**
385
649
  ```powershell
386
- $env:SKIP_INSTALLER="true"
387
- node build_tools/builder.js
650
+ $env:SKIP_INSTALLER="true"; npm run build
388
651
  # Résultat: Ressources de base seulement
389
652
  ```
390
653
 
391
654
  #### 🔐 Avec Chiffrement
392
655
 
656
+ **Avec npm :**
393
657
  ```powershell
394
- $env:KEY="votre-clé-secrète"
395
- node build_tools/builder.js
658
+ $env:KEY="votre-clé-secrète"; npm run build
659
+ ```
660
+
661
+ **Avec npx :**
662
+ ```powershell
663
+ $env:KEY="votre-clé-secrète"; npx metadidomi-builder
396
664
  ```
397
665
 
398
666
  #### ⚙️ Compression UPX (Optionnelle)
399
667
 
668
+ **Mode rapide (recommandé) :**
400
669
  ```powershell
401
- # Mode rapide (recommandé)
402
- $env:USE_UPX="true"
403
- node build_tools/builder.js
670
+ $env:USE_UPX="true"; npm run build
671
+ ```
404
672
 
405
- # Mode ultra-brute (très lent, gain maximal)
406
- $env:USE_UPX="true"
407
- $env:UPX_ULTRA_BRUTE="true"
408
- node build_tools/builder.js
673
+ **Mode ultra-brute (très lent, gain maximal) :**
674
+ ```powershell
675
+ $env:USE_UPX="true"; $env:UPX_ULTRA_BRUTE="true"; npm run build
409
676
  ```
410
677
 
411
678
  #### 🔗 Combinaisons Utiles
412
679
 
680
+ **Portable + LITE + Chiffrement :**
413
681
  ```powershell
414
- # Portable + LITE + Chiffrement
415
682
  $env:CREATE_PORTABLE_EXE="true"
416
683
  $env:LITE_BUILD="true"
417
684
  $env:KEY="clé-secrète"
418
- node build_tools/builder.js
685
+ npm run build
686
+ ```
419
687
 
420
- # Avec UPX + Signature personnalisée
688
+ **Avec UPX + Signature personnalisée :**
689
+ ```powershell
421
690
  $env:USE_UPX="true"
422
691
  $env:PFX_PATH="cert.pfx"
423
692
  $env:PFX_PASS="mot-de-passe"
424
- node build_tools/builder.js
693
+ npm run build
425
694
  ```
426
695
 
427
696
  ### Paramètres Avancés
@@ -512,37 +781,25 @@ mon-app/
512
781
 
513
782
  Le builder intègre un **système complet de protection du code** avec obfuscation intelligente, chiffrement multi-couches, et anti-analyse.
514
783
 
515
- ### Deux Modes de Protection
784
+ ### Protection pour Electron
516
785
 
517
- **Mode Interactif** - Questions guidées pour chaque protection
786
+ **Avec npm :**
518
787
  ```powershell
519
- cd metadidomi-builder/build_tools_py/pyMetadidomi
520
- python pyMetadidomi.py
788
+ npm run build -- --light-protection
789
+ npm run build -- --medium-protection
790
+ npm run build -- --heavy-protection
521
791
  ```
522
792
 
523
- **Mode CLI** - Automatisé avec arguments
793
+ **Avec npx :**
524
794
  ```powershell
525
- # Presets rapides
526
- python pyMetadidomi.py script.py --light-protection # Léger
527
- python pyMetadidomi.py script.py --medium-protection # Moyen
528
- python pyMetadidomi.py script.py --heavy-protection # Maximal
529
-
530
- # Options individuelles
531
- python pyMetadidomi.py script.py --carbon # Obfuscation
532
- python pyMetadidomi.py script.py --junk # Code parasite
533
- python pyMetadidomi.py script.py --anti-vm # Anti-VM
534
- python pyMetadidomi.py script.py --multi-encrypt # Chiffrement multi-couches
795
+ npx metadidomi-builder --light-protection
796
+ npx metadidomi-builder --medium-protection
797
+ npx metadidomi-builder --heavy-protection
535
798
  ```
536
799
 
537
- ### Protection pour Electron
538
-
539
- ```powershell
540
- node build_tools/builder.js --light-protection
541
- node build_tools/builder.js --medium-protection
542
- node build_tools/builder.js --heavy-protection
543
- ```
800
+ **Remarque :** Pour les projets Python, voir la section [Protection du Code Python](#niveaux-de-protection-du-code-python).
544
801
 
545
- 👉 **[📖 Documentation complète des protections →](build_tools_py/PROTECTION_COMMANDS.md)**
802
+ 👉 **[📖 Documentation complète des protections →](node_modules/metadidomi-builder/build_tools_py/PROTECTION_COMMANDS.md)**
546
803
 
547
804
  ## Construction LITE (optimisation)
548
805
  ```powershell
@@ -554,20 +811,22 @@ Génère un rapport `electron-lite-deps-report.txt` avec les modules analysés.
554
811
  ## Clé de Chiffrement Personnalisée
555
812
  ```powershell
556
813
  $env:KEY="votre-clé-secrète"
557
- node build_tools/builder.js
814
+ npm run build
558
815
  ```
559
816
  Si non défini, une clé est générée automatiquement.
560
817
 
561
818
  ## Compression UPX
819
+ **Mode rapide (défaut) :**
562
820
  ```powershell
563
- # Mode rapide (défaut)
564
821
  $env:USE_UPX="true"
565
- node build_tools/builder.js
822
+ npm run build
823
+ ```
566
824
 
567
- # Mode ultra-brute (très lent)
825
+ **Mode ultra-brute (très lent) :**
826
+ ```powershell
568
827
  $env:USE_UPX="true"
569
828
  $env:UPX_ULTRA_BRUTE="true"
570
- node build_tools/builder.js
829
+ npm run build
571
830
  ```
572
831
 
573
832
  ---
@@ -612,19 +871,83 @@ Builder (compile, chiffre, empaque, signe)
612
871
 
613
872
  ## 📝 Exemples Pratiques
614
873
 
874
+ ### Installation npm + Utilisation - Electron
875
+
876
+ **Exemple 1 : Setup complet avec tous les scripts npm**
877
+
615
878
  ```powershell
616
- # Mode simple (depuis votre app)
617
- cd D:\MonApp
618
- node C:\metadidomi-builder\build_tools\builder.js
879
+ # Installez le builder
880
+ npm i metadidomi-builder
881
+
882
+ # Ajoutez les scripts à votre package.json:
883
+ # "scripts": {
884
+ # "start": "electron .",
885
+ # "dev": "electron .",
886
+ # "build": "metadidomi-builder",
887
+ # "build:lite": "set LITE_BUILD=true && metadidomi-builder",
888
+ # "build:portable": "set CREATE_PORTABLE_EXE=true && metadidomi-builder",
889
+ # "build:encrypted": "set KEY=ma-cle-secrete && metadidomi-builder",
890
+ # "build-and-run": "npm run build && echo Build complete!"
891
+ # }
892
+
893
+ # Puis lancez avec :
894
+ npm run build # Build standard → ./dist/MonApp-Setup-1.0.0.exe
895
+ npm run build:lite # Build optimisé → ./dist/MonApp-Setup-1.0.0.exe
896
+ npm run build:portable # Exécutable portable → ./dist/MonApp.exe
897
+ npm run build:encrypted # Avec clé → ./dist/MonApp-Setup-1.0.0.exe (chiffré)
898
+ npm run build-and-run # Build puis message
899
+ ```
900
+
901
+ **Exemple 2 : Avec options avancées dans package.json**
619
902
 
620
- # Avec source et sortie personnalisées
621
- node build_tools/builder.js --app-src D:\mon-app --output D:\dist
903
+ ```json
904
+ {
905
+ "name": "mon-app-electron",
906
+ "version": "1.0.0",
907
+ "main": "main.js",
908
+ "scripts": {
909
+ "start": "electron .",
910
+ "dev": "electron .",
911
+ "build": "metadidomi-builder",
912
+ "build:lite": "set LITE_BUILD=true && metadidomi-builder",
913
+ "build:portable": "set CREATE_PORTABLE_EXE=true && metadidomi-builder",
914
+ "build:upx": "set USE_UPX=true && metadidomi-builder",
915
+ "build:full": "set CREATE_PORTABLE_EXE=true && set LITE_BUILD=true && set USE_UPX=true && metadidomi-builder",
916
+ "build:protected": "set LITE_BUILD=true && metadidomi-builder --medium-protection"
917
+ },
918
+ "dependencies": {
919
+ "electron": "^31.0.0"
920
+ }
921
+ }
922
+ ```
923
+
924
+ **Exemple 3 : Avec npx (sans installation)**
925
+
926
+ ```powershell
927
+ npx metadidomi-builder # Build standard
928
+ npx metadidomi-builder --light-protection # Build avec protection légère
929
+ npx metadidomi-builder --medium-protection # Build avec protection moyenne
930
+ ```
622
931
 
623
- # Avec chiffrement
624
- $env:KEY="ma-clé-secrète"
625
- node build_tools/builder.js --app-src C:\MonApp
932
+ npm run build
933
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
934
+ ```
935
+
936
+ **Exemple 2 : Avec npx (sans installation)**
937
+ ```powershell
938
+ npx metadidomi-builder
939
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
940
+ ```
626
941
 
627
- # Portable + LITE + UPX
942
+ **Exemple 3 : Avec options personnalisées**
943
+ ```powershell
944
+ npm run build -- --light-protection
945
+ # Ou
946
+ $env:KEY="ma-clé-secrète"; npm run build
947
+ ```
948
+
949
+ **Exemple 4 : Portable + LITE + UPX**
950
+ ```powershell
628
951
  $env:CREATE_PORTABLE_EXE="true"
629
952
  $env:LITE_BUILD="true"
630
953
  $env:USE_UPX="true"
@@ -691,11 +1014,6 @@ L'injection ajoute automatiquement :
691
1014
 
692
1015
  ---
693
1016
 
694
- ## 📊 Comparaison avec electron-builder
695
- - Options d'obfuscation sûres et compatibles
696
- - Pas de transformation agressive du code
697
- - Préserve la stabilité de l'application
698
-
699
1017
  ### 📊 Protection multiniveau
700
1018
  Cette approche assure :
701
1019
  - ✅ **Sécurité maximale** : Protection forte contre l'analyse statique
@@ -1084,43 +1402,105 @@ L'empaquetage récursif est optimisé pour :
1084
1402
  | **Chiffrement ressources** | ✅ AES-256 intégré | ❌ Addon requis |
1085
1403
  | **Bytecode protection** | ✅ bytenode natif | ❌ Non |
1086
1404
  | **Mode LITE** | ✅ Analyse dépendances | ❌ Non |
1087
- | **Build reproducible** | ✅ Oui | ⚠️ Partiel |
1088
-
1089
- **metadidomi-builder** : Optimal pour sécurité maximale, 100% offline, protection bytecode
1090
- **electron-builder** : Optimal pour multi-plateforme, configuration simple, communauté large
1091
-
1092
- 👉 **Choisir metadidomi-builder si** : sécurité critique, environnement offline, control total
1093
- 👉 **Choisir electron-builder si** : multi-plateforme, setup simple, app standard
1405
+ | **Build reproducible** | ✅ 100% déterministe | ⚠️ Partiel |
1406
+ | **Packaging Python** | ✅ Oui (NSIS + obfuscation) | ❌ Non |
1407
+ | **Protection code Python** | pyMetadidomi (light/medium/heavy) | Non |
1408
+ | **Multi-plateforme** | Q1-2026 (macOS/Linux) | Windows/macOS/Linux |
1409
+ | **Communauté** | 🆕 En croissance | ✅ Très large |
1410
+ | **Support commercial** | Direct (ETS METADIDOMI) | ✅ Communauté + sponsors |
1411
+
1412
+ ### 🎯 Tableau Récapitulatif
1413
+
1414
+ **metadidomi-builder** :
1415
+ - ✅ **Sécurité maximale** - AES-256, bytecode, obfuscation pyMetadidomi
1416
+ - ✅ **100% offline** - Zéro dépendance externe, tous les outils embarqués
1417
+ - ✅ **Builds reproductibles** - Déterministe et versionnable
1418
+ - ✅ **Python support** - Applications Python complètes avec installateurs NSIS
1419
+ - ⏳ **Multi-plateforme** - Windows maintenant, macOS/Linux 2026
1420
+
1421
+ **electron-builder** :
1422
+ - ✅ **Multi-plateforme établi** - Windows, macOS, Linux, AppImage, Snap
1423
+ - ✅ **Configuration simple** - Template facile à adapter
1424
+ - ✅ **Communauté large** - Nombreuses extensions et plugins
1425
+ - ⚠️ **Dépendances réseau** - Nécessite téléchargements externe
1426
+ - ❌ **Python non supporté** - Electron uniquement
1427
+
1428
+ ### 💡 Comment Choisir?
1429
+
1430
+ **Utilisez metadidomi-builder si vous avez besoin de :**
1431
+ - 🔐 Sécurité critique (finance, santé, militaire)
1432
+ - 📦 Packaging Python standalone avec installateur professionnel
1433
+ - 🔒 Obfuscation et protection du code (anti-reverse engineering)
1434
+ - 🚫 Environnement complètement offline
1435
+ - ⚙️ Contrôle total sur le processus de build
1436
+
1437
+ **Utilisez electron-builder si vous avez besoin de :**
1438
+ - 🖥️ Multi-plateforme stable et mature
1439
+ - 🚀 Setup rapide et facile (peu de configuration)
1440
+ - 👥 Accès à une large communauté et d'extensions
1441
+ - 📱 Support macOS/Linux dès maintenant
1442
+ - 🔄 Updates automatiques intégrées
1094
1443
 
1095
1444
  ---
1096
1445
 
1446
+ [⬆️ Retour en haut](#-multi-builder-premium)
1447
+
1097
1448
  ## � Packaging d'Applications Python
1098
1449
 
1099
1450
  Le builder inclut aussi un **système complet de packaging Python** via `builder.py` pour créer des applications Windows standalone avec installateurs NSIS professionnels.
1100
1451
 
1452
+
1101
1453
  ### 🚀 Démarrage Rapide - Applications Python
1102
1454
 
1103
- **Le plus simple** - Exécutez le builder Python depuis votre dossier d'application :
1455
+ **Option 1 : Via npm (Recommandée)**
1104
1456
 
1105
1457
  ```powershell
1106
- # Depuis votre répertoire d'application Python
1107
- cd D:\mon-app-python
1108
- python D:\chemin-vers\metadidomi-builder\build_tools_py\builder.py
1458
+ # Installez le builder
1459
+ npm i metadidomi-builder
1460
+
1461
+ # Ajoutez des scripts dans votre package.json
1462
+ # "scripts": {
1463
+ # "build:python": "python node_modules\\metadidomi-builder\\build_tools_py\\builder.py --app-src ./src",
1464
+ # "build:python:gui": "python node_modules\\metadidomi-builder\\build_tools_py\\builder.py --gui --app-src ./src"
1465
+ # }
1466
+
1467
+ # Puis lancez avec :
1468
+ npm run build:python # Mode console (par défaut)
1469
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
1109
1470
 
1471
+ # OU
1472
+ npm run build:python:gui # Mode GUI (sans console)
1110
1473
  # Résultat: ./dist/MonApp-Setup-1.0.0.exe
1111
1474
  ```
1112
1475
 
1113
- **Ou avec options personnalisées :**
1476
+ > **Astuce :** Placez toujours vos sources Python dans un dossier `src/` et ajoutez l’option `--app-src ./src` à vos scripts dans le `package.json`. Cela évite les erreurs de scan des dossiers `node_modules` et `vendor` (chemins trop longs ou fichiers manquants).
1477
+ > Placez vos fichiers sources Python (`config.py`, `__main__.py`, etc.) dans un dossier séparé (ex : `src/`).
1478
+ > Puis lancez le build en précisant le chemin source :
1479
+ > ```powershell
1480
+ > npm run build:python -- --app-src ./src
1481
+ > ```
1482
+ > Cela évite que le builder scanne le dossier `node_modules` et les vendors, et prévient les erreurs de chemin trop long ou manquant.
1483
+
1484
+ **Option 2 : Avec npx (sans installation)**
1114
1485
 
1115
1486
  ```powershell
1116
- # Source et sortie personnalisées
1117
- python builder.py --app-src D:\mon-app --output D:\dist
1487
+ npx metadidomi-builder-python
1488
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
1489
+ ```
1490
+
1491
+ **Option 3 : Installation Manuelle**
1492
+
1493
+ ```powershell
1494
+ # Mode console simple
1495
+ node "C:\chemin-vers\metadidomi-builder\build_tools_py\builder.py"
1496
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
1118
1497
 
1119
1498
  # Mode GUI (sans fenêtre console)
1120
- python builder.py --gui
1499
+ node "C:\chemin-vers\metadidomi-builder\build_tools_py\builder.py" --gui
1500
+ # Résultat: ./dist/MonApp-Setup-1.0.0.exe
1121
1501
 
1122
- # Combiné
1123
- python builder.py --app-src D:\mon-app --output D:\dist --gui
1502
+ # Avec source et sortie personnalisées
1503
+ node "C:\chemin-vers\metadidomi-builder\build_tools_py\builder.py" --app-src D:\mon-app --output D:\dist --gui
1124
1504
  ```
1125
1505
 
1126
1506
  ### 📋 Structure Minimale d'une Application Python
@@ -1340,7 +1720,9 @@ Le builder utilise **Python Embeddable** pour les utilisateurs finaux :
1340
1720
  - ✅ Distribution portable
1341
1721
  - ✅ Inclus dans l'installateur NSIS
1342
1722
 
1343
- **Localisation :** `build_tools/vendor/python_embeddable/`
1723
+ **Localisation :**
1724
+ - Installation npm : `node_modules/metadidomi-builder/build_tools/vendor/python_embeddable/`
1725
+ - Installation manuelle : `build_tools/vendor/python_embeddable/`
1344
1726
 
1345
1727
  ### 🔐 Protection du Code Python
1346
1728
 
@@ -1363,6 +1745,24 @@ Le builder utilise **Python Embeddable** pour les utilisateurs finaux :
1363
1745
  - Code Python injecté dynamiquement
1364
1746
  - Exécution directe sans interpréteur externe
1365
1747
 
1748
+ #### Niveaux de protection du code Python
1749
+
1750
+ Vous pouvez protéger votre code Python lors du build avec différents niveaux de protection :
1751
+
1752
+ ```powershell
1753
+ npm run build:python -- --app-src ./src --light-protection
1754
+ npm run build:python:gui -- --app-src ./src --medium-protection
1755
+ npm run build:python -- --app-src ./src --heavy-protection
1756
+ ```
1757
+
1758
+ **Options de protection :**
1759
+
1760
+ - `--light-protection` : Obfuscation légère (carbon + junk)
1761
+ - `--medium-protection` : Obfuscation moyenne (carbon + junk + bugs + dead-code)
1762
+ - `--heavy-protection` : Protection maximale (toutes les options)
1763
+
1764
+ **Remarque :** Ces options ne concernent que les projets Python. Pour Electron, voir la section correspondante.
1765
+
1366
1766
  ### 📊 Fichiers Générés
1367
1767
 
1368
1768
  ```
@@ -1381,54 +1781,59 @@ dist/
1381
1781
 
1382
1782
  #### Exemple 1 : Application Console Simple
1383
1783
 
1784
+ **Avec npm :**
1384
1785
  ```powershell
1385
1786
  # Structure
1386
1787
  mon-app/
1387
- config.py
1388
- __main__.py
1788
+ src/
1789
+ config.py
1790
+ __main__.py
1389
1791
 
1390
1792
  # Build
1391
1793
  cd mon-app
1392
- python ..\builder.py
1794
+ npm run build:python -- --app-src ./src
1393
1795
  # Résultat: ./dist/MonApp-Setup-1.0.0.exe
1394
1796
  ```
1395
1797
 
1396
1798
  #### Exemple 2 : Application Tkinter GUI
1397
1799
 
1800
+ **Avec npm :**
1398
1801
  ```powershell
1399
1802
  # Structure
1400
1803
  mon-app-gui/
1401
- config.py
1402
- __main__.py ← Interface Tkinter
1403
- assets/
1404
- icon.ico
1804
+ src/
1805
+ config.py
1806
+ __main__.py ← Interface Tkinter
1807
+ assets/
1808
+ icon.ico
1405
1809
 
1406
1810
  # Build (mode GUI pour éviter console)
1407
- cd mon-app-gui
1408
- python ..\..\builder.py --gui
1811
+ npm run build:python:gui -- --app-src ./src
1409
1812
  # Résultat: ./dist/MonApp-Setup-1.0.0.exe (pas de console)
1410
1813
  ```
1411
1814
 
1412
1815
  #### Exemple 3 : Application Complexe Multi-Fichiers
1413
1816
 
1817
+ **Avec npm :**
1414
1818
  ```powershell
1415
1819
  # Structure complexe
1416
1820
  mon-app/
1417
- config.py
1418
- __main__.py
1419
- utils/
1420
- helpers.py
1421
- validators.py
1422
- lib/
1423
- core.py
1424
- handlers/
1425
- events.py
1426
- assets/
1427
- icon.ico
1428
- data.json
1821
+ src/
1822
+ config.py
1823
+ __main__.py
1824
+ utils/
1825
+ helpers.py
1826
+ validators.py
1827
+ lib/
1828
+ core.py
1829
+ handlers/
1830
+ events.py
1831
+ assets/
1832
+ icon.ico
1833
+ data.json
1429
1834
 
1430
- # Build avec sortie personnalisée
1431
- python builder.py --app-src D:\mon-app --output D:\dist
1835
+ # Build
1836
+ npm run build:python -- --app-src ./src
1432
1837
  # TOUS les fichiers récursivement inclus ✅
1433
1838
  ```
1434
1839
 
@@ -1436,30 +1841,52 @@ python builder.py --app-src D:\mon-app --output D:\dist
1436
1841
 
1437
1842
  #### Avec Clé de Chiffrement Personnalisée
1438
1843
 
1844
+ **Avec npm :**
1845
+ ```powershell
1846
+ # Via variable d'environnement
1847
+ $env:KEY = "ma-clé-secrète-32-caractères"
1848
+ npm run build:python -- --app-src ./src
1849
+ ```
1850
+
1851
+ **Manuel :**
1439
1852
  ```powershell
1440
1853
  # Option 1: Via argument
1441
- python builder.py --key "ma-clé-secrète-32-caractères"
1854
+ node build_tools_py/builder.py --app-src ./src --key "ma-clé-secrète-32-caractères"
1442
1855
 
1443
1856
  # Option 2: Via variable d'environnement
1444
1857
  $env:KEY = "ma-clé-secrète-32-caractères"
1445
- python builder.py
1858
+ node build_tools_py/builder.py --app-src ./src
1446
1859
  ```
1447
1860
 
1448
1861
  #### Sans Compilation .pyc
1449
1862
 
1863
+ **Avec npm :**
1864
+
1450
1865
  ```powershell
1451
- python builder.py --no-pyc
1866
+ npm run build:python -- --no-pyc --app-src ./src
1867
+ ```
1868
+
1869
+ **Manuel :**
1870
+ ```powershell
1871
+ node build_tools_py/builder.py --app-src ./src --no-pyc
1452
1872
  # Les .py restent non compilés (plus rapide au build)
1453
1873
  ```
1454
1874
 
1455
1875
  #### Combinaisons
1456
1876
 
1877
+ **Avec npm :**
1457
1878
  ```powershell
1458
- # GUI + sortie personnalisée + clé custom
1459
- python builder.py --gui --output D:\dist --key "clé-secrète"
1879
+ # GUI + clé custom
1880
+ $env:KEY = "clé-secrète"; npm run build:python:gui -- --app-src ./src
1881
+ ```
1882
+
1883
+ **Manuel :**
1884
+ ```powershell
1885
+ # GUI + clé custom
1886
+ node build_tools_py/builder.py --app-src ./src --gui --key "clé-secrète"
1460
1887
 
1461
1888
  # Source custom + GUI + sans .pyc
1462
- python builder.py --app-src D:\mon-app --gui --no-pyc
1889
+ node build_tools_py/builder.py --app-src D:\mon-app --gui --no-pyc
1463
1890
  ```
1464
1891
 
1465
1892
  ### 🔍 Dépistage et Débogage
@@ -1562,6 +1989,8 @@ Pour les questions sur le packaging Python :
1562
1989
 
1563
1990
  ---
1564
1991
 
1992
+ [⬆️ Retour en haut](#-multi-builder-premium)
1993
+
1565
1994
  ## �🗺️ Roadmap - Vision Multi-Plateforme
1566
1995
 
1567
1996
  ### Phase 1 : Windows ✅ (Actuelle)