Visualstudio-docs: I found the proper way to do this

Created on 31 Jul 2018  Â·  8Comments  Â·  Source: MicrosoftDocs/visualstudio-docs

Article is a bit off. Here's what I discovered: use the ;includeRecommended suffix on each workload add, then do an --add for each optional component of that workload. That's the only way I was able to get both recommended and optional components of each workload.

So for Step 2 above in the first example, it should really be:

vs_community.exe --layout c:vs2017layout --add Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended --add Microsoft.VisualStudio.Workload.NetWeb;includeRecommended --add Component.Dotfuscator --add Component.GitHub.VisualStudio --add Component.Microsoft.VisualStudio.RazorExtension --add Component.WebSocket --add Microsoft.Net.Component.4.6.2.SDK --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.Component.4.7.1.SDK --add Microsoft.Net.Component.4.7.1.TargetingPack --add Microsoft.Net.Component.4.7.SDK --add Microsoft.Net.Component.4.7.TargetingPack --add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.DeveloperTools --add Microsoft.Net.Core.Component.SDK --add Microsoft.Net.Core.Component.SDK.1x --add Microsoft.NetCore.1x.ComponentGroup.Web --add Microsoft.NetCore.ComponentGroup.DevelopmentTools --add Microsoft.VisualStudio.Component.Common.Azure.Tools --add Microsoft.VisualStudio.Component.DockerTools --add Microsoft.VisualStudio.Component.DockerTools.BuildTools --add Microsoft.VisualStudio.Component.IISExpress --add Microsoft.VisualStudio.Component.JavaScript.Diagnostics --add Microsoft.VisualStudio.Component.JavaScript.TypeScript --add Microsoft.VisualStudio.Component.LinqToSql --add Microsoft.VisualStudio.Component.NuGet --add Microsoft.VisualStudio.Component.SQL.ADAL --add Microsoft.VisualStudio.Component.SQL.CMDUtils --add Microsoft.VisualStudio.Component.SQL.DataSources --add Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime --add Microsoft.VisualStudio.Component.SQL.NCLI --add Microsoft.VisualStudio.Component.SQL.SSDT --add Microsoft.VisualStudio.Component.TypeScript.2.8 --add Microsoft.VisualStudio.Component.Wcf.Tooling --add Microsoft.VisualStudio.Component.Web --add Microsoft.VisualStudio.Component.WebDeploy --add Microsoft.VisualStudio.ComponentGroup.IISDevelopment --add Microsoft.VisualStudio.ComponentGroup.Web --add Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions --add Microsoft.VisualStudio.Web.Mvc4.ComponentGroup

That's quite a pain, but it works.

So now in Step 3 all you need is...

vs_setup.exe --passive

That's it. Run the above from the cache location you created (eg: c:vs2017layout). You could put the whole cache folder on a flash drive, network share, or whatever. Adding the --passive ensures no further UI interaction is required to install exactly what you cached in Step 2.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

doc-bug

All 8 comments

Note: in the above example I removed FSharp from optional...

Microsoft.VisualStudio.Component.FSharp
Microsoft.VisualStudio.Component.FSharp.Desktop

Since I didn't want it in my deployment. Forgot to re-add for my post above.

@ciphernemo Thanks for the feedback. I'll add this to our backlog for consideration.

@ciphernemo Great man!! Thank you very much!! Regards!

it does NOT work (see around on the web).

I DID use the FULL installation, but no luck. (an many more combinations).

The solution does NOT work for vs 2017 installer. I DID followed all guidelines but no luck.
installer always wants to connect to download I got:

"attempting to download https://aka.ms/vs/15/release/installer/"

I succeded in installing vs2107 standalone in windows 7 after installing .net 4.6, but NO LUCK on windows server 2012 / 2016

ingconti, if you're getting "attempting to download", then you missed something in my example.

Make sure you run the vs_setup.exe with --passive or --quiet, but more importantly make sure you run it from the newly created vs2017layout folder. Do not run the same vs executable that you used to download the layout.

I confirmed this works just fine with Visual Studio 2017 Professional. I did not test with Community, but should be the same. I even added to an MDT deployment and it works without any network connection on a new system.

recap:

  • I downloaded from scratch.
  • I tried FULL install, too (53 GB..)

If installer tries to connect to the MS site, is a bug, I think.. :)

If you perform exactly what I have, it will work. I did not test the "FULL" install. You obviously are using different syntax since you're doing a full install.

Also, testing with just one package is the quickest way to confirm this works. When connected to the Internet, try...

vs_community.exe --layout c:\vs2017layout --add Microsoft.VisualStudio.Workload.NetWeb

Let that process complete. Then disconnect your network and from the C:vs2017layout folder run...

vs_setup.exe --passive

That should work fine. Then you can test by adding more packages, or even all packages as desired.

finely I did succeed.
Anyway for "future memory":

1) suggestion using "passive" works fine in windows 2012/2016 server
2) does not work in windows 7 64 workstation
3) Microsoft official docs is wrong... as does not say about passive
4) fro MFC (what i needed..) remember to add:
--add Microsoft.VisualStudio.Component.VC.ATLMFC
5) even if I specified --addProductLang en-US , I can see a LOT of folders whose name end: "language=fr-FR" .. "anguage=cs-CZ" and so on.

Anyway thx, "ciphernemo"

Was this page helpful?
0 / 5 - 0 ratings