From feb30fa8e50a68ccedebf67b6d960c74c8089085 Mon Sep 17 00:00:00 2001 From: WanxuanYe <119466434+WanxuanYe@users.noreply.github.com> Date: Sat, 11 Oct 2025 08:55:33 +0800 Subject: [PATCH 1/3] Add troubleshooting script for Visual Studio installation --- .../VSInstallationTroubleShooting.ps1 | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 diff --git a/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 b/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 new file mode 100644 index 00000000..5a690c44 --- /dev/null +++ b/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 @@ -0,0 +1,83 @@ + +$logPath = "$env:TEMP\SsdtisSetup" +$logFile = Get-ChildItem -Path $logPath | Sort-Object Name -Descending | Select-Object -First 1 + +$content = Get-Content -Path $logFile.FullName +$errorDetected = $false + + +if ($logFile.Name.EndsWith("ISVsix.log")) { + foreach ($line in $content) { + if ($line -match "AnotherInstallationRunning") { + Write-Warning $line + Write-Host "Another installation is currently in progress. Please wait until it completes before attempting to retry." + 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." + $errorDetected = $true + break + } + + if ($line -match "Object reference not set to an instance") { + Write-Warning $line + Write-Host "There may be leftover caches from a previous installation. Please delete the corrupted instance folder: C:\ProgramData\Microsoft\VisualStudio\Packages\Instances\." + $errorDetected = $true + break + } + + if ($line -match "SoftRebootStatusCheck") { + Write-Warning $line + 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." + $errorDetected = $true + break + } + + if ($line -match "VSProcessesRunning") { + Write-Warning $line + 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." + $errorDetected = $true + break + } + + if ($line -match "Failed to verify hash of payload") { + Write-Warning $line + Write-Host " Delete the installation cache folder C:\ProgramData\Package Cache\15160B731819F56D87A626F9A2777550340022D7 then reinstall." + $errorDetected = $true + break + } + + + if ($line -match "System\.IO\.IOException:.*already exists" -and $line -match "[A-Z]:\\.*?Microsoft Visual Studio.*?\\Common7\\IDE") { + $vsPath = $matches[0] + Write-Host "`nPlease execute the following commands in an elevated command prompt:" + cd $vsPath + Write-Host 'Remove-Item "CommonExtensions\Microsoft\SSIS\*" -Recurse -Force' + Write-Host 'Remove-Item "PublicAssemblies\SSIS\*" -Recurse -Force' + Write-Host 'Remove-Item "PublicAssemblies\Microsoft BI\Business Intelligence Projects\Integration Services\*" -Recurse -Force' + Write-Host "Repair Visual Studio via VS Installer, then you can reinstall SSIS" + $errorDetected = $true + break + } + } +} + +if ($logFile.Name.EndsWith("ISVsixPreInstall.log")) { + foreach ($line in $content) { + if ($line -match "UnauthorizedAccessException") { + Write-Warning $line + 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." + $errorDetected = $true + } + } +} + +if ($logFile.Name -match "VSTA2022.*\.log$") { + Write-Host "Microsoft Visual Studio Tools for Applications 2022, required by SSIS, could not be installed due to errors." + Write-Host "Install Microsoft Visual Studio Tools for Applications 2022 from https://www.microsoft.com/download/details.aspx?id=105123 then reinstall SSIS." +} + +if (-not $errorDetected) { + Write-Warning "Open $($logFile.Name) to see more detail first" + Write-Host "If you can't resolve the errors, email $logFile to ssistoolsfeedbacks@microsoft.com for troubleshooting." +} else { + Write-Host "See more details in $($logFile.Name)." +} + From 0117178c625a0237ed18009339cd55d5f25c8c15 Mon Sep 17 00:00:00 2001 From: WanxuanYe <119466434+WanxuanYe@users.noreply.github.com> Date: Sat, 11 Oct 2025 11:55:10 +0800 Subject: [PATCH 2/3] Add prompt to close window in troubleshooting script --- .../VSInstallationTroubleShooting.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 b/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 index 5a690c44..d703d87d 100644 --- a/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 +++ b/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 @@ -80,4 +80,4 @@ if (-not $errorDetected) { } else { Write-Host "See more details in $($logFile.Name)." } - +Write-Host "`nPress any key to close this window..." -ForegroundColor Cyan From 2a6b97e467e5896a9a07e1bc515d55e26fd27888 Mon Sep 17 00:00:00 2001 From: WanxuanYe <119466434+WanxuanYe@users.noreply.github.com> Date: Sat, 11 Oct 2025 11:58:04 +0800 Subject: [PATCH 3/3] Update VSInstallationTroubleShooting.ps1 --- .../VSInstallationTroubleShooting.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 b/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 index d703d87d..63a4a37c 100644 --- a/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 +++ b/SamplesV2/SQLServerIntegrationServices/VSInstallationTroubleShooting.ps1 @@ -80,4 +80,7 @@ if (-not $errorDetected) { } else { Write-Host "See more details in $($logFile.Name)." } + + Write-Host "`nPress any key to close this window..." -ForegroundColor Cyan +[void][System.Console]::ReadKey($true)