]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0474: MS-Windows: hard to tell which Visual Studio version was selected... v9.2.0474
authorK.Takata <kentkt@csc.jp>
Mon, 11 May 2026 16:56:33 +0000 (16:56 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 11 May 2026 16:58:24 +0000 (16:58 +0000)
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 <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/msvc-latest.bat
src/msvc2015.bat
src/msvc2017.bat
src/msvc2019.bat
src/msvc2022.bat
src/version.c

index 4529fa02eb2bb6ec9003119287760f91b4bbd45e..93ac7057025956df28b6474c8d8ecd3139ba4f44 100644 (file)
@@ -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=
index b541719ac2236c8cea525d9d30ef1db384678002..2ee864ca6aad413f7d4f72a8b0f1cb29b5dbbccb 100644 (file)
@@ -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
+       )
+)
index c7731c92c95bd154dfed5af08d328bcf36175933..569eddd15324bd01a1648dfd50c31059389727ab 100644 (file)
@@ -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%
+)
index a45ef2c564bcd0cb636a684a6da53e0f57384028..16a893f1dcf65d304fa460f786bd75c64326562c 100644 (file)
@@ -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%
+)
index b707410070a207a21932245c4ce434771d2ce2d4..67a9491b67551ba8c29ed26114e7e80f2f700e2b 100644 (file)
@@ -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%
+)
index f96e170e4eeca0b4075bdd46ae692a846cc820d1..9240b09958bfd58d4c95046a2d30e4b30d9a9cfa 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    474,
 /**/
     473,
 /**/