Scott Hanselman

How to make an offline installer for VS2017

February 08, 2017 Comment on this post [25] Posted in VS2017
Sponsored By

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.

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.

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.

  • 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.
  • 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
  • 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.
    • Here is a list of all the Component IDs you can choose from.
    • 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

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

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.

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.

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.

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

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.

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!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
February 14, 2017 4:53
@Scott thanks for mentioning that. BTW you need to fix the "Components IDs" link
February 14, 2017 4:55
Fixed, thanks!
February 14, 2017 9:28
"These could be used to great USB sticks or DVDs" - should that's be "create"? :P
February 14, 2017 10:15
Thanks Scott. Do you know how to make an offline installer for offline help?
February 14, 2017 12:00
I think the link for download you provided points to Visual Studio 2015. It should be for Visual Studio 2017 RC, https://www.visualstudio.com/vs/visual-studio-2017-rc/, this one
February 14, 2017 17:04
Is it possible to share downloaded version.
February 14, 2017 18:53
Thanks a lot Scott. Just to add, you actually visited one of the most connected countries in Africa. It took me over four days to get my VS 2015 SP3 up and running.

Will definitely share this insightful blog.
February 14, 2017 22:24
Good tip, Scott - I did this for the first RC (worked great) and for the updates too. Just worth noting 1) you can stop & restart the download and it resumes where interrupted, 2) downloading the whole thing was a LOT of downloading - somewhere around 15GB, IIRC...
February 15, 2017 1:40
Thanks. I've been doing this since the first 2017 drop. Didn't know about the component ids so that's really helpful. One thing I've noticed is that, I think when doing the update of the layout, you end up with old versions of downloaded packages, eg the Android sdk, hanging around in the layout folder. Any way to clean them up safely?
February 15, 2017 1:44
I've done this quite a few times for various flavours of VS2015 and updates and the layout update in place is a messy broken thing. Unless it's been much enhanced in 2017 I'd favour ignoring it and doing a fresh copy. Also when creating the install package it's usually better to use the ISOs because some of the package downloads can fail silently, especially on fuzzy enterprise networks.

Losing the ISO for 2017 is a terrible situation and I'm getting a headache just thinking about trying to get pulling hundreds of packaged executables being pull through signed off by IT Security.

It's funny how MS has embraced open source and open tooling delivery while seemingly ignoring enterprise (or maybe pushing on them to adapt, they won't they'll just stick on the old version till forced to move ala XP).

Also creating layouts for patches seems dependant on what direction the wind is blowing, I think 2015 Update 3 took about 4 tries to download everything correctly and only way to verify was reading through the logs. Also that one needed a random Windows KB update on Windows 7 which was extra fun.

It would be great if there was a way of verifying an already created layout. Is there any way?

Note you can also throw in VSIX installs on these to save more setup or bandwidth (or when all executable downloads are blocked by "the-big-bad" firewall).
February 15, 2017 4:26
It doesn't work, as soon as I run it I get the visual studio screen saying this setup support the following switches
February 15, 2017 10:27
The --layout (or /layout) switch is becoming more common as more installers use the WiX 'Burn' bootstrapper, which is nice.
February 15, 2017 14:24
Validation of a layout would be handy. I had a blocking issue late last year with the 2017 installer where it had started an MSI (maybe it was a VSIX?) download but failed. It then cached it in C:\programdata\Microsoft\VisualStudio\Packages as a 0kb file. So I kept fixing my layout, and even just trying to install with no layout, but the cached file kept being used. It took a while to diagnose but once I overwrite that 0kb file with a full one from a fixed layout I could repair :) Without that I couldn't uninstall or reinstall.

So validation would be awesome.
February 16, 2017 14:59
This was an interesting Blog whis is very useful to Everyone and do visit our page given below

happy women's day quotes


happy women's day images
February 17, 2017 7:23
Thanks for sharing this.

Would be super nice if there was a Bootstrap-style installer config like this: http://getbootstrap.com/customize/

Joe
February 18, 2017 16:26
Hello, heard about this on TWC9 this will help when the release is next month at the school i work at :)
February 22, 2017 6:49
Thanx, glad it happened to you. lol. But please tell the ms guys up there we need an iso without this hack. even this method still needs a steady internet connection. What we need is the iso and we use our download manager, you can skip the android part and let that run as an online installer or update as it is in 2015.
February 25, 2017 16:10
I did this, the files and folders where created. THen when I enter on the new folder and run vs_Community.exe it tries to download again;
February 25, 2017 17:59
Maybe there could be a checkbox/button Save Offline in the GUI to do all this for us.
March 07, 2017 21:18
It would be great if ONCE Microsoft dev team made things easy.
No option to install to another drive than the system drive.
Bunch of SDKs and other stuff default to C: drive.
March 08, 2017 2:20
Glad to see we've gone back to DOS days! Legal reasons, what legal reasons?, VS2015, downloaded the necessary components automatically from the web when needed! This is so f**king an*l!!! I will wait until SP1 as this will be bug ridden anyway as usual!
March 08, 2017 11:05
That's a very good trick to work offline!!
March 09, 2017 8:52
Apologies for this somewhat negative comment, but the offline installation option for Visual Studio 2017 is completely useless. Once the layout has been created, if you disconnect from internet Visual Studio installation will not 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. You’d think this would have been tested before the release. I’m sitting behind firewall without internet connection and can’t install VS2017. This very sad and annoying.

I have created a StackOverflow and would appreciate any help: http://stackoverflow.com/questions/42685569/visual-studio-2017-enterprise-offline-installation-fails

Cheers
Ershad
March 09, 2017 21:22
Thanks, Scott!!! This helped ALOT!!!!!
March 10, 2017 17:43
Awesome.
Just used this on a cloud VM.
Now I need to figure out how to get the cloud bits down to me. Normally I use dropbox or google drive but there might not be enough space to take the entire installation.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.