简体   繁体   English

Visual Studio 2017无法脱机安装“无法下载安装文件”

[英]Visual Studio 2017 fails to install offline with “Unable to download installation files”

So I've created an offline installed of VS 2017 Community on my laptop using this command: 所以我使用以下命令在笔记本电脑上创建了VS 2017社区的离线安装:

vs_community.exe --layout "D:\\Downloads\\VS Community 2017" --lang en-US --add Microsoft.VisualStudio.Component.CoreEditor Component.WebSocket Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NetCrossPlat Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.Node Microsoft.VisualStudio.Component.TypeScript.2.0 vs_community.exe --layout“D:\\ Downloads \\ VS Community 2017”--lang en-US --add Microsoft.VisualStudio.Component.CoreEditor Component.WebSocket Microsoft.VisualStudio.Workload.ManagedDesktop Microsoft.VisualStudio.Workload.NetCrossPlat Microsoft .VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.Node Microsoft.VisualStudio.Component.TypeScript.2.0

When I transfer the setup files onto my corporate PC (which is behind a firewall) and run the "vs_community.exe" setup file, all I get is this error. 当我将安装文件传输到我的公司PC(位于防火墙后面)并运行“vs_community.exe”安装文件时,我得到的就是这个错误。 There's no way to bypass the corporate firewall or to make exceptions. 没有办法绕过公司防火墙或做出例外。 How do I install VS 2017 offline? 如何离线安装VS 2017? Am I missing something here? 我在这里错过了什么吗?

在此输入图像描述

Edit: I have installed VS 2017 on my laptop keeping the internet connection active. 编辑:我已经在我的笔记本电脑上安装了VS 2017,保持互联网连接活动。 Then when I disconnect the internet on my laptop and try installing again, the installer launches! 然后,当我在笔记本电脑上断开互联网并再次尝试安装时,安装程​​序启动! So perhaps there are some dependencies missing on my corporate PC that are now installed on my laptop? 那么,我的企业PC上是否有一些依赖项缺失,现在已经安装在我的笔记本电脑上了?

Edit: The above command installs .NET, .NET core, Xamarin, Node.js, TypeScript and C++ for Mobile. 编辑:上面的命令安装.NET,.NET核心,Xamarin,Node.js,TypeScript和C ++ for Mobile。 The total downloaded size is 13.2 GB. 总下载大小为13.2 GB。

It worked!! 有效!! All I had to do was install the certificates into the root CA! 我所要做的就是将证书安装到根CA中! Something I missed noticing in the VS 2017 docs: 我错过了在VS 2017文档中注意到的东西:

How to install from the offline installation folder 如何从脱机安装文件夹安装

  1. Install the certificates (They are in the "certificates" folder, which is in your Layout folder. ) 安装证书 (它们位于“证书”文件夹中,位于“布局”文件夹中。)

  2. Simply right-click each one and choose Install PFX. 只需右键单击每个,然后选择“安装PFX”。

  3. Specify Local machine (not current user) 指定本地计算机(不是当前用户)
  4. You can use an empty password 您可以使用空密码
  5. Run the installation file. 运行安装文件。 For example, run: c:\\vs2017offline\\vs_enterprise.exe 例如,运行:c:\\ vs2017offline \\ vs_enterprise.exe

--- Microsoft Docs --- Microsoft Docs

Edit: Remember to install the certs using the Admin account on the PC, or it won't work... 编辑:请记住使用PC上的管理员帐户安装证书,否则它将无法运行...

Please try to follow this steps: 请尝试按照以下步骤操作:

  1. Right click on exe file. 右键单击exe文件。
  2. Select "Properties". 选择“属性”。
  3. Click on the "Digital Signatures" tab. 单击“数字签名”选项卡。 Now you can see "signature list". 现在你可以看到“签名列表”。
  4. Select signature 选择签名
  5. Click on "Details" button. 单击“详细信息”按钮。
  6. Click on "View certificate" button 单击“查看证书”按钮
  7. Click on "Install certificate" and follows installation wizard 单击“安装证书”,然后按照安装向导进行操作

All certificates within "signature list" should be installed. 应安装“签名列表”中的所有证书。 I use Windows 10. 我使用的是Windows 10。

Was doing this for VS Community 2017 and it would install everything and it does the core installation without any trouble. 正在为VS社区2017做这个,它会安装所有内容,它可以毫无困难地进行核心安装。 However, if i select to install the universal or .Net development portions it will install it almost completely, but it will fail on two files. 但是,如果我选择安装通用或.Net开发部分,它将几乎完全安装它,但它将在两个文件上失败。 It will say that it cannot download the files from the internet. 它会说它无法从互联网上下载文件。 The files exist in the installation directory and I even went and downloaded the files and placed them into the appropriate directories and it still thinks that it needs to download those two files preventing me from completing the installation process. 这些文件存在于安装目录中,我甚至去下载文件并将它们放入相应的目录中,它仍然认为需要下载这两个文件,这使我无法完成安装过程。 If I just continue it will install everything else except those two files. 如果我继续它将安装除了这两个文件之外的所有其他内容。 I've tried this with a few different layout downloads in different forms (ISO, directory, etc) and same issue (so it isn't a bad download or anything, and I'm sure I did that all correctly). 我已尝试过以不同形式(ISO,目录等)和相同问题进行一些不同的布局下载(所以这不是一个糟糕的下载或任何东西,我确信我做的都正确)。 The two files are: 这两个文件是:

https://download.visualstudio.microsoft.com/download/pr/10983757/f8c877406947fdc71ed2dd9127d2f9fa/microsoft.codeanalysis.visualstudio.interactivecomponents.resources.vsix https://download.visualstudio.microsoft.com/download/pr/10983757/f8c877406947fdc71ed2dd9127d2f9fa/microsoft.codeanalysis.visualstudio.interactivecomponents.resources.vsix

https://download.visualstudio.microsoft.com/download/pr/11347028/25bedee219940beceecab91dac231235/microsoft.visualstudio.testtools.testplatform.legacy.core.resources.vsix https://download.visualstudio.microsoft.com/download/pr/11347028/25bedee219940beceecab91dac231235/microsoft.visualstudio.testtools.testplatform.legacy.core.resources.vsix

If I plug myself online and do a repair it will go grab those two files without having to grab everything else, but it kind of defeats the purpose. 如果我把自己插在网上并进行修复,它将会抓住这两个文件,而不必抓住其他所有文件,但它有点挫败了目的。 Don't expect a solution, but wanted to mention it because all the other problems are related to installing the certs and I can't find anything online about it failing on just a few files. 不要指望一个解决方案,但是想提及它,因为所有其他问题都与安装证书有关,而我在网上找不到任何关于它的信息,只是在几个文件上失败了。

In my case it was related to CNG key isolation windows service , it was disabled, the solution mentioned in below link: 在我的情况下,它与CNG密钥隔离窗口服务有关 ,它被禁用,下面链接中提到的解决方案:

Visual Studio 2017 - Can't install Visual Studio 2017 - 无法安装

I have the same issue after uninstalling SSDT for Visual studio 2017 , Can't remove and reinstall or update visual studio 2017 . 在为Visual Studio 2017卸载SSDT后遇到了同样的问题, 无法删除并重新安装或更新Visual Studio 2017 I just restart my machine and it's OK. 我只是重启我的机器,没关系。 my be you have also to log in as an administrator ( it depends on your machine configuration and what you can do with you current account) 我是你还要以管理员身份登录(这取决于你的机器配置以及你可以用你的当前账户做什么)

How i solved mine. 我怎么解决了我的。

  1. I downloaded the setup helper from Microsoft website (i downloaded the enterprise installer, because that's the offline installer version i have ) 我从Microsoft网站下载了安装帮助程序(我下载了企业安装程序,因为那是我的离线安装程序版本)
  2. I ran the program, and it wanted to download the complete setup, so i cancelled it 我运行程序,它想下载完整的设置,所以我取消了它
  3. I ran my offline installer (vs_Enterprise.exe) 我运行了我的脱机安装程序(vs_Enterprise.exe)
  4. Then it fixed the issue. 然后它解决了这个问题。
  5. I disconnected the internet, and continued with the offline installation 我断开了互联网的连接,继续进行离线安装

Edited to avoid misunderstand 编辑以避免误解

Running the downloaded Visual Studio layout as administrator worked for me. 以管理员身份运行下载的Visual Studio布局为我工作。 Maybe the VS_Version.exe try to normally download the files because it can't access to files in the layout (sometimes named backup ), like me, in my job we have a lot of restrictions and when I ran the VS_version.exe tried to download and get the message error, but when I ran again the .exe as Administrator the installer started normaly, getting the files from the backup folder 也许VS_Version.exe尝试正常下载文件,因为它无法访问布局中的文件(有时命名为备份 ),像我一样,在我的工作中我们有很多限制,当我运行VS_version.exe试图下载并收到消息错误,但当我再次运行.exe作为管理员时,安装程​​序正常启动,从备份文件夹中获取文件

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

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