19

I am trying to download Build Tools for Visual Studio 2019 from https://visualstudio.microsoft.com/downloads/ But when I click on download button, system downloads an exe which tries to connect to internet to download rest of the package.

How can I just get offline version of Build Tools for Visual Studio 2019 or Build Tools for Visual Studio 2017.

SharpCoder
  • 18,279
  • 43
  • 153
  • 249
  • 1
    `it downloads Visual Studio 2019 community edition` - do you think that because of the generic "Thank you for downloading Visual Studio" message? The file that is downloaded is named `vs_buildtools__1021818695.1449586970.exe` which looks legit to me. – GSerg Jan 22 '20 at 22:16
  • 1
    @GSerg : its ans online installer (about 1.3 MB). I need a offline installer. Updated the question. – SharpCoder Jan 22 '20 at 22:23
  • Haven't tried it, but [this](https://learn.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019) may work with it too. – GSerg Jan 22 '20 at 22:26
  • Like @GSerg wrote, you should create an offline installer by using the cache functionality Microsoft describes in the article. I did this for VS2017 and it was a bit tedious, but it worked for me. – Max Play Jan 22 '20 at 22:54

1 Answers1

24

How can I just get offline version of Build Tools for Visual Studio 2019 or Build Tools for Visual Studio 2017.

Firstly, thanks to GSerg and Max for sharing the useful info.

Before creating an offline package for Build Tool for VS2019(it is the same theory as the Visual Studio), you also need an environment with a network to download the corresponding workload in advance according to your needs , and then pack it into an offline package so that you can install the offline package in other non-network environments.

This method can only pre-select and download the related workload to install and then package it for others to install. So when creating an offline package, it's best to download all the workload, after that, you do not worry about the lack of workload which you need.

Please follow these steps:

1) download the exe file of build tool for VS2019

2) enter CMD and cd into the exe file path

3) input these:

vs_buildtools_xxxxx.exe --add Microsoft.VisualStudio.Workload.MSBuildTools --layout c:\offlineBuildTool --lang en-us

Microsoft.VisualStudio.Workload.MSBuildTools is a "wrapper" Workload ID and more ID you can refer to this.

Besides, you can see this document about the other available switches.

c:\offlineBuildTool is just the path of the offline installer for Build Tool for VS2019.

Or to install all the workloads, you can use this command:

vs_buildtools_xxxxx.exe  --layout c:\offlineBuildTool --lang en-us

4) then you can move the OfflineBuildTool package into other environment with no network and run the buildtool.exe which is in the folder.

In addition, you can see this thread for more info.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41
  • after bring `C:\offlineBuildTool\` to the no-internet-server, when I run the command, I got stuck at the Visual Studio Installer Downloading screen, do you have any idea? https://imgur.com/M2RkgU5 – Luke Jun 02 '21 at 03:25
  • fixed myself and contribute answer – Luke Jun 02 '21 at 04:05
  • @Luke how did you fix, im getting same as the screenshot you attached ? – Asad Blum Jun 06 '21 at 11:53
  • 2
    @AsadBlum : after copied, install all certs in `offlineBuildTools\certificates` to `Local Machine`, then open an `Administrator Powershell` in `offlineBuildTools` and run `vs_BuildTools_xxxxxx.exe --noweb` – Luke Jun 07 '21 at 16:36
  • I tried this approach, during the last step, I am getting an error saying that the following required packages are missing from the local cache. The list of packages is too long. Any thoughts, I tried `.exe --layout fix` also, but still the same error. – kbvishnu Apr 26 '23 at 22:45