Visual Studio 离线安装删除旧版本 [英] Visual Studio offline installation remove old versions

查看:15
本文介绍了Visual Studio 离线安装删除旧版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能从Visual Studio 2017离线安装的layout文件夹中删除旧版本的安装包?这个文件夹在我的硬盘上需要很多内存.

Is there a possibility to remove the old versions of installation packages from the layout folder of Visual Studio 2017 offline installation? This folder needs a lot of memory on my HDD.

推荐答案

您可以使用新的 --clean 选项.您需要文件路径来编目包含那些过时包的清单.您可以在离线布局缓存的 Archive 文件夹中找到目录清单.

You can use the new --clean option. You'll need the file path(s) to catalog manifest(s) that contain those obsolete packages. You can find the catalog manifests in an Archive folder in the offline layout cache.

当您更新布局时,它们会保存在那里.在存档"文件夹中,有一个或多个以 GUID 命名的文件夹,每个文件夹都包含一个过时的目录清单.GUID 文件夹的数量应与离线缓存更新的数量相同.

They are saved there when you update a layout. In the "Archive" folder, there is one or more GUID named folders, each of which contains an obsolete catalog manifest. The number of GUID folders should be the same as the number of updates made to your offline cache.

每个 GUID 文件夹中保存了一些文件.最感兴趣的两个文件是 catalog.json 文件和 version.txt 文件.catalog.json 文件是您需要传递给 --clean 选项的过时目录清单.version.txt 文件包含此过时目录清单的版本.根据版本号,您可以决定是否要从此目录清单中删除过时的软件包.您可以像浏览其他 GUID 文件夹一样执行相同的操作.在您决定要清理的目录后,通过提供这些目录的文件路径来运行 --clean 命令.

A few files are saved inside each GUID folder. The two files of most interest are a catalog.json file and a version.txt file. The catalog.json file is the obsolete catalog manifest you'll need to pass to the --clean option. The version.txt file contains the version of this obsolete catalog manifest. Based on the version number, you can decide whether you want to remove obsolete packages from this catalog manifest. You can do the same as you go through the other GUID folders. After you make the decision on the catalog(s) you want to clean, run the --clean command by supplying the files paths to these catalogs.

例子:

vs_enterprise.exe --layout <layoutDir> --clean <file-path-of-catalog1> <file-path-of-catalog2> … 

vs_enterprise.exe --layout <layoutDir> --clean <file-path-of-catalog1> --clean <file-path-of-catalog2> … 

您还可以在 <layoutDir> 中调用 vs_enterprise.exe. 下面是一个示例:

c:VS2017Layoutvs_enterprise.exe --layout c:VS2017Layout --clean c:VS2017LayoutArchive1cd70189-fc55-4583-8ad8-a2711e928325Catalog.json --clean c:VS2017LayoutArchived420889f-6aad-4ba4-99e4-ed7833795a10Catalog.json 

当您执行此命令时,安装程​​序会分析您的脱机缓存文件夹以查找将删除的文件列表.然后,您将有机会查看将要删除的文件并确认删除.

When you execute this command, Setup analyzes your offline cache folder to find the list of files that it will remove. You will then have a chance to review the files that are going to be deleted and confirm the deletions.

这篇关于Visual Studio 离线安装删除旧版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆