Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
542 views
in Technique[技术] by (71.8m points)

winapi - Can I download the Visual C++ Command Line Compiler without Visual Studio?

As per the title. I don't want to download the entire Visual C++ installer, only "cl.exe" and the other programs required for compiling and linking C++ programs on Windows.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As said, there is no way to do that. You need to download the entire 4-6GB+ bundle. MS deployment is a botch.

There is no need, however, to actually install everything. If you're up to some manual installation, you can extract individual components from the bundle and put them all in a more organized directory tree.

For example, I've found the following set to be the bare minimum needed for using the current MSVC2013 compilers in a x86 environment:

  • vc_compilerCore86.msi: MSVC toolchain;
  • vc_compilerCore86res.msi: MSVC toolchain MUI resources;
  • vc_librarycore86.msi: MSVC library stuff;
  • vc_LibraryDesktopX86.msi: More MSVC library stuff;
  • Windows Software Development Kit for Windows Store Apps-x86_en-us.msi: Windows SDK files and related tools (rc.exe, mt.exe, etc.);
  • Windows Software Development Kit-x86_en-us.msi: More Windows SDK files (specifically, WinSock2.h, WS2_32.lib, maybe others).

Remember that you can extract the contents of a MSI file by running msiexec /a <msifile> TARGETDIR="<path>" (jot a /quiet parameter if you're batching). Of course, you can also put more into your package by investigating the MSI files inside the bundle. In particular, the above set is missing the latest MSBuild tools, since I don't care for them. Stuff is often scattered around between multiple MSIs cluelessly, so good luck.

I've got a 50MB (!!!) 7z-file containing this set for local deployment, though I cannot share this publicly due to Microsoft licensing restrictions.


UPDATE:

This is the list of MSI files for MSVC2015 tools, headers and libraries:

packagesVisualC_D14VC_Tools.CoreVC_Tools.Core.msi
packagesVisualC_D14VC_Tools.Core.ResVC_Tools.Core.Res.msi
packagesVisualC_D14VC_Tools.X86.BaseVC_Tools.X86.Base.msi
packagesVisualC_D14VC_Tools.X86.Base.ResVC_Tools.X86.Base.Res.msi
packagesVisualC_D14VC_Tools.X86.NatVC_Tools.X86.Nat.msi
packagesVisualC_D14VC_Tools.X86.Nat.ResVC_Tools.X86.Nat.Res.msi
packagesVisualC_D14VC_Tools.X86.X64VC_Tools.X86.X64.msi
packagesVisualC_D14VC_Tools.X86.X64.ResVC_Tools.X86.X64.Res.msi
packagesVisualC_D14VC_PremTools.X86.BaseVC_PremTools.X86.Base.msi
packagesVisualC_D14VC_PremTools.X86.Base.ResVC_PremTools.X86.Base.Res.msi
packagesVisualC_D14VC_PremTools.X86.NatVC_PremTools.X86.Nat.msi
packagesVisualC_D14VC_PremTools.X86.Nat.ResVC_PremTools.X86.Nat.Res.msi
packagesVisualC_D14VC_PremTools.X86.X64VC_PremTools.X86.X64.msi
packagesVisualC_D14VC_PremTools.X86.X64.ResVC_PremTools.X86.X64.Res.msi
packagesVisualC_D14VC_CRT.HeadersVC_CRT.Headers.msi
packagesVisualC_D14VC_CRT.X86.DesktopVC_CRT.X86.Desktop.msi
packagesVisualC_D14VC_CRT.X86.StoreVC_CRT.X86.Store.msi
packagesVisualC_D14VC_CRT.X64.DesktopVC_CRT.X64.Desktop.msi
packagesVisualC_D14VC_CRT.X64.StoreVC_CRT.X64.Store.msi
packagesVisualC_D14VC_CRT.Redist.ResVC_CRT.Redist.Res.msi
packagesVisualC_D14VC_CRT.Redist.X86VC_CRT.Redist.X86.msi
packagesVisualC_D14VC_CRT.Redist.X64VC_CRT.Redist.X64.msi
packagesVisualC_D14VC_ATL.HeadersVC_ATL.Headers.msi
packagesVisualC_D14VC_ATL.X86VC_ATL.X86.msi
packagesVisualC_D14VC_ATL.X64VC_ATL.X64.msi
packagesVisualC_D14VC_MFC.HeadersVC_MFC.Headers.msi
packagesVisualC_D14VC_MFC.X86VC_MFC.X86.msi
packagesVisualC_D14VC_MFC.X64VC_MFC.X64.msi
packagesVisualC_D14VC_PGO.HeadersVC_PGO.Headers.msi
packagesVisualC_D14VC_PGO.X86VC_PGO.X86.msi
packagesVisualC_D14VC_PGO.X64VC_PGO.X64.msi
packagesWin10_UniversalCRTSDKUniversal CRT Headers Libraries and Sources-x86_en-us.msi

And this is the list of MSI files for WinSDK10 tools, headers and libraries (downloaded separately):

InstallersWindows SDK Desktop Headers Libs Metadata-x86_en-us.msi
InstallersWindows SDK Desktop Tools-x86_en-us.msi
InstallersWindows SDK for Windows Store Apps Headers Libs-x86_en-us.msi
InstallersWindows SDK for Windows Store Apps Tools-x86_en-us.msi

All of this include stuff for both x86 and x64 (I haven't considered ARM or IA64). Both bundles compressed with LZMA will yield a 185MB file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...