vs2017 制作安装程序_如何为VS2017制作离线安装程序

vs2017 制作安装程序

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.

它会去下载您需要的一切。 如果您需要所有内容,则需要一些时间,因此请稍候。

Give us a minute, we'll be done soon...

If you have trouble or nothing happens, check the dd_bootstrapper*.log file in %TEMP%.

如果遇到问题或什么都没有发生,请检查%TEMP%中的dd_bootstrapper * .log文件。

DOS prompt downloading Visual Studio

When it's all done you'll end up with a folder like this that you can copy to a DVD or USB key.

完成后,您将得到一个像这样的文件夹,您可以将其复制到DVD或USB闪存盘。

The result of the VS offline Layout generator

One nice aspect of this system is that you can update a "layout" in place. As updates become available for Visual Studio 2017 (RC or otherwise), you can run the --layout command again, pointing to the same layout folder, to ensure that the folder contains the latest components. Only those components that have been updated since the last time --layout was run will be downloaded.

该系统的一个不错的方面是您可以就地更新“布局” 。 随着更新可用于Visual Studio 2017(RC或其他),您可以再次运行--layout命令,指向同一布局文件夹,以确保该文件夹包含最新组件。 仅下载自上次运行--layout以来已更新的那些组件。

IMPORTANT NOTE: Make sure that your file is named "vs_[SKU].exe." Sometimes you'll end up with a file like vs_community__198521760.1486960229.exe and you'll want to rename it to vs_community.exe for offline to work.

重要说明:确保您的文件名为“ vs_ [SKU] .exe”。 有时,您最终会得到一个类似vs_community__198521760.1486960229.exe的文件,并且您希望将其重命名为vs_community.exe以便脱机工作。

Before you run the installer, you'll want to install the root certificates in the \certificates folder. From the team:

在运行安装程序之前,您需要在\ certificates文件夹中安装根证书。 来自团队:

They are the root certs needed to verify the setup application (the stuff installed under ProgramFiles\Visual Studio\2017\Installer) and the catalog (a json file that lists of all the VS components that could be installed by setup).  Most computers will already have these root certs.  But users on Win7 machine may not.  Once you install these certs, setup will be able to authenticate the content being installed is trusted.  You should not remove them after installing them.

它们是验证安装程序(安装在ProgramFiles \ Visual Studio \ 2017 \ Installer下的东西)和目录(列出安装程序可以安装的所有VS组件的json文件)所需的根证书。 大多数计算机将已经具有这些根证书。 但是Win7计算机上的用户可能不会。 安装这些证书后,安装程序将能够验证所安装内容的可信性。 安装它们后,请勿删除它们。

I hope this helps you set up offline installers for your classrooms and organizations! You'll save a lot of bandwidth.

我希望这可以帮助您为教室和组织机构设置离线安装程序! 您将节省大量带宽。

Sponsor: Big thanks to Raygun! Join 40,000+ developers who monitor their apps with Raygun. Understand the root cause of errors, crashes and performance issues in your software applications. Installs in minutes, try it today!

赞助商:非常感谢Raygun ! 加入40,000多名使用Raygun监视其应用程序的开发人员。 了解软件应用程序中错误,崩溃和性能问题的根本原因。 数分钟即可安装,立即尝试

翻译自: https://www.hanselman.com/blog/how-to-make-an-offline-installer-for-vs2017

vs2017 制作安装程序

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值