Visual Studio 2017 Enterprise Offline Installation Fails

21,464

Solution 1

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.

Solution 2

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:

    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'. 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, e.g. 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.

Solution 3

It really works. But....

1. The downloading process for the packages is not always error-free, sometimes it is aborting.

What you have tried, is downloading ALL, I would not recommend that...

2. It's really big. 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).

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...

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...)

4. No.3 seems is bad, admitted. 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. It should be possible to extend that line with:

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

If there is an error, download them step-by-step.

Then you have all main .NET parts. (Cordova, Azure, MS Office adapter, game programming, Unity not mentioned here). For more details, look here: Visual Studio 2017 workload and component IDs.

For C++ standard install add:

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

More possible options/packages:

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

All together, it's less than 3 GB... Maybe you prefer this to the 20++ GB monster. Make an .iso out of that (I have used AnyBurn), and: ready. 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. Because of that, the VS installer downloaded again 1 GB, but it was my fault...

Share:
21,464

Related videos on Youtube

Ershad Nozari
Author by

Ershad Nozari

Updated on July 09, 2022

Comments

  • Ershad Nozari
    Ershad Nozari almost 2 years

    I have created a Visual Studio 2017 offline installer using the command: 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:

    Details WebClient download failed: The remote server returned an error: (407) Proxy Authentication Required. 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

    Seems the installer still attempts making a connection to the internet.

    Help.

    • Ershad Nozari
      Ershad Nozari about 7 years
      The offline installation option for Visual Studio 2017 is completely useless. The installer still attempts to make an outbound connection to the internet. You’d think this would have been tested before release. I’m sitting behind firewall without internet connection and can’t install VS2017. This is very sad and annoying.
    • clairestreb
      clairestreb almost 7 years
      Vote here to request Microsoft make an ISO for VS 2017: visualstudio.uservoice.com/forums/121579-visual-studio-ide/…
  • Ershad Nozari
    Ershad Nozari about 7 years
    This issue has nothing to do with certificates. Once the layout has been created, if you disconnect from internet Visual Studio installation won’t succeed. Details WebClient download failed: The remote name could not be resolved: 'download.microsoft.com' Bits download failed: File not found. WinInet download failed: Function: InternetOpenUrl, HR: -2147012889, Message: Unknown error 12007. The installer still attempts to make an outbound connection to the internet.
  • Michael Burr
    Michael Burr about 7 years
    @ErshadNozari: can you verify that you performed this step after the layout and before performing the offline install: "Install the certificates (They are in the Certificates folder, which is in your Layout folder. Simply right-click each one to install it.)". From docs.microsoft.com/en-us/visualstudio/install/…
  • Ershad Nozari
    Ershad Nozari about 7 years
    I have installed the certs, but no luck. I’m now getting this error: Details WebClient download failed: The remote server returned an error: (403) Forbidden. Bits download failed: Error context: BG_ERROR_CONTEXT_REMOTE_FILE, Error code: -2145844845 WinInet download failed: Url 'download.microsoft.com/download/0/1/2/…' returned HTTP status code: 403
  • Ershad Nozari
    Ershad Nozari about 7 years
    Ok so installing the certs worked but, however I had to uninstall the previous failed installation first.
  • Sami Ben
    Sami Ben about 7 years
    Are recommended components installed by default or not? And is VS Installer automatically downloaded in the offline layout or not? Do I need it to run it?
  • DaveCleland
    DaveCleland about 7 years
    User said he has no internet connection.
  • Arve Systad
    Arve Systad almost 7 years
    This worked for me too. However, I did get an error about the setup failing (I don't know exactly where in the process, since I left the server to itself while the setup ran). It still managed to do enough to let TeamCity run VS2017 builds properly.
  • joshmcode
    joshmcode almost 7 years
    I had tried this once before, but I had just accepted the defaults. Once I pointed them to the root, it worked. +1