30 March 2013

How To: Create an offline installer for Visual Studio from a Web Installer

Synopsis

If you have the need to download the complete set of files for a given Visual Studio update so that you can burn them to media or place them on an internal network share for distribution, you can run the Visual Studio 2012 installation bootstrapper with the /layout switch to force it to download all of the update packages and place them on your drive in a folder of your choosing.

   1:  "VS2012.2 CTP.exe" /layout
 

You can now use that installation folder’s contents as the source for your upgrades. Please realize that you will need a couple of GBs of space to save the installation.  The complete download for VS 2012.2 CTP 4 comes in at 1.66GB.


 tl;dr

Problem

The current VS Updates use a small installation “bootstrapper” that figures out what you have installed (Pro vs. Premium vs. Ultimate) and then does an install-time download of the needed updates. As you can see in Figure 1, the update installer is only 1.3MB in size so it downloads fast and your installation can begin immediately.  You will also notice that there is no option to download the entire update for all Visual Studio versions as a single MSI or ISO file.

SNAGHTML3ca3dd

Figure 1: Downloads page from Visual Studio 2012 Update 2 CTP 4 ds page - http://www.microsoft.com/en-us/download/details.aspx?id=36833 

When you run this installer you will see that the installation take a while to start.  It will eventually get to the “Install” screen.  There is a “More Information” link that changes the display to show you all of the packages that will be downloaded and installed for your particular installation.  As you can see in Figure 2, updating my Visual Studio 2012 Ultimate installation will cause the installer to download an additional 775MB of data during the install.  If I had Visual Studio Premium the download would be smaller and if I had Visual Studio Pro, it would be even smaller yet. So the architecture of a small bootstrapper that figures out and downloads only the needed updates is a good one to reduce overall bandwidth, especially in bandwidth constrained environments or countries.

But what if you have to do this to multiple machines?  You are now performing the same download over and over again.  The time-to-download tax is being paid by everyone on the team. Another scenarios is that you might be working in a highly-secure environment and your development machine doesn’t have access to the internet. In this case you absolutely have to get the update from an internet-connected machine and then place it somewhere it can be accessed by the secure PCs (or burn it to disk).

SNAGHTML4fe466

Figure 2: The additional downloads needed to update VS 2012 Ultimate Update 1 to VS 2012 Ultimate Update 2 CTP 4

 

Solution

To allow for this scenario, Microsoft has added a command-line switch option to the installation bootstrapper executable. You can use the /layout parameter to force the installer to download all of the update packages to specified folder.

SNAGHTML664b92

Figure 3: Command-line parameters for VS installs - http://msdn.microsoft.com/en-us/library/e2h7fzkw.aspx

When you run the installer with the /layout option, the installer will display a dialog that allows you to select the download location.

SNAGHTML6b9290

Figure 4: Using the /layout option to have the installer prompt for a download location

Clicking the Download button on the installer dialog will start the download.  As you can see in Figure 5, the download pulls all of the packages and stores them in a Packages folder under the folder you specified.  You can also see that it is complete download of all languages.  I am downloading from a machines whose locale is set to en-us but Figure 5 is showing that it is downloading the “Entity Framework Designer for Visual Studio 2012 – JPN”.

SNAGHTML709b95[4]

Figure 5: Downloading installation packages.

When it finishes you will se the “Setup Complete” message. 

Notice that in Figure 2, Visual Studio was telling me that it needed to download an additional 775MB of installation packages to update my machine.  In Figure 6 you can see that using the /layout option actually cause Visual Studio to download 1.66GB of packages. 

SNAGHTML82906e

Figure 6: Download complete. Requires 1.66GB for VS 2012.2 CTP 4

So regardless of whether the machine you are using has VS Ultimate, Premium, Pro or nothing at all, the /layout switch will pull down all of the packages that would be shipped as an .ISO or .MSI. That will allow you to do this process once and be able to update any Visual Studio installation across your company, even localized versions.

Summary

To create a stand-alone, offline installer for Visual Studio or it’s updates from a Web Installer, you can use the /layout command-line option.  This will download all of the installation packages that Microsoft provides for all versions and languages of Visual Studio. This download can then be burned to disk, copied to USB or copied to a network share for distribution.

Using the bootstrapper alone will significantly save on bandwidth since it will determine your VS version and language so that it only downloads those updated packages that you truly need for your installation.

Technorati Tags: ,,,,,,

3 comments:

Abhilash said...

But the profile with /layout switch is you cannot pause the download :( What about that?

Anonymous said...

Nice post, very useful.
Thanks

Lloyd

Steven St Jean said...

Hi Abhilash,

you are correct that the /layout switch doesn't allow you to pause the download.

I haven't checked, but I wonder if you start a download that is interrupted can you start another download that uses the same folder as the first and get the downloader to skip the already downloaded packages?

I should probably check that out and see. :)

- Steve

Post a Comment