microsoft / microsoft/vscode-cpptools

Support for Enterprise WDK

Open
#9,315 2 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Configuration Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Feature Request

Enterprise WDK is a fully portable distribution of MSVC. It comes with

  1. LaunchBuildEnv.cmd, which provides the environment for MSBuild based projects.
  2. Program Files\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat, which is not usable by default, but can be made usable by patching Program Files/Microsoft Visual Studio/2019/BuildTools/Common7/Tools/vsdevcmd/core/winsdk.bat:
--- a/winsdk.bat
+++ b/winsdk.bat
@@ -79,11 +79,9 @@
 :GetWin10SdkDirHelper
 
 @REM Get Windows 10 SDK installed folder
-for /F "tokens=1,2*" %%i in ('reg query "%1\Microsoft\Microsoft SDKs\Windows\v10.0" /v "InstallationFolder"') DO (
-    if "%%i"=="InstallationFolder" (
-        SET WindowsSdkDir=%%~k
-    )
-)
+pushd "%~dp0..\..\..\..\..\..\..\Windows Kits\10\"
+set WindowsSdkDir=%CD%\
+popd
 
 @REM get windows 10 sdk version number
 setlocal enableDelayedExpansion
@@ -243,14 +241,9 @@
 exit /B 0
 
 :GetUniversalCRTSdkDirHelper
-for /F "tokens=1,2*" %%i in ('reg query "%1\Microsoft\Windows Kits\Installed Roots" /v "KitsRoot10"') DO (
-    if "%%i"=="KitsRoot10" (
-        SET UniversalCRTSdkDir=%%k
-    )
-)
-if "%UniversalCRTSdkDir%"=="" (
-  exit /B 1
-)
+pushd "%~dp0..\..\..\..\..\..\..\Windows Kits\10\"
+set UniversalCRTSdkDir=%CD%\
+popd
 
 setlocal enableDelayedExpansion
 for /f %%i IN ('dir "%UniversalCRTSdkDir%include\" /b /ad-h /on') DO (

VS Code, however, does not detect the compiler and include paths in any of these environments.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the C/C++ extension's compiler and include-path detection for MSBuild environments. Compare how LaunchBuildEnv.cmd and the patched VsDevCmd.bat expose their environment, then verify that Enterprise WDK installations are detected and their compiler and include paths are reported correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.