Skip to content

Commit

Permalink
Skip uninstalling other MSVC versions if they are found (#1402)
Browse files Browse the repository at this point in the history
  • Loading branch information
huydhn committed May 11, 2023
1 parent e0399f0 commit 28f8bdd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
10 changes: 1 addition & 9 deletions windows/internal/vs2019_install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,7 @@ if (Test-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswher
echo "Found correctly versioned existing BuildTools installation in $existingPath"
exit 0
}
echo "Found existing BuildTools installation in $existingPath"
$VS_UNINSTALL_ARGS = @("uninstall", "--installPath", "`"$existingPath`"", "--quiet","--wait")
$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_UNINSTALL_ARGS -NoNewWindow -Wait -PassThru
$exitCode = $process.ExitCode
if (($exitCode -ne 0) -and ($exitCode -ne 3010)) {
echo "Original BuildTools uninstall failed with code $exitCode"
exit 1
}
echo "Original BuildTools uninstalled"
echo "Found existing BuildTools installation in $existingPath, keeping it"
}
}

Expand Down
10 changes: 1 addition & 9 deletions windows/internal/vs2022_install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,7 @@ if (Test-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswher
echo "Found correctly versioned existing BuildTools installation in $existingPath"
exit 0
}
echo "Found existing BuildTools installation in $existingPath"
$VS_UNINSTALL_ARGS = @("uninstall", "--installPath", "`"$existingPath`"", "--quiet","--wait")
$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_UNINSTALL_ARGS -NoNewWindow -Wait -PassThru
$exitCode = $process.ExitCode
if (($exitCode -ne 0) -and ($exitCode -ne 3010)) {
echo "Original BuildTools uninstall failed with code $exitCode"
exit 1
}
echo "Original BuildTools uninstalled"
echo "Found existing BuildTools installation in $existingPath, keeping it"
}
}

Expand Down

0 comments on commit 28f8bdd

Please sign in to comment.