visual-studio-2017installationofflinevisual-studio-2019

Creating offline installer for Visual Studio, includeRecommended/includeOptional switches doesn't work


Using Create an offline installer for Visual Studio 2017, Use command-line parameters to install Visual Studio 2017 and Visual Studio Enterprise 2017 component directory I tired to create offline installer for Visual Studio 2017, Enterprise, first time I used following:

vs_enterprise.exe --layout --lang en-US --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetCrossPlat Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.WebCrossPlat Microsoft.VisualStudio.Workload.Node and its worked and I could install VS successfully.

After that I tired to update created files and add Recommended/Optional Components to some workloads, so I followed mentioned article, article says by adding --includeRecommended (also --includeOptional) switch, installer will download Recommended (Optional) components too. so I added (for ex.) --includeRecommended switch like this:

vs_enterprise.exe --layout --lang en-US --includeRecommended --includeOptional --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetCrossPlat Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.WebCrossPlat Microsoft.VisualStudio.Workload.Node, and doesn't work (the second cmd (that shows download progress) closed immediately), in summary, I tired following commands too, and non of them doesn't work neither:

Also I tired in new (empty) folder, but no success.

I googled, but I found nothing, only some example that already exists in http://learn.microsoft.com.

How should I use includeRecommended/includeOptional switches?


Solution

  • Update (2021-11-10)

    Following solution works perfectly for Visual Studio 2022

    Update

    Here is the list of all available workloads (linked to their details) and usage sample:

    Create an offline installer: Documentation for VS2019 / Documentation For VS2022

    1. Download the Visual Studio bootstrapper (e.g: vs_enterprise.exe)
    2. Create a local install cache
    1. Double click on vs_enterprise.exe to install Visual Studio from the local cache

    If you want to update prev. created local cache, run vs_enterprise.exe --layout d:\whatever


    Original Answer:

    The installer had a bug about this issue & as the team said, the bug fixed in v15.1 (release date: 4/6/2017).

    I could download Microsoft.VisualStudio.Workload.NetWeb workload with following command successfully. (1.79GB)

    vs_enterprise.exe --layout --lang en-US --add Microsoft.VisualStudio.Workload.NetWeb --includeRecommended --includeOptional