简体   繁体   English

Visual Studio 2017企业版离线安装失败

[英]Visual Studio 2017 Enterprise Offline Installation Fails

I have created a Visual Studio 2017 offline installer using the command: mu_visual_studio_enterprise_2017_x86_x64_10049783.exe --layout c:\\vs2017offline 我使用以下命令创建了Visual Studio 2017脱机安装程序: mu_visual_studio_enterprise_2017_x86_x64_10049783.exe --layout c:\\vs2017offline

Behind firewall, when I execute mu_visual_studio_enterprise_2017_x86_x64_10049783.exe, in the vs2017offline folder, I'm getting the following error: 在防火墙后面,当我在vs2017offline文件夹中执行mu_visual_studio_enterprise_2017_x86_x64_10049783.exe时,我收到以下错误:

Details WebClient download failed: The remote server returned an error: (407) Proxy Authentication Required. 详细信息WebClient下载失败:远程服务器返回错误:(407)需要代理身份验证。 Bits download failed: Error context: BG_ERROR_CONTEXT_REMOTE_FILE, Error code: -2145844841 WinInet download failed: Url ' https://download.microsoft.com/download/0/1/2/012ECA6A-588A-4E9A-9759-62DB964C511A/VSInitializer.exe ' returned HTTP status code: 407 位下载失败:错误上下文:BG_ERROR_CONTEXT_REMOTE_FILE,错误代码:-2145844841 WinInet下载失败:Url'https://download.microsoft.com/download/0/1/2/012ECA6A-588A-4E9A-9759-62DB964C511A/VSInitializer 。 exe '返回HTTP状态码:407

Seems the installer still attempts making a connection to the internet. 似乎安装程序仍尝试连接到Internet。

Help. 救命。

For me it was the issue with validating the certificates the packages has been signed with. 对我来说,这是验证包签署的证书的问题。 Since validation was failing, it was trying to connect to the internet to get the packages again. 由于验证失败,它试图连接到互联网以再次获得包。 I imported all the certificates in the /layoutRoot/certificates folder and retried the installation and it worked. 我导入了/layoutRoot/certificates文件夹中的所有证书,并重新安装了它并且工作正常。

I work on a completely air-gapped network and managed to install from the off-line installer without seeing any problems. 我在一个完全空气密封的网络上工作,并设法从离线安装程序安装,没有发现任何问题。 However today my colleague using the same installer saw the error saying their was no Internet connection. 但是今天我的同事使用相同的安装程序看到错误,说他们没有互联网连接。 After some investigation and comparison with my machine I managed to get it installed on his machine. 经过一些调查和与我的机器比较后,我设法将它安装在他的机器上。

Firstly I had created a Visual Studio 2017 Enterprise offline installer using the following command: 首先,我使用以下命令创建了Visual Studio 2017 Enterprise脱机安装程序:

    mu_visual_studio_enterprise_2017_x86_x64_10049783.exe --layout c:\vs2017offline  --lang en-US

Performing the following steps got it installed for my colleague. 执行以下步骤为我的同事安装了它。

Go into the 'certificates' directory in the installer directory, right click on each of the three files and select 'Install PFX'. 进入安装程序目录中的“certificates”目录,右键单击这三个文件中的每一个,然后选择“Install PFX”。 I am not sure if this actually helps for the later step. 我不确定这是否真的有助于后续步骤。

Start a Command Prompt running as Administrator. 启动以管理员身份运行的命令提示符。 This should start you in the Windows system directory, eg c:\\windows\\system32. 这应该从Windows系统目录开始,例如c:\\ windows \\ system32。

Type the command 输入命令

cd c:\windows\system32\drivers\etc

Type the command 输入命令

notepad hosts

Add the following lines to the end of the file 将以下行添加到文件末尾

127.0.0.1   ctldl.windowsupdate.com
127.0.0.1   ocsp.verisign.com
127.0.0.1   crl.verisign.com
127.0.0.1   csc3-2009-2-crl.verisign.com
127.0.0.1   github.com
127.0.0.1   nuget.org
127.0.0.1   download.codeplex.com
127.0.0.1   tools.google.com
127.0.0.1   www.startssl.com
127.0.0.1   ctldl.windowsupdate.com
127.0.0.1   crl.microsoft.com
127.0.0.1   crl.thawte.com
127.0.0.1   referencesource.microsoft.com
127.0.0.1   msdl.microsoft.com

Save the file. 保存文件。

Now run 现在跑

mu_visual_studio_enterprise_2017_x86_x64_10049783.exe

It should churn away for a little while before eventually display the screen for selecting the VC workloads. 在最终显示用于选择VC工作负载的屏幕之前,它应该流失一段时间。

It really works. 真的行。 But.... 但....

1. The downloading process for the packages is not always error-free, sometimes it is aborting. 1.软件包的下载过程并不总是没有错误,有时会中止。

What you have tried, is downloading ALL, I would not recommend that... 您尝试过,正在下载所有,我不会建议...

2. It's really big. 2.这是非常大的。 Take this: 拿着它:

The following command downloads the whole VS 2017 for only English language , and there was exactly 20,6 GB shown in explorer (1901 files). 以下命令仅以英语语言下载整个VS 2017,并且在explorer(1901文件)中显示了正好20,6 GB。

I don't know how big the whole data for all languages With downloading only a part of this And I am not sure, if I got all, with another try I got less... 我不知道所有语言的整个数据有多大只下载了一部分而且我不确定,如果我得到了所有,再试一次我得到的更少......

So at least add the language parameter: " --lang en-US " or two languages... 所以至少添加语言参数:“ - lang en-US ”或两种语言......

3. In internet connection is used always for initialization (there should be parameters to avoid that, but there is are not exactly known which should work until now...) 3.在因特网连接总是用于初始化(应该有参数来避免这种情况,但是到目前为止还没有确切知道哪些应该工作......)

4. No.3 seems is bad, admitted. 4. 3号似乎是坏的,录取。 But there is a good point to say about the installer too: It is enough to download only a part of files offline, and the installer is smart enough to download all these files from internet, which don't exist (offline) on your disk. 但是关于安装程序也有一个很好的说法:只下载一部分文件就足够了,安装程序足够聪明,可以从互联网上下载所有这些文件,这些文件在磁盘上不存在(离线) 。

So, you can start with: 所以,你可以从:

vs_enterprise__873301792.1489161815.exe --layout %CD%\vs2017offline --lang en-US --add Microsoft.VisualStudio.Workload.ManagedDesktop

This downloads only 1 GB. 这仅下载1 GB。 It should be possible to extend that line with: 应该可以扩展该行:

--add Microsoft.VisualStudio.Workload.Data - 添加Microsoft.VisualStudio.Workload.Data
--add Microsoft.VisualStudio.Workload.NetWeb - 添加Microsoft.VisualStudio.Workload.NetWeb
--add Microsoft.VisualStudio.Workload.Node - 添加Microsoft.VisualStudio.Workload.Node
--add Microsoft.VisualStudio.Workload.Universal - 添加Microsoft.VisualStudio.Workload.Universal
--add Microsoft.VisualStudio.Workload.NetCoreTools - 添加Microsoft.VisualStudio.Workload.NetCoreTools

If there is an error, download them step-by-step. 如果出现错误,请逐步下载。

Then you have all main .NET parts. 然后你有所有主要的.NET部分。 (Cordova, Azure, MS Office adapter, game programming, Unity not mentioned here). (Cordova,Azure,MS Office适配器,游戏编程,这里没有提到Unity)。 For more details, look here: Visual Studio 2017 workload and component IDs . 有关更多详细信息,请查看此处: Visual Studio 2017工作负载和组件ID

For C++ standard install add: 对于C ++标准安装添加:

--add Microsoft.VisualStudio.Workload.NativeDesktop (for C++) --add Microsoft.VisualStudio.Workload.NativeDesktop(for C ++)

More possible options/packages: 更多可能的选项/包:

--add Component.GitHub.VisualStudio --add Component.GitHub.VisualStudio
--add Microsoft.Component.Blend.SDK.WPF --add Microsoft.Component.Blend.SDK.WPF
--add Microsoft.Component.HelpViewer - 添加Microsoft.Component.HelpViewer
--add Microsoft.VisualStudio.Component.TestTools.Core - 添加Microsoft.VisualStudio.Component.TestTools.Core
--add Microsoft.VisualStudio.Component.TestTools.MicrosoftTestManager - 添加Microsoft.VisualStudio.Component.TestTools.MicrosoftTestManager
--add Microsoft.VisualStudio.Component.TestTools.WebLoadTest --add Microsoft.VisualStudio.Component.TestTools.WebLoadTest
--add Microsoft.VisualStudio.Component.TypeScript.2.0 - 添加Microsoft.VisualStudio.Component.TypeScript.2.0
--add Microsoft.VisualStudio.Component.TestTools.CodedUITest - 添加Microsoft.VisualStudio.Component.TestTools.CodedUITest

All together, it's less than 3 GB... Maybe you prefer this to the 20++ GB monster. 总而言之,它不到3 GB ......也许你更喜欢20GB的GB怪物。 Make an .iso out of that (I have used AnyBurn), and: ready. 制作一个.iso(我已经使用过AnyBurn),并准备好了。 You can install on a PC with mobile connection without big costs, only be sure to select the correct language (here English) for the VS installer, if your Windows was started in another language. 您可以在没有大量成本的情况下安装在具有移动连接的PC上,只有当您的Windows以其他语言启动时,才能确保为VS安装程序选择正确的语言(此处为英语)。 Because of that, the VS installer downloaded again 1 GB, but it was my fault... 因此,VS安装程序再次下载1 GB,但这是我的错...

The short answer : 简短的回答

Don't use --layout switch for offline setup, use it ONLY for downloading a new workload. 不要使用--layout开关进行离线设置,仅用于下载新工作负载。

The long answer . 答案 很长

After the offline has been successfully downloaded, these simple steps help me keep out of the setup troubles, hope this also help someone else : 离线成功下载后,这些简单的步骤可以帮助我避免设置问题,希望这也有助于其他人:

1. Ensure you're connected to the internet. 1.确保您已连接到互联网。

2. Validating the certificates. 2.验证证书。

3. Make sure you have enough space for the installation. 3.确保有足够的空间进行安装。 If you receive messages like "file not found" retry to resume the offline by retyping the same command in the same folder. 如果您收到“找不到文件”之类的消息,请通过在同一文件夹中重新输入相同的命令来重新启动脱机。

4. run the installer 4.运行安装程序

I was getting a prompt for internet connection, however after I did install all 3 certificates, installation was a success!, Maybe you guys need to confirm the download wasn't broken, or maybe install 我得到了互联网连接的提示,但是在我安装了所有3个证书之后,安装成功了!也许你们需要确认下载没有损坏,或者可能安装

aio-runtime 2.4.1

mainifestCounterSignCerficates.p12

mainifestSignCertificates.p12

vs_installer_opc.SignCertificates.p12

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM