|
| 1 | +#Requires -RunAsAdministrator |
| 2 | +<# |
| 3 | +.SYNOPSIS |
| 4 | + AMD Phoenix GPU + Audio + NPU Driver Installer - Windows Server 2025 |
| 5 | +.DESCRIPTION |
| 6 | + Tek tiklama ile tum AMD driverlarini kurar. |
| 7 | + - Test signing aktif eder (reboot gerekirse sorar) |
| 8 | + - Self-signed sertifika olusturur |
| 9 | + - WDK/SDK otomatik kurar (yoksa) |
| 10 | + - GPU catalog olusturup imzalar |
| 11 | + - Tum driverlari kurar |
| 12 | +.NOTES |
| 13 | + GPU: AMD Radeon(TM) 780M - PCI\VEN_1002&DEV_15BF&SUBSYS_15BF1002&REV_D2 |
| 14 | +#> |
| 15 | + |
| 16 | +param([switch]$NoReboot) |
| 17 | + |
| 18 | +$ErrorActionPreference = 'Stop' |
| 19 | +$root = Split-Path -Parent $MyInvocation.MyCommand.Path |
| 20 | + |
| 21 | +# --- Yardimcilar --- |
| 22 | +$script:step = 1 |
| 23 | +function Step { param($m) Write-Host "`n=== [$($script:step)] $m ===" -ForegroundColor Cyan; $script:step++ } |
| 24 | +function OK { param($m) Write-Host " [OK] $m" -ForegroundColor Green } |
| 25 | +function WARN { param($m) Write-Host " [!] $m" -ForegroundColor Yellow } |
| 26 | +function FAIL { param($m) Write-Host " [X] $m" -ForegroundColor Red } |
| 27 | + |
| 28 | +# --- Banner --- |
| 29 | +Write-Host "" |
| 30 | +Write-Host " ========================================================" -ForegroundColor White |
| 31 | +Write-Host " AMD Phoenix Driver Installer - Windows Server 2025" -ForegroundColor Cyan |
| 32 | +Write-Host " GPU: AMD Radeon(TM) 780M | Audio | NPU" -ForegroundColor Cyan |
| 33 | +Write-Host " ========================================================" -ForegroundColor White |
| 34 | + |
| 35 | +# --- Paths --- |
| 36 | +$gpu = "$root\Drivers\GPU\u0410304.inf" |
| 37 | +$audioBus = "$root\Drivers\Audio\amdacpbus.inf" |
| 38 | +$audioAfd = "$root\Drivers\Audio\amdacpafd.inf" |
| 39 | +$npu = "$root\Drivers\NPU\kipudrv.inf" |
| 40 | +$pluton = "$root\Drivers\Pluton\plutonnull.inf" |
| 41 | + |
| 42 | +# --- Dosya kontrolu --- |
| 43 | +Step "Dosyalar kontrol ediliyor" |
| 44 | +$missing = @($gpu, $audioBus, $audioAfd, $npu) | Where-Object { -not (Test-Path $_) } |
| 45 | +if ($missing) { |
| 46 | + FAIL "Eksik dosyalar:" |
| 47 | + $missing | ForEach-Object { Write-Host " $_" -ForegroundColor Red } |
| 48 | + Read-Host "`nCikmak icin Enter" |
| 49 | + exit 1 |
| 50 | +} |
| 51 | +OK "Tum driver dosyalari mevcut" |
| 52 | + |
| 53 | +# ============================================================ |
| 54 | +# 1) TEST SIGNING |
| 55 | +# ============================================================ |
| 56 | +Step "Test signing kontrol ediliyor" |
| 57 | + |
| 58 | +$ts = bcdedit /enum | Select-String "testsigning\s+Yes" -Quiet |
| 59 | +$ni = bcdedit /enum | Select-String "nointegritychecks\s+Yes" -Quiet |
| 60 | +$rebootNeeded = $false |
| 61 | + |
| 62 | +if (-not $ts) { bcdedit /set testsigning on | Out-Null; OK "testsigning ON"; $rebootNeeded = $true } |
| 63 | +else { OK "testsigning zaten aktif" } |
| 64 | + |
| 65 | +if (-not $ni) { bcdedit /set nointegritychecks on | Out-Null; OK "nointegritychecks ON"; $rebootNeeded = $true } |
| 66 | +else { OK "nointegritychecks zaten aktif" } |
| 67 | + |
| 68 | +if ($rebootNeeded) { |
| 69 | + WARN "REBOOT GEREKLI - ayarlar reboot sonrasi aktif olacak" |
| 70 | + if (-not $NoReboot) { |
| 71 | + $a = Read-Host " Simdi reboot? (E/H)" |
| 72 | + if ($a -match '^[eEyY]') { |
| 73 | + shutdown /r /t 5 /c "AMD Driver Installer - reboot" |
| 74 | + exit 0 |
| 75 | + } |
| 76 | + } |
| 77 | + WARN "Reboot yapilmadan devam edilemez." |
| 78 | + Read-Host "Cikmak icin Enter" |
| 79 | + exit 2 |
| 80 | +} |
| 81 | + |
| 82 | +# ============================================================ |
| 83 | +# 2) SERTIFIKA |
| 84 | +# ============================================================ |
| 85 | +Step "Code-signing sertifikasi" |
| 86 | + |
| 87 | +$certName = "AMD Driver Test" |
| 88 | +$cert = Get-ChildItem Cert:\LocalMachine\My -CodeSigningCert -ErrorAction SilentlyContinue | |
| 89 | + Where-Object { $_.Subject -eq "CN=$certName" -and $_.NotAfter -gt (Get-Date) } | |
| 90 | + Select-Object -First 1 |
| 91 | + |
| 92 | +if (-not $cert) { |
| 93 | + $cert = New-SelfSignedCertificate -Type CodeSigningCert -Subject "CN=$certName" ` |
| 94 | + -CertStoreLocation Cert:\LocalMachine\My -NotAfter (Get-Date).AddYears(5) |
| 95 | + $tmp = "$env:TEMP\amd_cert.cer" |
| 96 | + Export-Certificate -Cert $cert -FilePath $tmp -Force | Out-Null |
| 97 | + Import-Certificate -FilePath $tmp -CertStoreLocation Cert:\LocalMachine\Root -Confirm:$false | Out-Null |
| 98 | + Import-Certificate -FilePath $tmp -CertStoreLocation Cert:\LocalMachine\TrustedPublisher -Confirm:$false | Out-Null |
| 99 | + Remove-Item $tmp -ErrorAction SilentlyContinue |
| 100 | + OK "Yeni sertifika: $($cert.Thumbprint)" |
| 101 | +} else { |
| 102 | + OK "Mevcut sertifika: $($cert.Thumbprint)" |
| 103 | +} |
| 104 | + |
| 105 | +# ============================================================ |
| 106 | +# 3) SDK + WDK (signtool & inf2cat) |
| 107 | +# ============================================================ |
| 108 | +Step "Imzalama araclari (SDK + WDK)" |
| 109 | + |
| 110 | +$kitsBase = "C:\Program Files (x86)\Windows Kits\10" |
| 111 | + |
| 112 | +$signtool = Get-ChildItem "$kitsBase\bin" -Recurse -Filter "signtool.exe" -ErrorAction SilentlyContinue | |
| 113 | + Where-Object { $_.FullName -match "x64" } | Select-Object -First 1 -ExpandProperty FullName |
| 114 | + |
| 115 | +$inf2cat = Get-ChildItem "$kitsBase\bin" -Recurse -Filter "Inf2Cat.exe" -ErrorAction SilentlyContinue | |
| 116 | + Select-Object -First 1 -ExpandProperty FullName |
| 117 | + |
| 118 | +if (-not $signtool) { |
| 119 | + Write-Host " Windows SDK kuruluyor..." -ForegroundColor Gray |
| 120 | + winget install Microsoft.WindowsSDK.10.0.26100 --accept-package-agreements --accept-source-agreements --silent 2>&1 | Out-Null |
| 121 | + $signtool = Get-ChildItem "$kitsBase\bin" -Recurse -Filter "signtool.exe" -ErrorAction SilentlyContinue | |
| 122 | + Where-Object { $_.FullName -match "x64" } | Select-Object -First 1 -ExpandProperty FullName |
| 123 | + if ($signtool) { OK "SDK kuruldu" } else { FAIL "SDK kurulamadi!"; exit 1 } |
| 124 | +} else { OK "signtool mevcut" } |
| 125 | + |
| 126 | +if (-not $inf2cat) { |
| 127 | + Write-Host " Windows WDK kuruluyor..." -ForegroundColor Gray |
| 128 | + winget install Microsoft.WindowsWDK.10.0.26100 --accept-package-agreements --accept-source-agreements --silent 2>&1 | Out-Null |
| 129 | + $inf2cat = Get-ChildItem "$kitsBase\bin" -Recurse -Filter "Inf2Cat.exe" -ErrorAction SilentlyContinue | |
| 130 | + Select-Object -First 1 -ExpandProperty FullName |
| 131 | + if ($inf2cat) { OK "WDK kuruldu" } else { FAIL "WDK kurulamadi!"; exit 1 } |
| 132 | +} else { OK "inf2cat mevcut" } |
| 133 | + |
| 134 | +# ============================================================ |
| 135 | +# 4) GPU CATALOG OLUSTUR + IMZALA |
| 136 | +# ============================================================ |
| 137 | +Step "GPU driver catalog olusturuluyor" |
| 138 | + |
| 139 | +$gpuDir = "$root\Drivers\GPU" |
| 140 | +$gpuCat = "$gpuDir\u0410304.cat" |
| 141 | + |
| 142 | +Remove-Item $gpuCat -ErrorAction SilentlyContinue |
| 143 | +& $inf2cat /driver:"$gpuDir" /os:10_X64,ServerRS5_X64,Server10_X64 2>&1 | Out-Null |
| 144 | + |
| 145 | +if (-not (Test-Path $gpuCat)) { |
| 146 | + FAIL "Catalog olusturulamadi!" |
| 147 | + & $inf2cat /driver:"$gpuDir" /os:10_X64,ServerRS5_X64,Server10_X64 2>&1 |
| 148 | + Read-Host "Cikmak icin Enter" |
| 149 | + exit 1 |
| 150 | +} |
| 151 | +OK "Catalog olusturuldu" |
| 152 | + |
| 153 | +Step "Catalog dosyalari imzalaniyor" |
| 154 | + |
| 155 | +Get-ChildItem $gpuDir -Filter "*.cat" -Recurse | |
| 156 | + Where-Object { $_.LastWriteTime -gt (Get-Date).AddMinutes(-10) } | |
| 157 | + ForEach-Object { |
| 158 | + & $signtool sign /sm /sha1 $cert.Thumbprint /fd SHA256 $_.FullName 2>&1 | Out-Null |
| 159 | + if ($LASTEXITCODE -eq 0) { OK $_.Name } else { WARN "Imzalanamadi: $($_.Name)" } |
| 160 | + } |
| 161 | + |
| 162 | +# ============================================================ |
| 163 | +# 5) GPU DRIVER KUR |
| 164 | +# ============================================================ |
| 165 | +Step "GPU driver kuruluyor (AMD Radeon 780M)" |
| 166 | + |
| 167 | +$r = pnputil /add-driver $gpu /install 2>&1 |
| 168 | +$ro = $r -join "`n" |
| 169 | +if ($ro -match "installed on device") { |
| 170 | + OK "GPU driver kuruldu ve cihaza atandi!" |
| 171 | +} elseif ($ro -match "Added driver packages:\s+1") { |
| 172 | + OK "GPU driver store'a eklendi" |
| 173 | + # devcon ile zorla ata |
| 174 | + $devcon = Get-ChildItem "$kitsBase\Tools" -Recurse -Filter "devcon.exe" -ErrorAction SilentlyContinue | |
| 175 | + Where-Object { $_.FullName -match "x64" } | Select-Object -First 1 -ExpandProperty FullName |
| 176 | + if ($devcon) { |
| 177 | + & $devcon remove '=Display' '@PCI\VEN_1002&DEV_15BF*' 2>&1 | Out-Null |
| 178 | + pnputil /scan-devices 2>&1 | Out-Null |
| 179 | + Start-Sleep 3 |
| 180 | + OK "Cihaz yeniden tarandi" |
| 181 | + } |
| 182 | +} else { |
| 183 | + WARN "GPU sonuc: $ro" |
| 184 | +} |
| 185 | + |
| 186 | +# ============================================================ |
| 187 | +# 6) AUDIO DRIVER KUR |
| 188 | +# ============================================================ |
| 189 | +Step "AMD Audio driver kuruluyor" |
| 190 | + |
| 191 | +pnputil /add-driver $audioBus /install 2>&1 | Out-Null |
| 192 | +OK "ACP Bus driver eklendi" |
| 193 | + |
| 194 | +pnputil /add-driver $audioAfd /install 2>&1 | Out-Null |
| 195 | +OK "ACP AFD driver eklendi" |
| 196 | + |
| 197 | +# ============================================================ |
| 198 | +# 7) NPU DRIVER KUR |
| 199 | +# ============================================================ |
| 200 | +Step "AMD NPU driver kuruluyor" |
| 201 | + |
| 202 | +pnputil /add-driver $npu /install 2>&1 | Out-Null |
| 203 | +OK "NPU driver eklendi" |
| 204 | + |
| 205 | +# ============================================================ |
| 206 | +# 8) PLUTON (opsiyonel) |
| 207 | +# ============================================================ |
| 208 | +if (Test-Path $pluton) { |
| 209 | + Step "Pluton null driver kuruluyor" |
| 210 | + pnputil /add-driver $pluton /install 2>&1 | Out-Null |
| 211 | + OK "Pluton eklendi (Server'da calismayabilir)" |
| 212 | +} |
| 213 | + |
| 214 | +# ============================================================ |
| 215 | +# SONUC |
| 216 | +# ============================================================ |
| 217 | +Write-Host "" |
| 218 | +Write-Host " ========================================================" -ForegroundColor Green |
| 219 | +Write-Host " KURULUM TAMAMLANDI!" -ForegroundColor Green |
| 220 | +Write-Host " ========================================================" -ForegroundColor Green |
| 221 | +Write-Host "" |
| 222 | + |
| 223 | +# GPU durumu |
| 224 | +$dev = pnputil /enum-devices /class Display /connected 2>&1 |
| 225 | +Write-Host " GPU Durumu:" -ForegroundColor Cyan |
| 226 | +$dev | Select-String "Device Description:|Status:" | ForEach-Object { |
| 227 | + Write-Host " $($_.Line.Trim())" |
| 228 | +} |
| 229 | + |
| 230 | +# Kalan sorunlar |
| 231 | +Write-Host "" |
| 232 | +$prob = pnputil /enum-devices /problem 2>&1 |
| 233 | +$pc = ($prob | Select-String "Instance ID:").Count |
| 234 | +if ($pc -eq 0) { |
| 235 | + Write-Host " Sorunlu cihaz yok - hersey calisiyor!" -ForegroundColor Green |
| 236 | +} else { |
| 237 | + WARN "$pc sorunlu cihaz kaldi:" |
| 238 | + $prob | Select-String "Instance ID:|Device Description:" | |
| 239 | + ForEach-Object { Write-Host " $($_.Line.Trim())" -ForegroundColor Yellow } |
| 240 | +} |
| 241 | + |
| 242 | +Write-Host "" |
| 243 | +Write-Host " Not: Test signing aktif, masaustunde watermark gorunebilir." -ForegroundColor Gray |
| 244 | +Write-Host "" |
| 245 | +Read-Host "Cikmak icin Enter'a basin" |
0 commit comments