No ISO, no cry – Visual Studio 2017 installation behind a proxy or firewall (HowTo)

A new day in paradise! Microsoft has no ISO file for the new Visual Studio 2017, what will make it a little bit confusing how you should install VS2017 on a business VM with no internet connection. The Microsoft Visual Studio FAQ said:

Where can I find ISO Images?

We don’t have ISO files for Visual Studio 2017 because you have the ability to create your own offline layout installer.

(Source: https://www.visualstudio.com/vs/support/can-find-iso-images/ )

Wow, this could be a problem… No, not really if you know how to deal with the new, better way of installing Visual Studio 2017. In this article I will guide you through the way of doing an offline or internal network installation from the beginning.

The reason for failure

Microsoft has decided that a package management for the Visual Studio 2017 with a corresponding downloader is a good thing because you can now decide in detail which packages you really need for the installation. In itself this is actually a good thing, as the setup is correspondingly smaller and easily centralizeable in a network share on a USB stick or what else. But in fact, this downloader is the problem because the first attempt is to access the URL (https://aka.ms/vs/15/release/installer), which is almost blocked in nearly every company by the proxy or a content filter, and then the downloader itself uses this URL to download the packages for the setup, which will also fail.

The next think are the CA root certificates for your virtual machine or workstation. When a signature is verified in an online environment, Windows APIs are used to download and add the certificates to the system. Verification that the certificate is trusted and allowed via administrative settings occurs during this process. This verification process cannot occur in most offline environments. Installing the certificates manually allows enterprise administrators to ensure the certificates are trusted and meet the security policy of their organization. This step you have to do manual. I will show you how to do this slightly further down. Now get things working.

Step by step guide for installing Visual Studio 2017

1. The modern way of installing VS2017 explained right

For an installation you need something similar to an ISO file, which is indeed only a ZIP file. Microsoft calls the local copy of the files/packages a “layout”. So you need a layout cache in a network share. To get this files you need a tool that can download and varify the files and ckeck for updates. This downloader is called a “bootstrapper” by Microsoft. In the layout cache folder you will find the installer exe and the packages you selected. You can install one package by its name (see below in step 4) or you can select one or more so called “workloads” which bunches many packages, e.g. select all components for desktop development at once.
Ok, let’s start the preparation for your creating your network layout cache.

2. Be sure you wouldn’t be blocked by a firewall or proxyserver

Behind a proxy or firewall be shure you can connect to the following Domains (try this for example in a browser of your choice).

You can check this one for example: https://aka.ms/vs/15/release/installer

If you get a block page then send the following list to your proxy administrator. He/She will get things working for you.

Microsoft-Domain

Domain Reason
go.microsoft.com Downloader
aka.ms Downloader
download.visualstudio.microsoft.com Storage for the packages
0download.microsoft.com Storage for the packages
download.visualstudio.com Storage for the packages
dl.xamarin.com Storage for the packages
visualstudiogallery.msdn.microsoft.com Storage for Visual Studio extensions
http://www.visualstudio.com Storage for the documentation
msdn.microsoft.com Storage for the documentation
http://www.microsoft.com Storage for the documentation

Third-Party-Domains

Domain Installation for Workloads
archive.apache.org JavaScript
(Cordova)
cocos2d-x.org Game development with C++
(Cocos)
download.epicgames.com Game development with C++
(Unreal Engine)
download.oracle.com Mobile development with JavaScript
(Java SDK)Mobile development with .NET
(Java SDK)
download.unity3d.com Game development Unity
(Unity)
netstorage.unity3d.com Game development Unity
(Unity)
dl.google.com Mobile development withJavaScript
(Android SDK und NDK, Emulator)Mobile development with.NET
(Android SDK und NDK, Emulator)
http://www.incredibuild.com Game development with C++
(IncrediBuild)
incredibuildvs2017i.azureedge.net Game development with C++
(IncrediBuild)
http://www.python.org Python

Data Science and analytics Apps
(Python)

3. Get the installer and bootstrapper for your offline layout cache

Which edition of Visual Studio 2017 do you want to install? Get the right downlaoder (Microsoft calls this a bootstrapper) from Microsoft downlaodpage now. Here are the links:

Edition Download
Visual Studio Enterprise vs_enterprise.exe
Visual Studio Professional vs_professional.exe
Visual Studio Community vs_community.exe

Other supported bootstrappers include vs_buildtools.exe, vs_feedbackclient.exe, vs_teamexplorer.exe, vs_testagent.exe, vs_testcontroller.exe, and vs_testprofessional.exe.

Keep in mind: if you need different editions of Visual Studio you have to create more than one layout cache! One for every edition.

4. Install the missing CA root certificates in your system

When a signature is verified in an online environment, Windows APIs are used to download and add the certificates to the system. Verification that the certificate is trusted and allowed via administrative settings occurs during this process. This verification process cannot occur in most offline environments. Installing the certificates manually allows enterprise administrators to ensure the certificates are trusted and meet the security policy of their organization. This step you have to do manual.

After downloading the downloader ( 😉 ) you can right click the vs_xxx.exe to do the following steps to install all two or three certificates by repeating this steps:

vs2017_3

5. Let’s create a layout cache

  1. Create a folder on your machine like
    C:\VS2017\
  2. Create a network share and set permissions for all developers.
    \\servername\VS2017\
  3. Copy the downloader from step 3 in the directory you created in step 1
    C:\VS2017
  4. Click on Windows start and enter “ISE” so you can start the Windows PowerShell ISE with administrator privilegs!!!
  5. Now I will explain you the commands for creating a Powershell script to define what to download for your installation. Please open the links in this block to read more details from Microsoft about a special topic:--add to specify workload or component IDs. If --add is used, only those workloads and components specified with --add are downloaded. If --add is not used, all workload and components are downloaded.--includeRecommended to include all the recommended components for the specified workload IDs--includeOptional to include all the recommended and optional components for the specified workload IDs.--lang to specify language locales.real power of the new way of installing VS 2017 is that there are several options you can use to customize your network layout Powershell script. You can create a partial layout that only contains a specific set of language locales, workloads, components, and their recommended or optional dependencies. This might be useful if you know that you are going to deploy only a subset of workloads to client workstations.

    Here are a few examples of how to create a custom partial layout.

    I recommend you to download all workloads and components for your language. Please be shure you have a lot of free space on your network drive (about 25-30 GB)
    You can run the following command from the folder we created before with the downloader file in C:\VS2017 like:

    vs_enterprise.exe --layout \\servername\vs2017 --lang en-US

  1. This will create some json files, download all the package files and get the setup.exe to your network share. You should see a console which shows something like this:vs2017_4
  2. Some other examples you can run to minimize the size of installation files are the following:To download all workloads and components for multiple languages, run:
    vs_enterprise.exe --layout \\servername\vs2017 --lang en-US de-DE ja-JPTo download one workload for all languages, run
    vs_enterprise.exe --layout \\servername\vs2017 --add Microsoft.VisualStudio.Workload.Azure --includeRecommended
  3. To download two workloads and one optional component for three languages, run:
    vs_enterprise.exe --layout \\servername\vs2017 --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Component.GitHub.VisualStudio --includeRecommended --lang en-US de-DE ja-JPTo download two workloads and all of their recommended components, run:
    vs_enterprise.exe --layout \\servername\vs2017 --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Component.GitHub.VisualStudio --includeRecommendedTo download two workloads and all of their recommended and optional components, run:
    vs_enterprise.exe --layout \\servername\vs2017 --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Component.GitHub.VisualStudio --includeOptional

vs2017_5

IMPORTANT: Sometimes you will get an error that sais something like:

Unable to download installation files. Check your internet connection and try again.

vs2017_6

In this case try to open the following URL in a browser to be shure that no Firewall or contentfilter block your attempt (see step 2 for instructions when you see a blockpage):

https://aka.ms/vs/15/release/installer

6. Get ready for installing Visual Studio 2017 from your network

Now you can call the setup by console, Power Shell, System Center or what you want to call it on every computer, virtual machine and so on you want to install Visual Studio. Administrators can deploy Visual Studio onto client workstations as part of an installation script. Or, users who have administrator rights can run setup directly from the share to install Visual Studio on their machine.

    • Users can install by running:
      \\server\VS2017\vs_enterprise.exe
    • Administrators can install in an unattended mode by running:
      \\server\VS2017\vs_enterprise.exe --quiet --wait --norestart

Tip

When executed as part of a batch file, the --wait option ensures that the vs_enterprise.exe process waits until the installation is complete before it returns an exit code. This is useful if an enterprise administrator wants to perform further actions on a completed installation (for example, to apply a product key to a successful installation) but must wait for the installation to finish to handle the return code from that installation. If you do not use --wait, the vs_enterprise.exe process exits before the installation is complete and returns an inaccurate exit code that doesn’t represent the state of the install operation.

When you install from a layout, the content that is installed is acquired from the layout. However, if you select a component that is not in the layout, it will be acquired from the internet. If you want to prevent Visual Studio setup from downloading any content that is missing in your layout, use the --noWeb option. If --noWeb is used and the layout is missing any content that is selected to be installed, setup fails.

I hope this article will help all the DevOps guys out there to install their environment right. I had a lot of fun while writing and sharing this knowledge with you. Please feel free to contact me in the comments below if you have any further question.

Advertisements

2 thoughts on “No ISO, no cry – Visual Studio 2017 installation behind a proxy or firewall (HowTo)

    1. Hi Tim,
      I have often been ask for that. No, you don’t have to buy a license after the 30 days expired. Just create a Microsoft account and sign in with that one in Visual Studio 2017 Community edition. A short video of how you create a free account, watch this video:

      Hope this will help you. Have a nice weekend!

      Best regards
      Christian

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s