Skip to content

Commit 28f8bdd

Browse files
authored
Skip uninstalling other MSVC versions if they are found (#1402)
1 parent e0399f0 commit 28f8bdd

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

windows/internal/vs2019_install.ps1

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,7 @@ if (Test-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswher
2727
echo "Found correctly versioned existing BuildTools installation in $existingPath"
2828
exit 0
2929
}
30-
echo "Found existing BuildTools installation in $existingPath"
31-
$VS_UNINSTALL_ARGS = @("uninstall", "--installPath", "`"$existingPath`"", "--quiet","--wait")
32-
$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_UNINSTALL_ARGS -NoNewWindow -Wait -PassThru
33-
$exitCode = $process.ExitCode
34-
if (($exitCode -ne 0) -and ($exitCode -ne 3010)) {
35-
echo "Original BuildTools uninstall failed with code $exitCode"
36-
exit 1
37-
}
38-
echo "Original BuildTools uninstalled"
30+
echo "Found existing BuildTools installation in $existingPath, keeping it"
3931
}
4032
}
4133

windows/internal/vs2022_install.ps1

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,7 @@ if (Test-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswher
2727
echo "Found correctly versioned existing BuildTools installation in $existingPath"
2828
exit 0
2929
}
30-
echo "Found existing BuildTools installation in $existingPath"
31-
$VS_UNINSTALL_ARGS = @("uninstall", "--installPath", "`"$existingPath`"", "--quiet","--wait")
32-
$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_UNINSTALL_ARGS -NoNewWindow -Wait -PassThru
33-
$exitCode = $process.ExitCode
34-
if (($exitCode -ne 0) -and ($exitCode -ne 3010)) {
35-
echo "Original BuildTools uninstall failed with code $exitCode"
36-
exit 1
37-
}
38-
echo "Original BuildTools uninstalled"
30+
echo "Found existing BuildTools installation in $existingPath, keeping it"
3931
}
4032
}
4133

0 commit comments

Comments
 (0)