Created
May 14, 2024 18:55
-
-
Save v0lt/41ca869684b8c155fa5b9397a297efa4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SET VSWHERE_PATH="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" | |
IF NOT EXIST %VSWHERE_PATH% ( | |
ECHO ERROR: vswhere.exe not found! | |
GOTO End | |
) | |
SET PARAMS_BASE=-property displayName -latest | |
SET VSWHERE_CMD=%VSWHERE_PATH% %PARAMS_BASE% | |
FOR /f "delims=" %%A IN ('%VSWHERE_CMD%') DO SET VS_NAME=%%A | |
IF "%VS_NAME%"=="" ( | |
ECHO ERROR: Visual Studio not found! | |
GOTO End | |
) | |
ECHO Found %VS_NAME% | |
SET VSWHERE_CMD=%VSWHERE_PATH% %PARAMS_BASE% -requires Microsoft.Component.MSBuild | |
FOR /f "delims=" %%A IN ('%VSWHERE_CMD%') DO SET CHECK1=%%A | |
IF "%CHECK1%"=="" ( | |
ECHO ERROR: MSBuild not found! | |
) ELSE ( | |
ECHO MSBuild ... OK! | |
) | |
SET VSWHERE_CMD=%VSWHERE_PATH% %PARAMS_BASE% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 | |
FOR /f "delims=" %%A IN ('%VSWHERE_CMD%') DO SET CHECK2=%%A | |
IF "%CHECK2%"=="" ( | |
ECHO ERROR: MSVC not found! | |
) ELSE ( | |
ECHO MSVC ...... OK! | |
) | |
SET VSWHERE_CMD=%VSWHERE_PATH% %PARAMS_BASE% -requires Microsoft.VisualStudio.Component.VC.ATLMFC | |
FOR /f "delims=" %%A IN ('%VSWHERE_CMD%') DO SET CHECK3=%%A | |
IF "%CHECK3%"=="" ( | |
ECHO ERROR: MFC not found! | |
) ELSE ( | |
ECHO MFC ....... OK! | |
) | |
:End | |
ECHO. | |
PAUSE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment