- template/ : build Packer du template Windows 11 (ex /data/Installer/MyTemplate) - deploy/ : OpenTofu + playbooks Ansible (ex /data/Tofu) - bin/Deploy : menu de déploiement (lien depuis /usr/local/bin/Deploy) - jeton API Proxmox sorti des playbooks vers deploy/proxmox-secret.yml (hors git) - README.md : documentation de la structure et du mode opératoire - Ameliorations.md : recommandations pour fiabiliser les mesures - tests/ (dépôt beWeapon-LT) et archives/ exclus Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
2.1 KiB
PowerShell
47 lines
2.1 KiB
PowerShell
Set-ExecutionPolicy Bypass -Scope Process -Force
|
|
|
|
# Log initial
|
|
"Lancement de beWeapon.ps1..." | Out-File -FilePath "C:\install.log" -Append -Encoding utf8
|
|
|
|
# Détection robuste du lecteur contenant le dossier "install"
|
|
$cdDrive = Get-PSDrive -PSProvider FileSystem | Where-Object {
|
|
Test-Path (Path.Combine($_.Root, "install"))
|
|
} | Select-Object -First 1
|
|
|
|
if (-not $cdDrive) {
|
|
Write-Error "Dossier 'install' introuvable sur les lecteurs de disque."
|
|
"Dossier install introuvable." | Out-File -FilePath "C:\install.log" -Append -Encoding utf8
|
|
exit 1
|
|
}
|
|
|
|
# Formate proprement le chemin (ex: "E:\install")
|
|
$installDir = Join-Path -Path "$($cdDrive.Name):\" -ChildPath "install"
|
|
"Dossier d'installation trouvé dans : $installDir" | Out-File -FilePath "C:\install.log" -Append -Encoding utf8
|
|
|
|
# 1. Installation de beWeapon
|
|
$installer = Get-ChildItem -Path $installDir -Filter "*Weapon Tracer*" -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
|
|
if ($installer) {
|
|
Start-Process -FilePath $installer.FullName -ArgumentList "/passive /norestart" -Wait
|
|
"beWeapon installé avec succès depuis $($installer.FullName)." | Out-File -FilePath "C:\install.log" -Append -Encoding utf8
|
|
} else {
|
|
Write-Error "Installeur beWeapon introuvable dans $installDir"
|
|
"beWeapon introuvable dans $installDir." | Out-File -FilePath "C:\install.log" -Append -Encoding utf8
|
|
exit 1
|
|
}
|
|
|
|
# 2. Décompression de OmnitrackSettings.zip
|
|
$zipFile = Get-ChildItem -Path $installDir -Filter "OmnitrackSettings.zip" -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
|
|
if ($zipFile) {
|
|
$destinationPath = "C:\ProgramData\Beweis\Omnitrack\"
|
|
if (-not (Test-Path -Path $destinationPath)) {
|
|
New-Item -Path $destinationPath -ItemType Directory -Force | Out-Null
|
|
}
|
|
Expand-Archive -Path $zipFile.FullName -DestinationPath $destinationPath -Force
|
|
"Archive OmnitrackSettings.zip extraite dans $destinationPath" | Out-File -FilePath "C:\install.log" -Append -Encoding utf8
|
|
} else {
|
|
Write-Warning "Archive OmnitrackSettings.zip introuvable dans $installDir"
|
|
"Archive OmnitrackSettings.zip introuvable." | Out-File -FilePath "C:\install.log" -Append -Encoding utf8
|
|
}
|