Visual Studio freelance installation removes old versions

Is it possible to remove old versions of installation packages from the layout folder of the standalone installation of Visual Studio 2017? This folder needs a lot of memory on my hard drive.

+8
visual-studio visual-studio-2017
source share
3 answers

I created a small utility application to delete old version folders from the stand-alone Visual Studio 2017 setup.

You can download the source from GitHub at https://github.com/deepak-rathi/VS2017OfflineSetupUtility

Or

Run the executable file VS2017OfflineSetupUtility.exe from the Release folder

https://github.com/deepak-rathi/VS2017OfflineSetupUtility/tree/master/VS2017OfflineSetupUtility/bin/Release

+7
source share

After performing layout updates in the stand-alone cache, the layout of the cache folder may have some outdated packages that are no longer needed after the last installation of Visual Studio. You can use the --clean option to remove obsolete packages from the offline cache folder.

Microsft docs: how to remove old versions from layout

+6
source share

You can use the new option --clean . You will need the file paths to the directory manifests that contain these legacy packages. You can find the directory in the Archive folder in an offline layout.

They are saved there when you update the layout. The Archive folder contains one or more folders with the name GUID , each of which contains an outdated directory manifest. The number of GUID folders must match the number of updates made to the offline cache.

Multiple files are saved in each GUID folder. Of greatest interest are the two catalog.json and version.txt files. The catalog.json file is an obsolete catalog manifest that you need to pass to the --clean option. Another version.txt file contains a version of this deprecated 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 in other GUID folders. After deciding on the directories you want to clear, run the --clean command, specifying the file paths to these directories.

Examples:

 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> … 

You can also call vs_enterprise.exe inside <layoutDir>. 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 executing this command, the installation program analyzes your offline cache folder to find a list of files that it will delete. After that, you will have the opportunity to view the files that will be deleted and confirm the deletion.

+5
source share

All Articles