Guest User

Fix.ps1 – Ableton Live / Windows 11 – MSVCR120.dll missing (Community Fix by Seb)

a guest
Oct 19th, 2025
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Fix.ps1
  2. # Ableton Live - MSVCR120.dll missing (VC++ 2013)
  3. # Flow: check -> winget install x64+x86 -> recheck -> open Microsoft pages -> optional DISM/SFC -> copy DLLs -> launch test
  4. # Launch : powershell -NoProfile -ExecutionPolicy Bypass -File "C:\Users\...\Fix.ps1"
  5.  
  6. $ErrorActionPreference = 'Stop'
  7.  
  8. # -------- Logging (ASCII only) --------
  9. function LogLine { Write-Host "------------------------------------------------------------------------" }
  10. function Stamp { (Get-Date).ToString('yyyy-MM-dd HH:mm:ss') }
  11. function LOG  ([string]$m) { Write-Host ("[{0}] [INFO] {1}" -f (Stamp), $m) }
  12. function OK   ([string]$m) { Write-Host ("[{0}] [ OK ] {1}" -f (Stamp), $m) -ForegroundColor Green }
  13. function WARN ([string]$m) { Write-Host ("[{0}] [WARN] {1}" -f (Stamp), $m) -ForegroundColor Yellow }
  14. function ERR  ([string]$m) { Write-Host ("[{0}] [ERR ] {1}" -f (Stamp), $m) -ForegroundColor Red }
  15.  
  16. # -------- Elevate if needed --------
  17. $me = [Security.Principal.WindowsIdentity]::GetCurrent()
  18. $pp = New-Object Security.Principal.WindowsPrincipal($me)
  19. if (-not $pp.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
  20.   Start-Process -Verb RunAs -FilePath "powershell.exe" -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`""
  21.   exit
  22. }
  23.  
  24. # TLS 1.2 just in case
  25. [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  26.  
  27. # -------- Locate Ableton --------
  28. function Get-AbletonPath {
  29.   $cands = @(
  30.     "C:\Program Files\Ableton\Live 11 Suite\Program",
  31.     "C:\Program Files\Ableton\Live 11 Standard\Program",
  32.     "C:\Program Files\Ableton\Live 11 Intro\Program",
  33.     "C:\Program Files\Ableton\Live 12 Suite\Program"
  34.   )
  35.   foreach ($p in $cands) {
  36.     if (Test-Path $p) { return $p }
  37.   }
  38.   return "C:\Program Files\Ableton\Live 11 Suite\Program"
  39. }
  40. $Ableton = Get-AbletonPath
  41. LOG ("Ableton folder: {0}" -f $Ableton)
  42.  
  43. # -------- DLL checks --------
  44. $sys64 = "$env:WINDIR\System32"
  45. $sys32 = "$env:WINDIR\SysWOW64"
  46.  
  47. function Has-VC2013 {
  48.   [PSCustomObject]@{
  49.     X64 = (Test-Path "$sys64\MSVCR120.dll") -and (Test-Path "$sys64\MSVCP120.dll")
  50.     X86 = (Test-Path "$sys32\MSVCR120.dll") -and (Test-Path "$sys32\MSVCP120.dll")
  51.   }
  52. }
  53.  
  54. function Print-State([object]$s) {
  55.   if ($s.X64) { OK "VC++ 2013 x64 present (System32)" } else { WARN "VC++ 2013 x64 missing" }
  56.   if ($s.X86) { OK "VC++ 2013 x86 present (SysWOW64)" } else { WARN "VC++ 2013 x86 missing" }
  57. }
  58.  
  59. LogLine
  60. LOG "Initial check for VC++ 2013 (MSVCR120/MSVCP120)"
  61. LogLine
  62. $state = Has-VC2013
  63. Print-State $state
  64. if ($state.X64 -and $state.X86) {
  65.   OK "All runtimes already present. You can try Ableton now."
  66.   exit 0
  67. }
  68.  
  69. # -------- Try winget install --------
  70. function Install-WithWinget {
  71.   if (Get-Command winget -ErrorAction SilentlyContinue) {
  72.     try {
  73.       LOG "winget install VC++ 2013 x64"
  74.       winget install --id "Microsoft.VC++2013Redist-x64" -e --silent --accept-package-agreements --accept-source-agreements | Out-Null
  75.     } catch {
  76.       WARN ("winget x64 failed: {0}" -f $_.Exception.Message)
  77.     }
  78.     try {
  79.       LOG "winget install VC++ 2013 x86"
  80.       winget install --id "Microsoft.VC++2013Redist-x86" -e --silent --accept-package-agreements --accept-source-agreements | Out-Null
  81.     } catch {
  82.       WARN ("winget x86 failed: {0}" -f $_.Exception.Message)
  83.     }
  84.   } else {
  85.     WARN "winget not available (App Installer missing)"
  86.   }
  87. }
  88.  
  89. LogLine
  90. LOG "Attempt install via winget"
  91. LogLine
  92. Install-WithWinget
  93.  
  94. LogLine
  95. LOG "Recheck after winget"
  96. LogLine
  97. $state = Has-VC2013
  98. Print-State $state
  99.  
  100. # -------- Manual Microsoft install if still missing --------
  101. if (-not ($state.X64 -and $state.X86)) {
  102.   LogLine
  103.   WARN "Automatic install did not complete. Opening Microsoft pages..."
  104.   LogLine
  105.   Start-Process "https://www.microsoft.com/download/details.aspx?id=40784"
  106.   Start-Process "https://learn.microsoft.com/visualstudio/releases/2013/redistribution"
  107.   Write-Host ""
  108.   Write-Host ">>> Download and install BOTH files: vcredist_x64.exe THEN vcredist_x86.exe." -ForegroundColor Yellow
  109.   Write-Host ">>> When done, press ENTER here to continue..." -ForegroundColor Yellow
  110.   [void][System.Console]::ReadLine()
  111.  
  112.   LogLine
  113.   LOG "Recheck after manual install"
  114.   LogLine
  115.   $state = Has-VC2013
  116.   Print-State $state
  117. }
  118.  
  119. # -------- Optional repair if still missing --------
  120. if (-not ($state.X64 -and $state.X86)) {
  121.   LogLine
  122.   WARN "Still missing. Running DISM and SFC repair (can take time)"
  123.   LogLine
  124.   Start-Process "cmd.exe" -ArgumentList "/c DISM /Online /Cleanup-Image /RestoreHealth" -Wait
  125.   Start-Process "cmd.exe" -ArgumentList "/c sfc /scannow" -Wait
  126.  
  127.   LogLine
  128.   LOG "Recheck after DISM/SFC"
  129.   LogLine
  130.   $state = Has-VC2013
  131.   Print-State $state
  132. }
  133.  
  134. # -------- Fallback: copy DLLs beside Ableton (if x64 available) --------
  135. if ($state.X64) {
  136.   try {
  137.     Copy-Item "$sys64\MSVCR120.dll" "$Ableton\MSVCR120.dll" -Force
  138.     Copy-Item "$sys64\MSVCP120.dll" "$Ableton\MSVCP120.dll" -Force
  139.     OK "Copied x64 DLLs into Ableton folder (fallback)"
  140.   } catch {
  141.     WARN ("Copy fallback failed: {0}" -f $_.Exception.Message)
  142.   }
  143. }
  144.  
  145. # -------- Launch Ableton test --------
  146. $exeCandidates = @(
  147.   "$Ableton\Ableton Live 11 Suite.exe",
  148.   "$Ableton\Ableton Live 12 Suite.exe"
  149. )
  150. $exe = $exeCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1
  151.  
  152. LogLine
  153. LOG "Summary"
  154. LogLine
  155. Print-State $state
  156.  
  157. if ($exe) {
  158.   LOG ("Launching Ableton: {0}" -f $exe)
  159.   Start-Process -FilePath $exe
  160.   OK "If the popup is gone, you are fixed"
  161. } else {
  162.   WARN ("Ableton executable not found in: {0}" -f $Ableton)
  163. }
  164.  
  165. if ($state.X64 -and $state.X86) { exit 0 } else { exit 2 }
  166.  
Advertisement
Add Comment
Please, Sign In to add comment