Install visual studio 2022 offline on windows 10.

Create Offline Install Pack

bootstrapper download

Here I choose community edition, enough for using.

vs_community.exe

create a local layout

although microsoft have server in China, but optional add proxy in cmd:

set HTTP_PROXY=http://proxy_userid:proxy_password@proxy_ip:proxy_port

Open a powershell prompt with administrator privileges, navigate to the directory where you downloaded the bootstrapper.

Only the working environment of C++ and C# is installed here.

1
2
3
4
5
6
C:\Users\frederick\Downloads\vs_Community.exe `
--layout c:\localVSlayout `
--add Microsoft.VisualStudio.Workload.NativeDesktop `
--add Microsoft.VisualStudio.Workload.ManagedDesktop `
--includeRecommended `
--lang en-US

The detailed workload component id is mentioned here

To create a complete local layout, English only, with all features (this will take a long time—we have lots of features!), run:

1
2
3
vs_enterprise.exe `
--layout c:\localVSlayout `
--lang en-US

Install Visual Studio from the local layout

When you install Visual Studio from a local layout, the Visual Studio installer uses the local versions of the files. But, if you select components during installation that aren’t in the layout, then the Visual Studio installer will attempt to download them from the internet. To make sure that you install only the files that you’ve previously downloaded, use the same command-line options that you used to create the local layout. To make sure your installer doesn’t try to access the internet when it’s installing the product, use the --noweb switch.

1
2
3
4
5
C:\localVSlayout\vs_Community.exe `
--noweb `
--add Microsoft.VisualStudio.Workload.NativeDesktop `
--add Microsoft.VisualStudio.Workload.ManagedDesktop `
--includeRecommended

I prefer default settings.

When Installer Complete, need a system reboot.

Use command-line parameters to install Visual Studio

Visual Studio 2022 Release History