diff --git a/coin/provisioning/common/windows/install-ffmpeg-common.ps1 b/coin/provisioning/common/windows/install-ffmpeg-common.ps1 index 4069c2af..7d2d44f4 100644 --- a/coin/provisioning/common/windows/install-ffmpeg-common.ps1 +++ b/coin/provisioning/common/windows/install-ffmpeg-common.ps1 @@ -123,7 +123,12 @@ function InstallFfmpeg { Write-Host "MSYS cmd:" Write-Host $cmd - $buildResult = Start-Process -NoNewWindow -Wait -PassThru -ErrorAction Stop -FilePath "$bash" -ArgumentList ("-lc", "`"$cmd`"") + # Don't use Start-Process -Wait. It waits for the whole process tree, which hangs when + # MSVC leaves detached helpers behind (e.g. vctip.exe). Wait for bash itself instead. + $buildResult = Start-Process -NoNewWindow -PassThru -ErrorAction Stop -FilePath "$bash" -ArgumentList ("-lc", "`"$cmd`"") + # Cache the process handle so ExitCode stays available after the process exits + $null = $buildResult.Handle + $buildResult.WaitForExit() $env:PATH = $oldPath