Visual Studio脱机安装删除旧版本 [英] Visual Studio offline installation remove old versions
问题描述
是否可以从Visual Studio 2017脱机安装的布局文件夹中删除旧版本的安装程序包?此文件夹在我的HDD上需要大量内存.
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
,这是一个示例:
You can also invoke vs_enterprise.exe
inside the <layoutDir>.
Here's an example:
c:\VS2017Layout\vs_enterprise.exe --layout c:\VS2017Layout --clean c:\VS2017Layout\Archive\1cd70189-fc55-4583-8ad8-a2711e928325\Catalog.json --clean c:\VS2017Layout\Archive\d420889f-6aad-4ba4-99e4-ed7833795a10\Catalog.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屋!