# Script pour installer le native messenger Tridactyl # Copie le fichier tridactyl.json vers l'emplacement attendu par Firefox $ErrorActionPreference = "Stop" Write-Host "=== Installation du Native Messenger Tridactyl ===" -ForegroundColor Cyan Write-Host "" $sourcePath = "$env:USERPROFILE\.tridactyl\tridactyl.json" $targetPath = "$env:APPDATA\Mozilla\NativeMessagingHosts\tridactyl.json" $targetDir = Split-Path $targetPath -Parent # Verifier que le fichier source existe if (-not (Test-Path $sourcePath)) { Write-Host "[ERREUR] Fichier source introuvable: $sourcePath" -ForegroundColor Red Write-Host "Assurez-vous que le native messenger est installe dans: $sourcePath" -ForegroundColor Yellow exit 1 } Write-Host "Source: $sourcePath" -ForegroundColor Gray Write-Host "Destination: $targetPath" -ForegroundColor Gray Write-Host "" # Creer le repertoire de destination si necessaire if (-not (Test-Path $targetDir)) { Write-Host "Creation du repertoire: $targetDir" -ForegroundColor Yellow New-Item -ItemType Directory -Path $targetDir -Force | Out-Null Write-Host "[OK] Repertoire cree" -ForegroundColor Green } # Copier le fichier Write-Host "Copie du fichier..." -ForegroundColor Yellow Copy-Item -Path $sourcePath -Destination $targetPath -Force Write-Host "[OK] Fichier copie avec succes" -ForegroundColor Green # Verifier que le fichier a ete copie correctement if (Test-Path $targetPath) { Write-Host "" Write-Host "[OK] Installation terminee avec succes!" -ForegroundColor Green Write-Host "" Write-Host "Prochaines etapes:" -ForegroundColor Yellow Write-Host "1. Redemarrez Firefox completement" -ForegroundColor Gray Write-Host "2. Ouvrez Firefox et appuyez sur ':' pour ouvrir Tridactyl" -ForegroundColor Gray Write-Host "3. Tapez ':native' pour verifier la connexion" -ForegroundColor Gray } else { Write-Host "[ERREUR] Le fichier n'a pas ete copie correctement" -ForegroundColor Red exit 1 }