Download the offline version of VS Visual Studio and download the specified version

1. Download the boot program first

Download address VS VisualStudio official website

Insert image description here
Scroll to the bottom of this page

Insert image description here
Download the required version here Download the bootloader

Insert image description here

2. Download the offline installation package
and write a batch file (vs.bat)
with the following command format:

<vs引导程序exe> --layout <离线安装包下载的路径> --add <功能模块> --lang <语言> 

If you need to download all of them, the command is as follows (it is generally not recommended to download all of them)

call vs_enterprise__1552103481.1603088960.exe --layout  C:\Install\vs2019  --lang zh-CN

Insert image description here
All the code in vs.bat is as follows:

echo off & color 0A
call vs_community__b84c1eec11664c178b16813665a3a09a.exe --layout C:\Install\vs2019 --lang zh-CN 
echo. & pause

Among them, vs_community__b84c1eec11664c178b16813665a3a09a.exe is the downloaded boot version.
C:\Install\vs2019 is the path that needs to be downloaded.

Then double-click to execute the script to download.

You can also choose the modules you want to download, such as .NET web and .NET desktop development. The instructions are as follows:

vs_progfessional.exe --layout C:\Install\vs2019 --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --add Component.GitHub.VisualStudio --includeOptional --lang zh-CN

Among them, vs_progfessional.exe is the name of the boot program. If it has a subsequent number, change it to the numbered vs_progfessional_xxxxxx.exe.

C:\Install\vs2019 is the location of the downloaded installation package. It can be changed to a non-c drive. Because the download generally takes a long time and takes up a lot of space, the c drive may be stuck.

Microsoft.VisualStudio.Workload.ManagedDesktop is the module to be downloaded

–lang zh-CN means the language is Chinese. If you want other languages, you can check the corresponding language on the official website.

If you don’t know which module you want to use, you can only download them all. The instructions are as follows: vs_progfessional.exe --layout C:\Install\vs2019 --lang zh-CN

After running this command, the download progress bar will pop up, increasing by 0.01% little by little, very slowly... The final download is as follows: (more than dozens of gigabytes)

The following is the download effect.
Insert image description here
Except for the following two, all are downloaded by script
Insert image description here
. 3.
Copy all packages to the intranet or computer to be installed, run vs_setup.exe, the location can be changed to a non-C drive location, select "All Download and then install", and then you can install it.
Insert image description here
5. After installation, sometimes you need to configure header files such as pthread.h, and you need to download pthread-xxxx.zip (I downloaded pthreads-w32-2-9-1- release, which can be found in many places), contains three folders, of which Pre-built.2 needs to be transplanted.

   5.1 将include下的三个头文件复制到vx安装路径的 \Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include 下

   5.2 将lib下的x64文件复制到vs安装路径的 \Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\lib\x64下; 将lib下的x86文件复制到vs安装路径的 \Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\lib\x86下

 5.3 将dll下的x64文件复制到C:\Windows\System32目录下;将dll下的x86文件复制到C:\Windows\SysWOW64目录下
  1. At this point, everything that needs to be copied and installed has been installed. There is still a compilation problem: timespec and struct type redefinition errors. The solution is as follows:

    In the pthread.h header file

    #if !defined( PTHREAD_H )

    #define PTHREAD_H

    Add below

    #define HAVE_STRUCT_TIMESPEC

Guess you like

Origin blog.csdn.net/qq_42817360/article/details/132037681