- Lea.iss : script Inno Setup 6 (enrollment 2 pages, licence, machine_id) - build_installer.sh : staging + ISCC (compatible Wine sur Linux) - uninstall_lea.ps1 : kill PID + cleanup + notif serveur - configure_embed.ps1 : Python 3.12 embedded optionnel - config_template.txt : modèle pour installation silencieuse - LICENSE.txt : CGU AI Act Art. 50 - README.md : doc build, signing, déploiement silencieux Paramètres d'installation silencieuse : Lea-Setup-v1.0.0.exe /VERYSILENT /CONFIG=enroll.txt /LOG=install.log Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
228 lines
6.9 KiB
Markdown
228 lines
6.9 KiB
Markdown
# Installeur Lea (Inno Setup)
|
|
|
|
Installeur Windows professionnel pour Lea, remplacant le ZIP + `install.bat` artisanal.
|
|
|
|
## Resume
|
|
|
|
Produit `Lea-Setup-v1.0.0.exe` dans `deploy/releases/`.
|
|
|
|
Caracteristiques :
|
|
- Interface francaise, moderne (style wizard Windows 10/11)
|
|
- Page custom d'enrollment (nom, email, ID interne, URL serveur, token)
|
|
- Generation automatique de `machine_id` unique (GUID + hash hostname)
|
|
- `config.txt` genere a partir des donnees saisies
|
|
- Option bundle Python 3.12 embedded (postes sans droits admin)
|
|
- Raccourci demarrage automatique (`shell:startup`) optionnel
|
|
- Notification serveur a l'install / desinstall (best-effort)
|
|
- Installation silencieuse : `/VERYSILENT /CONFIG=enroll.txt`
|
|
- Desinstallation propre : kill process, cleanup, export logs
|
|
|
|
## Pre-requis pour compiler
|
|
|
|
### Inno Setup 6.2+
|
|
|
|
Telecharger depuis [jrsoftware.org](https://jrsoftware.org/isinfo.php) et installer
|
|
`innosetup-6.x.exe`. Le compilateur `ISCC.exe` doit etre accessible.
|
|
|
|
### Alternative Linux : Wine
|
|
|
|
```bash
|
|
# Installation
|
|
winetricks innosetup
|
|
# Ou : telecharger innosetup-6.x.exe et lancer : wine innosetup-6.x.exe
|
|
|
|
# Verifier
|
|
ls "$HOME/.wine/drive_c/Program Files (x86)/Inno Setup 6/ISCC.exe"
|
|
```
|
|
|
|
Le script `build_installer.sh` detecte automatiquement Wine si present.
|
|
|
|
## Build local
|
|
|
|
### Build complet (staging + compilation)
|
|
|
|
```bash
|
|
cd rpa_vision_v3
|
|
./deploy/installer/build_installer.sh
|
|
```
|
|
|
|
Produit `deploy/releases/Lea-Setup-v1.0.0.exe`.
|
|
|
|
### Build staging uniquement (sans ISCC)
|
|
|
|
```bash
|
|
./deploy/installer/build_installer.sh --stage-only
|
|
```
|
|
|
|
Prepare `deploy/build/installer_staging/` puis affiche la commande ISCC a executer
|
|
sur Windows.
|
|
|
|
### Nettoyer avant
|
|
|
|
```bash
|
|
./deploy/installer/build_installer.sh --clean
|
|
```
|
|
|
|
## Build sur Windows (recommande pour production)
|
|
|
|
1. Copier le dossier `deploy/` sur le PC Windows
|
|
2. Ouvrir `deploy/installer/Lea.iss` dans Inno Setup Compiler
|
|
3. `Build > Compile` (ou F9)
|
|
4. Recuperer `deploy/releases/Lea-Setup-v1.0.0.exe`
|
|
|
|
## Python 3.12 embedded (optionnel)
|
|
|
|
Pour bundler Python directement dans l'installeur (evite d'exiger que les postes
|
|
aient Python installe) :
|
|
|
|
```bash
|
|
# Sur Linux
|
|
cd deploy/installer
|
|
wget https://www.python.org/ftp/python/3.12.8/python-3.12.8-embed-amd64.zip
|
|
mkdir python-3.12-embed
|
|
unzip python-3.12.8-embed-amd64.zip -d python-3.12-embed/
|
|
```
|
|
|
|
Le staging copie automatiquement ce dossier si present. Le composant
|
|
"pythonembed" devient alors selectionnable dans l'installeur.
|
|
|
|
Le script `configure_embed.ps1` :
|
|
1. Patche `python312._pth` pour activer `import site`
|
|
2. Installe `pip` via `get-pip.py`
|
|
3. Installe `requirements_agent.txt`
|
|
4. Reecrit `Lea.bat` pour pointer sur `python-embed\pythonw.exe`
|
|
|
|
## Installation silencieuse (deploiement de masse)
|
|
|
|
Pour deployer sans interaction utilisateur (GPO, SCCM, script PowerShell) :
|
|
|
|
1. Preparer un fichier `enroll.txt` par poste (ou un commun) :
|
|
|
|
```
|
|
USER_NAME=Jean Dupont
|
|
USER_EMAIL=jean.dupont@aivanov.com
|
|
USER_ID=EMP-00123
|
|
SERVER_URL=https://lea.labs.laurinebazin.design/api/v1
|
|
API_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
```
|
|
|
|
2. Lancer l'installeur :
|
|
|
|
```cmd
|
|
Lea-Setup-v1.0.0.exe /VERYSILENT /CONFIG=C:\temp\enroll.txt /DIR="C:\Lea"
|
|
```
|
|
|
|
Parametres Inno Setup utiles :
|
|
- `/VERYSILENT` : aucune UI
|
|
- `/SILENT` : barre de progression seulement
|
|
- `/DIR="..."` : dossier d'installation
|
|
- `/LOG="install.log"` : log d'installation
|
|
- `/TASKS="startmenuicon,autostart"` : composants a installer (voir `[Tasks]` et `[Components]`)
|
|
- `/CONFIG=path` : fichier d'enrollment (custom, specifique a Lea)
|
|
|
|
## Signature du .exe (SmartScreen)
|
|
|
|
Sans signature, Windows SmartScreen affiche un avertissement rouge ("Cet editeur
|
|
est inconnu"). Pour eviter cela, signer l'installeur avec un certificat
|
|
code-signing.
|
|
|
|
### Options de certificat
|
|
|
|
1. **Certificat OV (Organization Validation)** : ~200-400 EUR/an
|
|
- Sectigo, DigiCert, GlobalSign
|
|
- SmartScreen apprend la reputation progressivement (~30 installations)
|
|
- Livre sur token USB FIPS depuis 2023
|
|
|
|
2. **Certificat EV (Extended Validation)** : ~400-700 EUR/an
|
|
- Reputation SmartScreen immediate (pas d'avertissement des la 1ere install)
|
|
- Strict : obligatoirement sur token USB
|
|
|
|
### Signature manuelle (avec signtool.exe du Windows SDK)
|
|
|
|
```cmd
|
|
signtool sign ^
|
|
/tr http://timestamp.sectigo.com ^
|
|
/td sha256 ^
|
|
/fd sha256 ^
|
|
/a ^
|
|
"deploy\releases\Lea-Setup-v1.0.0.exe"
|
|
|
|
signtool verify /pa /v "deploy\releases\Lea-Setup-v1.0.0.exe"
|
|
```
|
|
|
|
### Signature automatique dans Inno Setup
|
|
|
|
Ajouter dans `Lea.iss` apres `[Setup]` :
|
|
|
|
```
|
|
SignTool=signtool $f
|
|
```
|
|
|
|
Et declarer le signtool via `ISCC.exe /Ssigntool=...` au build.
|
|
|
|
### Solution interne (certif AIVANOV)
|
|
|
|
Si AIVANOV a deja un certificat code-signing, le token USB + mot de passe
|
|
suffisent. Sinon, Sectigo OV est un bon choix d'entree de gamme.
|
|
|
|
## Structure du dossier installer/
|
|
|
|
```
|
|
deploy/installer/
|
|
├── Lea.iss # Script Inno Setup principal
|
|
├── build_installer.sh # Helper bash (staging + ISCC)
|
|
├── uninstall_lea.ps1 # Script de desinstallation propre
|
|
├── configure_embed.ps1 # Configuration Python embedded
|
|
├── config_template.txt # Modele config pour /VERYSILENT /CONFIG=
|
|
├── LICENSE.txt # CGU affichees dans la page licence
|
|
└── README.md # Ce fichier
|
|
```
|
|
|
|
## Test de l'installeur
|
|
|
|
1. **Machine de test Windows 11** (VM ou PC physique, idealement sans Python)
|
|
2. Copier `Lea-Setup-v1.0.0.exe` sur la machine
|
|
3. Double-cliquer : verifier que l'enrollment s'affiche en francais
|
|
4. Tester l'installation (avec et sans Python deja installe)
|
|
5. Verifier le fichier `C:\Program Files\Lea\config.txt` genere
|
|
6. Verifier le raccourci `shell:startup` (si option cochee)
|
|
7. Lancer Lea, verifier la connexion au serveur
|
|
8. Tester la desinstallation depuis "Ajout/suppression de programmes"
|
|
|
|
### Test automatise (PowerShell, sur la VM)
|
|
|
|
```powershell
|
|
# Installation silencieuse
|
|
$cfg = "C:\temp\enroll.txt"
|
|
@"
|
|
USER_NAME=Test Automatique
|
|
USER_EMAIL=test@aivanov.com
|
|
"@ | Out-File -Encoding ASCII $cfg
|
|
|
|
.\Lea-Setup-v1.0.0.exe /VERYSILENT /CONFIG=$cfg /LOG="C:\temp\install.log"
|
|
|
|
# Verifications
|
|
Test-Path "C:\Program Files\Lea\config.txt"
|
|
Get-Content "C:\Program Files\Lea\machine_id.txt"
|
|
|
|
# Desinstallation silencieuse
|
|
$uninst = Get-WmiObject Win32_Product | Where-Object { $_.Name -like "Lea*" }
|
|
$uninst.Uninstall()
|
|
```
|
|
|
|
## Notes et limites connues
|
|
|
|
- **Endpoint serveur `/agents/enroll` et `/agents/uninstall` :** pas encore
|
|
implemente cote serveur (avril 2026). L'installeur envoie la requete en
|
|
best-effort, une erreur est silencieusement ignoree. A implementer dans
|
|
`agent_v0/server_v1/api_stream.py` quand necessaire.
|
|
- **Python embedded :** le patch `python312._pth` + pip bootstrap fonctionne mais
|
|
augmente la taille de l'installeur (~25 MB). A reserver aux postes sans
|
|
Python.
|
|
- **Code signing :** indispensable pour deploiement hopital/client. Prevoir le
|
|
budget certificat (400-700 EUR/an) dans la roadmap commerciale.
|
|
|
|
## Historique
|
|
|
|
- v1.0.0 (2026-04-13) : Premiere version de l'installeur Inno Setup.
|