如何为VS2017制作离线安装程序
I just got back from Kenya and South Africa and had a great time speaking at NexTech Africa and the Microsoft Tech Summit in Johannesburg. I also got to hang out with my wife's family a bunch. While I was there I was reminded (as one is when one travels) how spoiled many of us with being always connected. Depending on how far out of town you get the quality of internet varies. There's not just bandwidth issues but also issues of latency and reliability.
我刚从肯尼亚和南非回来,在NexTech Africa和约翰内斯堡的Microsoft Tech Summit上度过了愉快的时光。 我还得和我妻子的家人一起出去玩。 当我在那儿时,我被提醒(就像一个人旅行一样)如何使我们许多人始终保持联系而宠坏了。 根据您到达城镇的距离,互联网的质量会有所不同。 不仅存在带宽问题,而且还存在延迟和可靠性问题。
Visual Studio generally - and Visual Studio 2017 specifically - has an online installer and if you lose connectivity during the installation you can run into problems. However, they haven't got an ISO available for downloading for legal reasons. They can't package up the Android Installer from Google, for example, into an ISO. The user needs to download certain things themselves dynamically.
通常,Visual Studio(尤其是Visual Studio 2017)具有在线安装程序,如果在安装过程中失去连接,可能会遇到问题。 但是,由于法律原因,他们没有可供下载的ISO。 他们无法将Google提供的Android Installer打包成一个ISO。 用户需要自己动态下载某些内容。
Fortunately there's docs that walk you through making an offline installer. These could be used to create USB sticks or DVDs that could then be passed out at User Groups or free Events.
幸运的是,有一些文档可以指导您完成离线安装程序。 这些可以用来创建USB记忆棒或DVD,然后可以在用户组或免费活动中传递出去。
-
First, I went to http://visualstudio.com/free and clicked Download. I use VS Community but you can also do this for Enterprise, etc. I downloaded the bootstrapper .exe and put it in its own folder.
首先,我转到http://visualstudio.com/free,然后单击“下载”。 我使用VS Community,但您也可以针对Enterprise等使用。我下载了bootstrapper .exe并将其放在自己的文件夹中。
-
If you want EVERYTHING possible then you'd run something like this. Note that is my folder there and I selected en-US as my language.
如果您希望一切皆有可能,那么您将运行类似的内容。 请注意,这是我的文件夹,我选择了en-US作为我的语言。
If you want EVERYTHING possible then you'd run something like this. Note that is my folder there and I selected en-US as my language.vs_community.exe --layout e:\vs2017offline --lang en-US
如果您希望一切皆有可能,那么您将运行类似的内容。 请注意,这是我的文件夹,我选择了en-US作为我的语言。 vs_community.exe --layout e:\ vs2017offline --lang zh-CN
-
However if you don't want EVERYTHING - maybe you just want .NET Core, ASP.NET Core, and Azure, then you'll pass those options in on the command line. They call them "Workloads" but that's a Microsoftism.
但是,如果您不想要任何东西-也许您只想要.NET Core,ASP.NET Core和Azure,那么您将在命令行中传递这些选项。 他们称它们为“工作量”,但这是一种微软主义。
-
Here is a list of all the Component IDs you can choose from.
这是您可以选择的所有组件ID的列表。
-
I did this to get an offline setup for my main four "workloads." I ran this from a cmd prompt.
我这样做是为了为我的主要四个“工作量”提供脱机设置。 我是从cmd提示符运行的。
I did this to get an offline setup for my main four "workloads." I ran this from a cmd prompt.vs_community.exe --layout e:\vs2017offline --lang en-US --add Microsoft.VisualStudio.Workload.Azure Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetWeb
我这样做是为了为我的主要四个“工作量”提供脱机设置。 我是从cmd提示符运行的。 vs_community.exe --layout e:\ vs2017offline --lang-zh-CN --add Microsoft.VisualStudio.Workload.Azure Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetWeb
-
It will go and download everything you need. If you want everything then it'll take a while, so hang back.
它会去下载您需要的一切。 如果您需要所有内容,则需要一些时间,因此请稍候。
If you have trouble or nothing happens, check the dd_bootstrapper*.log file in %TEMP%.
如果遇到问题或什么都没有发生,请检查%TEMP%中的dd_bootstrapper * .log文件。
翻译自: https://www.hanselman.com/blog/how-to-make-an-offline-installer-for-vs2017