fix: 安装 9008 驱动时把证书写入受信任根

This commit is contained in:
2026-11-27 09:56:52 +08:00
parent 64b01f886b
commit 44ff5de655
+11
View File
@@ -51,7 +51,18 @@ if (-not (Test-Admin)) {
}
if (Test-Path -LiteralPath $cer) {
# 这份目录是 libwdi 自签名。只放进 TrustedPublisher 时,
# 代码完整性仍报 0x800b0109,pnputil 最终返回 0xE0000247。
& certutil.exe -addstore -f Root $cer | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Output ("DRIVER`tFAIL`tcert-root-" + $LASTEXITCODE)
exit 1
}
& certutil.exe -addstore -f TrustedPublisher $cer | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Output ("DRIVER`tFAIL`tcert-publisher-" + $LASTEXITCODE)
exit 1
}
}
$proc = Start-Process -FilePath "$env:SystemRoot\System32\pnputil.exe" -ArgumentList @('/add-driver', $inf, '/install') -Wait -PassThru -NoNewWindow
if (Test-QhsusbInstalled) {