summaryrefslogtreecommitdiff
path: root/scripts/install-tridactyl-native.ps1
blob: fed740b1fa84db178a7cf9c4d893108584b42b2f (plain)
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
# 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
}