4 ms·
The Build Tools installer first installs the Visual Studio tool to select the workloads you want as well.
by debugnik 7mo ago
The Build Tools installer first installs the Visual Studio tool to select the workloads you want as well.
- josephernest 7mo agoLet's say I want to compile a helloworld.cpp with no build tools installed yet. What is the minimal winget command to get everything installed, ready for : cl main.cpp ? Ps: I mean a winget command which does not ask anything, neither in command line, nor GUI ? Totally unattenfed.
- debugnik 7mo agoThe winget installer just downloads vs_buildtools.exe and runs it, which first installs vs_setup.exe and then that one prompts you for the workloads you want. I believe passing --silent to the winget installer will install vs_setup unattended but not any workloads from the Build Tools. To install it all in a single step, and beware I haven't tested this, you're better off downloading and running yourself vs_buildtools.exe --quiet --add Microsoft.VisualStudio.Workload.VCTools adding whatever workloads you need. Then you'll need to locate and run vcvarsall.bat to setup the environment, which will require some clever code if you're doing it from PowerShell instead of a .bat, and then you can finally call the compiler.