如何為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