From 87a04aba03e72144d7256ede7cd3d53467ddae31 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 31 May 2023 18:45:30 +0300 Subject: [PATCH] win: Update msvs_env.bat to prefer VS2022 (fixes #3509) --- tools/msvs_env.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/msvs_env.bat b/tools/msvs_env.bat index 52a0c1d8f..8329b7274 100644 --- a/tools/msvs_env.bat +++ b/tools/msvs_env.bat @@ -30,10 +30,10 @@ if %vcvars% == "none" goto found_vcvars if exist %vcvars% goto found_vcvars :: Search for the default VS installation path. -for %%x in ("%PROGRAMFILES(X86)%" "%PROGRAMFILES%") do ( - for %%y in (2022 2019 2017) do ( +for %%x in (2022) do ( + for %%y in ("%PROGRAMFILES%" "%PROGRAMFILES(X86)%") do ( for %%z in (Professional Enterprise Community BuildTools) do ( - set vcvars="%%~x\Microsoft Visual Studio\%%y\%%z\VC\Auxiliary\Build\%vcvarsbat%" + set vcvars="%%~y\Microsoft Visual Studio\%%x\%%z\VC\Auxiliary\Build\%vcvarsbat%" if exist !vcvars! goto found_vcvars ) )