33 lines
1.2 KiB
PowerShell
33 lines
1.2 KiB
PowerShell
#Requires -RunAsAdministrator
|
|
[CmdletBinding()]
|
|
param([string]$WdkRoot)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$projectDir = $PSScriptRoot
|
|
$repoRoot = (Resolve-Path (Join-Path $projectDir '..\..')).Path
|
|
. (Join-Path $projectDir 'common.ps1')
|
|
$wdkRoot = Find-Qa6WdkRoot -ExplicitRoot $WdkRoot -RepoRoot $repoRoot
|
|
$wdkVersion = Find-Qa6WdkVersion -WdkRoot $wdkRoot
|
|
$packageDir = Join-Path $projectDir 'package'
|
|
$certificate = Join-Path $packageDir 'QemuA6Ude-Test.cer'
|
|
$inf = Join-Path $packageDir 'QemuA6Ude.inf'
|
|
$devcon = Join-Path $wdkRoot "tools\$wdkVersion\x64\devcon.exe"
|
|
|
|
foreach ($required in @($certificate, $inf, $devcon)) {
|
|
if (-not (Test-Path -LiteralPath $required -PathType Leaf)) {
|
|
throw "Fichier requis introuvable : $required"
|
|
}
|
|
}
|
|
|
|
Import-Certificate -FilePath $certificate -CertStoreLocation Cert:\LocalMachine\Root | Out-Null
|
|
Import-Certificate -FilePath $certificate -CertStoreLocation Cert:\LocalMachine\TrustedPublisher | Out-Null
|
|
|
|
& $devcon install $inf 'Root\QemuA6Ude'
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw "Installation du pilote échouée ($LASTEXITCODE)."
|
|
}
|
|
|
|
Write-Host 'Pilote QemuA6Ude installé.'
|
|
Write-Host 'Le périphérique enfant USB\VID_05AC&PID_1227 doit maintenant apparaître.'
|