It is very easy to forget that many people have development environments that do not have internet access. In this day and age, it’s easy to install frameworks and IDE’s from the web. Recently I wanted to start using Visual Studio 2017 for a project. My environment is completely isolated from the internet, and getting access is not feasible. So how was I going to get Visual Studio 2017 from the internet to a computer with no internet access? In the past this was easy, just download an iso and either burn it to a disc or just copy and mount the iso. With Visual Studio 2017 Professional edition’s total download size is 27.1 GB.
However, Microsoft does not provide this as a single download. How did I get it?
Step 1: Start with a Windows computer that does have internet access
On this machine head to the Visual Studio download page. Download the version of Visual Studio that you are going to use. (Note: These instructions are for Visual Studio, not Visual Studio Code)
Step 2: Create a folder to hold all of the downloaded files
I created c:vs2017. You can make any folder anywhere you can write.
Step 3: Run the following command
vs_professional.exe --layout "c:vs2017" --lang en-US
It will take a while, but all of the files will download to the destination directory.
Step 4: Copy the folder to a media to connect to the offline computer
I’ll leave this up to you to figure out.
Step 5: Install the certificates that are in the folder that you just copied over
If you do not install the certificates and just try to run the installer, you will be given the following error screen:
Option A: Install certificates using certmgr.exe
Run the following commands to install the certificates. Obviously, modify paths as necessary to equal your environment.
certmgr.exe -add -c z:vs2017certificatesmanifestSignCertificates.p12 -n "Microsoft Code Signing PCA" -s -r LocalMachine CA certmgr.exe -add -c z:vs2017certificatesmanifestSignCertificates.p12 -n "Microsoft Root Certificate Authority" -s -r LocalMachine root certmgr.exe -add -c z:vs2017certificatesmanifestCounterSignCertificates.p12 -n "Microsoft Time-Stamp PCA" -s -r LocalMachine CA certmgr.exe -add -c z:vs2017certificatesmanifestCounterSignCertificates.p12 -n "Microsoft Root Certificate Authority" -s -r LocalMachine root certmgr.exe -add -c z:vs2017certificatesvs_installer_opc.SignCertificates.p12 -n "Microsoft Code Signing PCA" -s -r LocalMachine CA certmgr.exe -add -c z:vs2017certificatesvs_installer_opc.SignCertificates.p12 -n "Microsoft Root Certificate Authority" -s -r LocalMachine root
If you do not have certmgr.exe you can download the Windows 10 SDK ISO file from here: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
When you have installed the SDK the certmgr.exe file can be found at C:Program Files (x86)Windows Kits10binx86certmgr.exe
Option B: Install certificates using certmgr.msc
Right click on Trusted Root Certificate Authority, choose All Tasks, and then Import.
Browse for one of the certificates that are in the certificates folder in the offline install directory
Select next again, don’t change anything
Choose Next one more time
Select OK and repeat for all 3 certificates
Step 6: Install Visual Studio as you would expect to
Now you can go to the vs2017 folder (or whatever you named it) and run the vs_professional executable. Of course, if you downloaded enterprise or community, your executable will be named that. From there you will be able to install Visual Studio offline.
As a note, all of these screenshots were taken in a VM using VMWare Fusion, but the Windows 10 VM had no network card connected, and was never connected to the internet. This should have successfully simulated a completely offline development environment.
Create a network-based installation of Visual Studio. (2017). Docs.microsoft.com. Retrieved 26 May 2017, from https://docs.microsoft.com/en-us/visualstudio/install/create-a-network-installation-of-visual-studio
Special considerations for installing Visual Studio in an offline environment. (2017). Docs.microsoft.com. Retrieved 26 May 2017, from https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio-in-offline-environment