From a03f6b9a87c02d29f03115f07ef8bd69d7a16f76 Mon Sep 17 00:00:00 2001 From: micheus Date: Fri, 10 Jul 2026 13:34:32 -0300 Subject: [PATCH] Improved the SetupWSLcross.bat for Visual Studio partially installed The added parameter fixes an issue with SetupWSLcross.bat that was not intializing VCVARSALL when Visual Studio Integrated Development Environment was not installed. In my case I use only the Visual Studio Build Tools 2022. In accordance with the documentation of vswhere.exe, the -products * parameter returns all products, including the Build Tools, and allows SetupWSLcross.bat to find the installation path of Visual Studio Build Tools 2022 and initialize VCVARSALL. NOTE: Improved the SetupWSLcross.bat --- win32/SetupWSLcross.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/SetupWSLcross.bat b/win32/SetupWSLcross.bat index 4959b83c..aac2723a 100644 --- a/win32/SetupWSLcross.bat +++ b/win32/SetupWSLcross.bat @@ -10,7 +10,7 @@ GOTO badarg :search SET VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -FOR /F "delims=" %%P IN ('%VSWHERE% -latest -property installationPath') DO ( +FOR /F "delims=" %%P IN ('%VSWHERE% -latest -products * -property installationPath') DO ( SET "VCVARSALL=%%P\VC\Auxiliary\Build\vcvarsall.bat" )