如何下载Visual Studio 2019离线安装程序

22

我打算在我的电脑上安装Visual Studio 2019社区版(最新版本)。我在Google上找到了一个在线安装程序的链接(大小为1376 KB)。我想要下载Visual Studio 2019社区版的离线安装程序。请分享给我离线安装程序的下载链接。


1
没有现成的离线安装程序。请查看创建 Visual Studio 的离线安装方式以了解如何创建自己的镜像。 - dxiv
我已经查看了上述链接,但是在下载后如何将缓存文件从一台电脑复制到另一台电脑呢? - Accessories
你只需要使用--layout指定目录并执行xcopy命令,参见将布局复制到网络共享 - dxiv
@dxiv - 是的...我的问题是引导程序(在线安装程序)未经签名,被我的系统上的AV和GPO阻止了...这是微软的常规“改进”。 - AcePL
据我所知,https://learn.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019 上的安装程序已进行代码签名。 - dxiv
1个回答

36

微软不再提供像Visual Studio的.ISO镜像文件这样的离线安装程序 -- 而是让您自己创建离线安装程序,具体方法请参考说明。您需要使用--layout命令行参数,然后运行下载的安装程序。

  1. 下载并缓存离线文件:

vs_community.exe --layout f:\vslayout.2019 --lang en-US
  • 从缓存目录运行

  • f:
    cd \vslayout.2019
    vs_community.exe --noWeb
    

    注意: 将驱动器F更改为与您的系统上具有约35 GB可用空间的驱动器相匹配的驱动器,以供 MSVC 2019 使用。请参阅命令行参数的说明,选择仅 C++、.NET 等选项。

    您可以通过以下方式获取安装程序的命令行参数帮助:

    vs_community --help
    

    相关的布局命令如下:

    command-line option     Description
    --layout <dir>          Specifies a directory to create an offline install cache.
    --lang <locales>        Used with --layout to prepare an offline install cache with resource packages with the specified language(s). See a full list of supported language-locales below.
    --add <workload>        One or more workload or component IDs to add. The required components of the artifact are installed, but not the recommended or optional components. You can control additional components globally using --includeRecommended and/or --includeOptional. For finer-grained control, you can append ;includeRecommended or ;includeOptional to the ID (for example, --add Workload1;includeRecommended or --add Workload2;includeOptional).
                            Note: If --add is used, only the specified workloads and components and their dependencies are downloaded. If --add is not specified, all workloads and components are downloaded to the layout.
    --includeRecommended    Includes the recommended components for any workloads that are installed, but not the optional components. The workloads are specified either with --allWorkloads or --add.
    --includeOptional       Includes the recommended and optional components for any workloads being included in the layout. The workloads are specified with --add.
    --keepLayoutVersion     Apply changes to the layout without updating the version of the layout.
    --verify                Verify the contents of a layout. Any corrupt or missing files are listed.
    --fix                   Verify the contents of a layout. If any files are found to be corrupt or missing, they are redownloaded. Internet access is required to fix a layout.
    --clean <paths to catalogs>
    

    1
    vs_community.exe在哪里?我该如何下载它? - dangalg
    “Instructions”页面有链接。 - Michaelangel007
    vs_community.exe --layout f:\vslayout.2019 --lang en-US 可以正常工作,而 vs_community.exe --layout f:\vslayout.2019 --lang en-US 则不能。 - Khalid Bin Sarower
    1
    @dangalg 我在“说明”页面上也找不到 vs_community.exe。但是,修改那里的链接似乎可以解决问题:https://aka.ms/vs/16/release/vs_community.exe - Adam Henderson

    网页内容由stack overflow 提供, 点击上面的
    可以查看英文原文,
    原文链接