没有网络,怎么安装VS2019呢?

没有网络,怎么安装 VS2019 呢?

如果电脑或者云桌面没有连接到外网,怎么安装 VS2019 呢?我们可以使用可以连接到外网的计算机制作离线安装包,具体方式如下:

在官网下载 VS2019 的在线安装包:

https://visualstudio.microsoft.com/zh-hans/downloads/

新建一个文件夹接收下载的文件:D:\VS2019 。将离线安装程序放入该文件夹,若需要完整离线安装包,则输入以下命令:

.\vs_community_2019.exe --layout D:\VS2019 --lang en-US zh-CN

如果仅需 .NET 桌面开发C++ 桌面开发(英文加中文),则输入以下命令:

.\vs_community_2019.exe --layout D:\VS2019 --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --lang en-US zh-CN

开始下载后,会先启动 Visual Studio Installer 的界面,然后会再启动一个显示下载进度日志的命令行。下载完毕后,启动 vs_setup.exe 就可以开始安装了

如果第一次没有下载完整的离线安装包,后期想再添加组件,则需要知道组件的ID:

添加 Unity开发支持 组件

.\vs_community_2019.exe --layout D:\VS2019 --add Microsoft.VisualStudio.Workload.ManagedGame --lang en-US zh-CN

添加 MFC支持 组件

.\vs_community_2019.exe --layout D:\VS2019 --add Microsoft.VisualStudio.Component.VC.ATLMFC --lang en-US zh-CN

添加 C++/CLI 支持 组件

.\vs_community_2019.exe --layout D:\VS2019 --add Microsoft.VisualStudio.Component.VC.CLI.Support --lang en-US zh-CN

安装 HelpViewer

.\vs_community_2019.exe --layout D:\VS2019 --add Microsoft.Component.HelpViewer --lang en-US zh-CN

查看VS2019的工作负荷和组件ID:

https://learn.microsoft.com/zh-cn/visualstudio/install/workload-component-id-vs-community?view=vs-2019

使用 C++ 的桌面开发

ID: Microsoft.VisualStudio.Workload.NativeDesktop

描述: 使用所选工具(包括 MSVC、Clang、CMake 或 MSBuild)生成适用于 Windows 的新式 C++ 应用

组件 ID 属性 依赖项类型
Microsoft.Component.MSBuild MSBuild 必需
Microsoft.VisualStudio.Component.ClassDesigner 类设计器 必需
Microsoft.VisualStudio.Component.CodeMap 代码图 必需
Microsoft.VisualStudio.Component.GraphDocument DGML 编辑器 必需
Microsoft.VisualStudio.Component.Roslyn.Compiler C# 和 Visual Basic Roslyn 编译器 必需
Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime SQL Server Express 2016 LocalDB 必需
Microsoft.VisualStudio.Component.TextTemplating 文本模板转换 必需
Microsoft.VisualStudio.Component.VC.CoreIde C++ 核心功能 必需
Microsoft.VisualStudio.Component.VC.Redist.14.Latest C++ 2019 Redistributable 更新 必需
Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Native 适用于 C++ 的体系结构工具 必需
Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core C++ 核心桌面功能 必需
Component.Microsoft.VisualStudio.LiveShare Live Share 建议
Microsoft.VisualStudio.Component.Debugger.JustInTime 实时调试器 建议
Microsoft.VisualStudio.Component.Graphics.Tools 适用于 DirectX 的图形调试器和 GPU 探查器 建议
Microsoft.VisualStudio.Component.IntelliCode IntelliCode 建议
Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd IntelliTrace 建议
Microsoft.VisualStudio.Component.JavaScript.TypeScript JavaScript 和 TypeScript 语言支持 建议
Microsoft.VisualStudio.Component.NuGet NuGet 程序包管理器 建议
Microsoft.VisualStudio.Component.Roslyn.LanguageServices C# 和 Visual Basic 建议
Microsoft.VisualStudio.Component.TypeScript.4.3 TypeScript 4.3 SDK 建议
Microsoft.VisualStudio.Component.VC.ASAN C++ AddressSanitizer 建议
Microsoft.VisualStudio.Component.VC.ATL 适用于最新 v142 生成工具的 C++ ATL (x86 & x64) 建议
Microsoft.VisualStudio.Component.VC.CMake.Project 用于 Windows 的 C++ CMake 工具 建议
Microsoft.VisualStudio.Component.VC.DiagnosticTools C++ 分析工具 建议
Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest Boost.Test 测试适配器 建议
Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest Google Test 测试适配器 建议
Microsoft.VisualStudio.Component.VC.Tools.x86.x64 MSVC v142 - VS 2019 C++ x64/x86 生成工具(最新版本) 建议
Microsoft.VisualStudio.Component.Windows10SDK.19041 Windows 10 SDK (10.0.19041.0) 建议
Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions ASP.NET 和 Web 开发 建议
Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake JSON 编辑器 建议
Component.Incredibuild Incredibuild - 生成加速 可选
Component.IncredibuildMenu IncrediBuildMenu 可选
Microsoft.Component.VC.Runtime.UCRTSDK Windows 通用 CRT SDK 可选
Microsoft.Net.Component.4.6.1.TargetingPack .NET Framework 4.6.1 目标包 可选
Microsoft.Net.Component.4.8.SDK .NET Framework 4.8 SDK 可选
Microsoft.VisualStudio.Component.JavaScript.Diagnostics JavaScript 诊断 可选
Microsoft.VisualStudio.Component.VC.140 MSVC v140 - VS 2015 C++ 生成工具 (v14.00) 可选
Microsoft.VisualStudio.Component.VC.ATLMFC 适用于最新 v142 生成工具的 C++ MFC(x86 和 x64) 可选
Microsoft.VisualStudio.Component.VC.CLI.Support 适用于 v142 生成工具的 C++/CLI 支持(最新版本) 可选
Microsoft.VisualStudio.Component.VC.Llvm.Clang 适用于 Windows 的 C++ Clang 编译器 (12.0.0) 可选
Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset v142 生成工具的 C++ Clang-cl (x64/x86) 可选
Microsoft.VisualStudio.Component.VC.Modules.x86.x64 C++ Modules for v142 生成工具(x64/x86 - 试验) 可选
Microsoft.VisualStudio.Component.VC.Tools.ARM64 MSVC v142 - VS 2019 C++ ARM64 生成工具(最新版本) 可选
Microsoft.VisualStudio.Component.VC.v141.x86.x64 MSVC v141 - VS 2017 C++ x64/x86 生成工具 (v14.16) 可选
Microsoft.VisualStudio.Component.Windows10SDK.16299 Windows 10 SDK (10.0.16299.0) 可选
Microsoft.VisualStudio.Component.Windows10SDK.17134 Windows 10 SDK (10.0.17134.0) 可选
Microsoft.VisualStudio.Component.Windows10SDK.17763 Windows 10 SDK (10.0.17763.0) 可选
Microsoft.VisualStudio.Component.Windows10SDK.18362 Windows 10 SDK (10.0.18362.0) 可选
Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang 适用于 Windows 的 C++ Clang 工具 (12.0.0 - x64/x86) 可选

该文章会更新,欢迎大家批评指正。

推荐一个零声学院免费公开课程,个人觉得老师讲得不错,
分享给大家:[Linux,Nginx,ZeroMQ,MySQL,Redis,
fastdfs,MongoDB,ZK,流媒体,CDN,P2P,K8S,Docker,
TCP/IP,协程,DPDK等技术内容,点击立即学习:
服务器课程:C++服务器

你可能感兴趣的:(Windows,C++开发,c++,visual,studio)