|
| 1 | + |
| 2 | +$logPath = "$env:TEMP\SsdtisSetup" |
| 3 | +$logFile = Get-ChildItem -Path $logPath | Sort-Object Name -Descending | Select-Object -First 1 |
| 4 | + |
| 5 | +$content = Get-Content -Path $logFile.FullName |
| 6 | +$errorDetected = $false |
| 7 | + |
| 8 | + |
| 9 | +if ($logFile.Name.EndsWith("ISVsix.log")) { |
| 10 | + foreach ($line in $content) { |
| 11 | + if ($line -match "AnotherInstallationRunning") { |
| 12 | + Write-Warning $line |
| 13 | + Write-Host "Another installation is currently in progress. Please wait until it completes before attempting to retry." |
| 14 | + Write-Host "More details: Windows Installer is preventing your installation. Windows Installer is a service of Windows that manages the installation of packages like MSIs, Windows Updates or third-party programs, and it can only run one installation at a time." |
| 15 | + $errorDetected = $true |
| 16 | + break |
| 17 | + } |
| 18 | + |
| 19 | + if ($line -match "Object reference not set to an instance") { |
| 20 | + Write-Warning $line |
| 21 | + Write-Host "There may be leftover caches from a previous installation. Please delete the corrupted instance folder: C:\ProgramData\Microsoft\VisualStudio\Packages\Instances\<InstallationID>." |
| 22 | + $errorDetected = $true |
| 23 | + break |
| 24 | + } |
| 25 | + |
| 26 | + if ($line -match "SoftRebootStatusCheck") { |
| 27 | + Write-Warning $line |
| 28 | + Write-Host "The soft reboot message means that a reboot is required before you can update or modify Visual Studio; however, you may continue using Visual Studio in the meantime." |
| 29 | + $errorDetected = $true |
| 30 | + break |
| 31 | + } |
| 32 | + |
| 33 | + if ($line -match "VSProcessesRunning") { |
| 34 | + Write-Warning $line |
| 35 | + Write-Host "Ensure that all Visual Studio-related processes (e.g., devenv.exe) are completely closed before starting the installation. Use Task Manager to end any lingering processes." |
| 36 | + $errorDetected = $true |
| 37 | + break |
| 38 | + } |
| 39 | + |
| 40 | + if ($line -match "Failed to verify hash of payload") { |
| 41 | + Write-Warning $line |
| 42 | + Write-Host " Delete the installation cache folder C:\ProgramData\Package Cache\15160B731819F56D87A626F9A2777550340022D7 then reinstall." |
| 43 | + $errorDetected = $true |
| 44 | + break |
| 45 | + } |
| 46 | + |
| 47 | + |
| 48 | + if ($line -match "System\.IO\.IOException:.*already exists" -and $line -match "[A-Z]:\\.*?Microsoft Visual Studio.*?\\Common7\\IDE") { |
| 49 | + $vsPath = $matches[0] |
| 50 | + Write-Host "`nPlease execute the following commands in an elevated command prompt:" |
| 51 | + cd $vsPath |
| 52 | + Write-Host 'Remove-Item "CommonExtensions\Microsoft\SSIS\*" -Recurse -Force' |
| 53 | + Write-Host 'Remove-Item "PublicAssemblies\SSIS\*" -Recurse -Force' |
| 54 | + Write-Host 'Remove-Item "PublicAssemblies\Microsoft BI\Business Intelligence Projects\Integration Services\*" -Recurse -Force' |
| 55 | + Write-Host "Repair Visual Studio via VS Installer, then you can reinstall SSIS" |
| 56 | + $errorDetected = $true |
| 57 | + break |
| 58 | + } |
| 59 | + } |
| 60 | +} |
| 61 | + |
| 62 | +if ($logFile.Name.EndsWith("ISVsixPreInstall.log")) { |
| 63 | + foreach ($line in $content) { |
| 64 | + if ($line -match "UnauthorizedAccessException") { |
| 65 | + Write-Warning $line |
| 66 | + Write-Host "You might not have the necessary permissions to execute the installer. Please verify the folder permissions or consider running the installer as Administrator." |
| 67 | + $errorDetected = $true |
| 68 | + } |
| 69 | + } |
| 70 | +} |
| 71 | + |
| 72 | +if ($logFile.Name -match "VSTA2022.*\.log$") { |
| 73 | + Write-Host "Microsoft Visual Studio Tools for Applications 2022, required by SSIS, could not be installed due to errors." |
| 74 | + Write-Host "Install Microsoft Visual Studio Tools for Applications 2022 from https://www.microsoft.com/download/details.aspx?id=105123 then reinstall SSIS." |
| 75 | +} |
| 76 | + |
| 77 | +if (-not $errorDetected) { |
| 78 | + Write-Warning "Open $($logFile.Name) to see more detail first" |
| 79 | + Write-Host "If you can't resolve the errors, email $logFile to [email protected] for troubleshooting." |
| 80 | +} else { |
| 81 | + Write-Host "See more details in $($logFile.Name)." |
| 82 | +} |
| 83 | + |
| 84 | + |
| 85 | +Write-Host "`nPress any key to close this window..." -ForegroundColor Cyan |
| 86 | +[void][System.Console]::ReadKey($true) |
0 commit comments