From: K.Takata Date: Mon, 11 May 2026 16:56:33 +0000 (+0000) Subject: patch 9.2.0474: MS-Windows: hard to tell which Visual Studio version was selected... X-Git-Tag: v9.2.0474^0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7784fac15f7ae729b4422c5efc2db48bd15a8548;p=thirdparty%2Fvim.git patch 9.2.0474: MS-Windows: hard to tell which Visual Studio version was selected with MSVC Problem: When running msvc*.bat there is no indication of which Visual Studio version and target architecture got selected. Solution: After vcvarsall.bat returns, echo the VS version, VC tools version and target architecture, and set the Command Prompt title accordingly (Ken Takata). closes: #20193 Signed-off-by: K.Takata Signed-off-by: Christian Brabandt --- diff --git a/src/msvc-latest.bat b/src/msvc-latest.bat index 4529fa02eb..93ac705702 100644 --- a/src/msvc-latest.bat +++ b/src/msvc-latest.bat @@ -39,18 +39,16 @@ if "%VSVEROPT%"=="" ( ) rem Search Visual Studio Community, Professional or above. +set InstallDir= for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" %VSVEROPT% -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( set InstallDir=%%i ) -if exist "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" ( - call "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" %* - goto done -) - -rem Search Visual Studio 2017 Express. -rem (Visual Studio 2017 Express uses different component IDs.) -for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" %VSVEROPT% -products Microsoft.VisualStudio.Product.WDExpress -property installationPath`) do ( - set InstallDir=%%i +if not defined InstallDir ( + rem Search Visual Studio 2017 Express. + rem (Visual Studio 2017 Express uses different component IDs.) + for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" %VSVEROPT% -products Microsoft.VisualStudio.Product.WDExpress -property installationPath`) do ( + set InstallDir=%%i + ) ) if exist "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" ( call "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" %* @@ -60,7 +58,14 @@ if exist "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" ( call ) -:done +if defined VCToolsVersion ( + if "%VSVEROPT%"=="-latest" ( + echo VCTools %VCToolsVersion% %VSCMD_ARG_TGT_ARCH% + for /f "tokens=1,2 delims=." %%I in ("%VCToolsVersion%") do ( + title VCTools %%I.%%J %VSCMD_ARG_TGT_ARCH% + ) + ) +) if "%VSWHERE_SET%"=="yes" ( set VSWHERE= set VSWHERE_SET= diff --git a/src/msvc2015.bat b/src/msvc2015.bat index b541719ac2..2ee864ca6a 100644 --- a/src/msvc2015.bat +++ b/src/msvc2015.bat @@ -12,4 +12,18 @@ rem If you use Community (or Professional) edition, you can also use "x64" rem option: rem msvc2015 x64 +set Platform= +if not exist "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" ( + echo Error: vcvarsall.bat not found. + exit /b 1 +) call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %* +if defined VisualStudioVersion ( + if defined Platform ( + echo VS 2015 ^(%VisualStudioVersion%^) %Platform% + title VS 2015 %Platform% + ) else ( + echo VS 2015 ^(%VisualStudioVersion%^) x86 + title VS 2015 x86 + ) +) diff --git a/src/msvc2017.bat b/src/msvc2017.bat index c7731c92c9..569eddd153 100644 --- a/src/msvc2017.bat +++ b/src/msvc2017.bat @@ -11,3 +11,7 @@ rem msvc2017 x86_amd64 set "VSVEROPT=-version [15.0^,16.0^)" call "%~dp0msvc-latest.bat" %* set VSVEROPT= +if defined VCToolsVersion ( + echo VS 2017 ^(%VCToolsVersion%^) %VSCMD_ARG_TGT_ARCH% + title VS 2017 %VSCMD_ARG_TGT_ARCH% +) diff --git a/src/msvc2019.bat b/src/msvc2019.bat index a45ef2c564..16a893f1dc 100644 --- a/src/msvc2019.bat +++ b/src/msvc2019.bat @@ -11,3 +11,7 @@ rem msvc2019 x64 set "VSVEROPT=-version [16.0^,17.0^)" call "%~dp0msvc-latest.bat" %* set VSVEROPT= +if defined VCToolsVersion ( + echo VS 2019 ^(%VCToolsVersion%^) %VSCMD_ARG_TGT_ARCH% + title VS 2019 %VSCMD_ARG_TGT_ARCH% +) diff --git a/src/msvc2022.bat b/src/msvc2022.bat index b707410070..67a9491b67 100644 --- a/src/msvc2022.bat +++ b/src/msvc2022.bat @@ -11,3 +11,7 @@ rem msvc2022 x64 set "VSVEROPT=-version [17.0^,18.0^)" call "%~dp0msvc-latest.bat" %* set VSVEROPT= +if defined VCToolsVersion ( + echo VS 2022 ^(%VCToolsVersion%^) %VSCMD_ARG_TGT_ARCH% + title VS 2022 %VSCMD_ARG_TGT_ARCH% +) diff --git a/src/version.c b/src/version.c index f96e170e4e..9240b09958 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 474, /**/ 473, /**/