VS can also be quickly installed like this

Preface

Record the things that bring newcomers, mainly sharing some work skills

Department boss: Yuan, there will be a few interns and new recruits coming to the job tomorrow, you are responsible for bringing them

Yuan: tomorrow? Oh, yes, by the way: men and women?

Department boss: Girl, I haven't graduated yet, so take it with you.

Yuan: Okay, no problem, leave it to me (happy.jpg)

The next day came. . .

Skip unnecessary trivial matters, and came to the department boss to greet them and arrange their seats. In this way, they were arranged next to me, (excited.jpg) Pressing the restless heart patiently, said hello, Ask them to sit down. The boss introduced a few words to the new little sister. This is your brother Yuan. From now on, he will take the two of you. You can ask him if you don’t understand. The boss will pay you back when he goes back. He patted the shoulder and said something, take them well. Replied, eh.

After they were seated, let them get acquainted with the workstations, and then arranged tasks for them. First, check if there is a VS tool on the computer assigned by the company at their workstations. Install one first, and then give them Tell me something... After the two sisters listened, they answered.

Time goes and goes. . .

After a while, a girl (referred to as A here) said: How to choose a few of them?

I looked at it and said: emm, this, this, and this, and this, and so on, and this one, emm, it's almost done, let's change the installation path, um, that's it, click install , Just let it install.

The other little sister next to me also lay down and took a look. After watching my operation, she returned to her seat and installed the software.

The work of this day continues.

And when I think back to when I installed the software for them, I thought it would be a bit troublesome to tell them to install those components every time. If there is any way to directly click to run, it will automatically check the corresponding components for you. It is much easier to complete the installation by pressing the key.

So, this is my start.

explore

After searching for information, I found that it was introduced in the official documentation of installing vs2019 that you can install Visual Studio through command line parameters, use various command lines to control or customize the installation, you can pre-select the installation of predetermined options, and automatic Installation process. The command line options are used in conjunction with the installation boot program, which is a small (1 MB) file that initiates the download process. The installation bootloader is the first executable file you start when you download it from the Visual Studio website.

In the follow-up search, it was found that the aspnetcore source code compiled and generated source code document pointed out that the requirements for building asp.net core on the window:

  1. Windows 10 version 1803 or higher.

  2. At least 10 GB of disk space and a good Internet connection (our build script downloaded a lot of tools and dependencies)

In installing Visual Studio 2019, to install the exact components required, you can run eng/scripts/InstallVisualStudio.ps1.

PS> ./eng/scripts/InstallVisualStudio.ps1

Any instance of Visual Studio 2019 that meets the requirements will do. For these requirements, see global.json and eng / scripts / vs.json. By default, the script will install Visual Studio Enterprise Edition, but you can -Editionuse other versions by passing the flag.

{
    "channelUri": "https://aka.ms/vs/16/release/channel",
    "channelId": "VisualStudio.16.Release",
    "includeRecommended": false,
    "addProductLang": [
        "en-US"
    ],
    "add": [
        "Microsoft.Net.Component.4.6.1.TargetingPack",
        "Microsoft.Net.Component.4.6.2.TargetingPack",
        "Microsoft.Net.Component.4.7.1.TargetingPack",
        "Microsoft.Net.Component.4.7.2.SDK",
        "Microsoft.Net.Component.4.7.2.TargetingPack",
        "Microsoft.Net.Component.4.7.TargetingPack",
        "Microsoft.VisualStudio.Component.Azure.Storage.Emulator",
        "Microsoft.VisualStudio.Component.VC.ATL",
        "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
        "Microsoft.VisualStudio.Component.Windows10SDK.17134",
        "Microsoft.VisualStudio.Workload.ManagedDesktop",
        "Microsoft.VisualStudio.Workload.NativeDesktop",
        "Microsoft.VisualStudio.Workload.NetCoreTools",
        "Microsoft.VisualStudio.Workload.NetWeb",
        "Microsoft.VisualStudio.Workload.VisualStudioExtension"
    ]
}

operating

Check InstallVisualStudio.ps1, this is a Powershell script installed by Visual Studio. It is very powerful. It will open the Visual Studio Installer and check all the options that need to be installed to run the source code. And you can choose the version to install, we can run it first to try the effect.

Enter the first part of the file name: InstallVisu , then press tab, it will automatically complete the file name, and then enter some parameters;

The -edition parameter indicates the version of VS, the default is the enterprise version, the enterprise version does not need to add this parameter. But if you are the communiy , Professional edition, you need to add this parameter.

.\InstallVisualStudio.ps1 -Edition Professional

After executing the script:

After a while, the Visual Studio Installer will pop up:

Click Continue, some dependencies will be downloaded and installed:

Then the following window for selecting components to install will appear, and the components that need to be installed are automatically checked:

At this time, you only need to click the install button to install it. Just close it after installation. The advantage of this is that you do not need to manually install the required components one by one, and there will be no errors.

to sum up

  1. After a period of exploration, I finally found the way I wanted. Run the command directly, load the installed components on demand, and complete the installation with one click, which is convenient and quick.

  2. After installing vs, we can directly choose to install it in this way, hahaha, I am too lazy to install .jpg.

Reference materials:

  1. Visual Studio 2019 documentation

  2. Aspnetcore source code compilation instructions

Guess you like

Origin blog.csdn.net/sD7O95O/article/details/108891538