Tom_Neverwinter

vlc acss easy installer.

Apr 18th, 2026
5,556
0
Never
102
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # === CONFIG ===
  2. $vlcPath64 = "C:\Program Files\VideoLAN\VLC"
  3. $vlcPath32 = "C:\Program Files (x86)\VideoLAN\VLC"
  4. $aacsDir1  = "C:\ProgramData\aacs"
  5. $aacsDir2  = Join-Path $env:APPDATA "aacs"
  6. $tempDir   = Join-Path $env:TEMP "vlc_bluray_setup"
  7.  
  8. # --- Auto-elevate ---
  9. if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
  10.     Write-Host "Not running as Administrator. Relaunching with elevation..." -ForegroundColor Yellow
  11.     Start-Process powershell.exe -ArgumentList "-ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
  12.     exit
  13. }
  14.  
  15. Write-Host "=== VLC Blu-ray AACS Auto-Setup ===" -ForegroundColor Cyan
  16. Write-Host "Running as Administrator." -ForegroundColor Green
  17. Write-Host "Press Enter to continue at each step, or Ctrl+C to abort.`n"
  18. pause
  19.  
  20. # --- Step 1: Check VLC installs ---
  21. Write-Host "`n[Step 1] Checking VLC installation(s)..." -ForegroundColor Yellow
  22. $vlc64found = Test-Path $vlcPath64
  23. $vlc32found = Test-Path $vlcPath32
  24. if ($vlc64found) { Write-Host "Found 64-bit VLC: $vlcPath64" -ForegroundColor Green }
  25. else             { Write-Host "64-bit VLC not found at: $vlcPath64" -ForegroundColor DarkGray }
  26. if ($vlc32found) { Write-Host "Found 32-bit VLC: $vlcPath32" -ForegroundColor Green }
  27. else             { Write-Host "32-bit VLC not found at: $vlcPath32" -ForegroundColor DarkGray }
  28. if (-not $vlc64found -and -not $vlc32found) {
  29.     Write-Host "No VLC installation found. Exiting." -ForegroundColor Red
  30.     pause; exit
  31. }
  32. pause
  33.  
  34. # --- Step 2: Temp directory ---
  35. Write-Host "`n[Step 2] Creating temp working directory..." -ForegroundColor Yellow
  36. if (!(Test-Path $tempDir)) { New-Item -ItemType Directory -Path $tempDir | Out-Null }
  37. Write-Host "Temp dir ready: $tempDir" -ForegroundColor Green
  38. pause
  39.  
  40. # --- Step 3: AACS directories ---
  41. Write-Host "`n[Step 3] Creating AACS config directories..." -ForegroundColor Yellow
  42. foreach ($dir in @($aacsDir1, $aacsDir2)) {
  43.     if (!(Test-Path $dir)) {
  44.         New-Item -ItemType Directory -Path $dir | Out-Null
  45.         Write-Host "Created: $dir" -ForegroundColor Green
  46.     } else {
  47.         Write-Host "Already exists: $dir" -ForegroundColor Green
  48.     }
  49. }
  50. pause
  51.  
  52. # --- Step 4: Download libaacs.dll 64-bit ---
  53. Write-Host "`n[Step 4] Downloading libaacs.dll (64-bit)..." -ForegroundColor Yellow
  54. $dll64Dest = Join-Path $tempDir "libaacs64.dll"
  55. $dll64Url  = "https://vlc-bluray.whoknowsmy.name/files/win64/libaacs.dll"
  56. Write-Host "URL: $dll64Url"
  57. try {
  58.     Invoke-WebRequest -Uri $dll64Url -OutFile $dll64Dest -UseBasicParsing
  59.     Write-Host "Downloaded ($((Get-Item $dll64Dest).Length) bytes)" -ForegroundColor Green
  60. } catch {
  61.     Write-Host "Failed: $_" -ForegroundColor Red
  62.     pause; exit
  63. }
  64. pause
  65.  
  66. # --- Step 5: Download libaacs.dll 32-bit ---
  67. Write-Host "`n[Step 5] Downloading libaacs.dll (32-bit)..." -ForegroundColor Yellow
  68. $dll32Dest = Join-Path $tempDir "libaacs32.dll"
  69. $dll32Url  = "https://vlc-bluray.whoknowsmy.name/files/win32/libaacs.dll"
  70. Write-Host "URL: $dll32Url"
  71. try {
  72.     Invoke-WebRequest -Uri $dll32Url -OutFile $dll32Dest -UseBasicParsing
  73.     Write-Host "Downloaded ($((Get-Item $dll32Dest).Length) bytes)" -ForegroundColor Green
  74. } catch {
  75.     Write-Host "Failed: $_" -ForegroundColor Red
  76.     pause; exit
  77. }
  78. pause
  79.  
  80. # --- Step 6: Download KEYDB zip ---
  81. Write-Host "`n[Step 6] Downloading KEYDB zip..." -ForegroundColor Yellow
  82.  
  83. # All sources below deliver a ZIP file containing keydb.cfg inside.
  84. # Uncomment ONE source at a time. Source 1 is the most up to date.
  85. #
  86. # Source 1: fvonline-db (most actively updated)
  87. $keydbUrl = "http://fvonline-db.bplaced.net/fv_download.php?lang=eng"
  88. #
  89. # Source 2: vlc-bluray mirror of fvonline-db (same database, alternate host)
  90. # $keydbUrl = "https://vlc-aacs.whoknowsmy.name/files/KEYDB.cfg"
  91.  
  92. $keydbZip  = Join-Path $tempDir "KEYDB.zip"
  93. $keydbDest = Join-Path $tempDir "KEYDB.cfg"
  94. Write-Host "URL: $keydbUrl"
  95.  
  96. try {
  97.     Invoke-WebRequest -Uri $keydbUrl -OutFile $keydbZip -UseBasicParsing
  98.     Write-Host "Downloaded zip ($((Get-Item $keydbZip).Length) bytes)" -ForegroundColor Green
  99. } catch {
  100.     Write-Host "Failed to download: $_" -ForegroundColor Red
  101.     pause; exit
  102. }
  103. pause
  104.  
  105. # --- Step 6b: Extract KEYDB.cfg from zip ---
  106. Write-Host "`n[Step 6b] Extracting KEYDB.cfg from zip..." -ForegroundColor Yellow
  107. try {
  108.     Add-Type -AssemblyName System.IO.Compression.FileSystem
  109.     $zip = [System.IO.Compression.ZipFile]::OpenRead($keydbZip)
  110.     $entry = $zip.Entries | Where-Object { $_.Name -ilike "keydb.cfg" }
  111.     if ($null -eq $entry) {
  112.         Write-Host "keydb.cfg not found inside zip. Contents of zip:" -ForegroundColor Red
  113.         $zip.Entries | ForEach-Object { Write-Host "  - $($_.FullName)" }
  114.         $zip.Dispose()
  115.         pause; exit
  116.     }
  117.     [System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $keydbDest, $true)
  118.     $zip.Dispose()
  119.     Write-Host "Extracted KEYDB.cfg ($((Get-Item $keydbDest).Length) bytes)" -ForegroundColor Green
  120. } catch {
  121.     Write-Host "Failed to extract: $_" -ForegroundColor Red
  122.     pause; exit
  123. }
  124. pause
  125.  
  126. # --- Step 7: Install libaacs.dll ---
  127. Write-Host "`n[Step 7] Installing libaacs.dll to VLC folder(s)..." -ForegroundColor Yellow
  128. if ($vlc64found) {
  129.     try {
  130.         Copy-Item $dll64Dest -Destination "$vlcPath64\libaacs.dll" -Force
  131.         Write-Host "Confirmed 64-bit: $vlcPath64\libaacs.dll" -ForegroundColor Green
  132.     } catch { Write-Host "Failed to copy 64-bit dll: $_" -ForegroundColor Red }
  133. }
  134. if ($vlc32found) {
  135.     try {
  136.         Copy-Item $dll32Dest -Destination "$vlcPath32\libaacs.dll" -Force
  137.         Write-Host "Confirmed 32-bit: $vlcPath32\libaacs.dll" -ForegroundColor Green
  138.     } catch { Write-Host "Failed to copy 32-bit dll: $_" -ForegroundColor Red }
  139. }
  140. pause
  141.  
  142. # --- Step 8: Install KEYDB.cfg to both locations ---
  143. Write-Host "`n[Step 8] Installing KEYDB.cfg to both AACS locations..." -ForegroundColor Yellow
  144. foreach ($dir in @($aacsDir1, $aacsDir2)) {
  145.     try {
  146.         Copy-Item $keydbDest -Destination "$dir\KEYDB.cfg" -Force
  147.         Write-Host "Confirmed: $dir\KEYDB.cfg ($((Get-Item "$dir\KEYDB.cfg").Length) bytes)" -ForegroundColor Green
  148.     } catch { Write-Host "Failed to copy to ${dir}: $_" -ForegroundColor Red }
  149. }
  150. pause
  151.  
  152. # --- Step 9: Cleanup ---
  153. Write-Host "`n[Step 9] Cleaning up temp files..." -ForegroundColor Yellow
  154. Remove-Item $tempDir -Recurse -Force
  155. Write-Host "Temp folder removed." -ForegroundColor Green
  156. pause
  157.  
  158. Write-Host "`n=== All Done ===" -ForegroundColor Cyan
  159. Write-Host "libaacs.dll (64-bit) -> $vlcPath64"
  160. Write-Host "libaacs.dll (32-bit) -> $vlcPath32"
  161. Write-Host "KEYDB.cfg            -> $aacsDir1"
  162. Write-Host "KEYDB.cfg            -> $aacsDir2"
  163. Write-Host "`nRestart VLC and try your Blu-ray again."
  164. pause
Advertisement