CryoByte33 / steam-deck-utilities

A utility to improve performance and help manage storage on Steam Deck.
GNU General Public License v3.0
3.23k stars 81 forks source link

[Enhancement] remove vcredist from prefixes #132

Open markstinson opened 1 year ago

markstinson commented 1 year ago

vcredist bundled with games create a lot of accumulated wasted space. They are stored in each game's prefix directory. Not all games have them. In addition, folks will change the name of the SD Cards so their mount on /run/media/sd-card-name is not consistent.

Please implement a button press, cli command, and/or cronjob that will clean up remanent MS vcredist directories and their files.

Of course, there may need to be consideration for those using Lutris, Play on Linux, etc. where the user fetches specific DX redists for their games.

(deck@steamdeck common)$ pwd
/home/deck/.local/share/Steam/steamapps/common
(deck@steamdeck common)$ find . -type f -name "*vcredist*"
./Steamworks Shared/_CommonRedist/vcredist/2012/vcredist_x86.exe
./Steamworks Shared/_CommonRedist/vcredist/2012/vcredist_x64.exe
./Steamworks Shared/_CommonRedist/vcredist/2013/vcredist_x86.exe
./Steamworks Shared/_CommonRedist/vcredist/2013/vcredist_x64.exe
./Steamworks Shared/_CommonRedist/vcredist/2010/vcredist_x86.exe
./Steamworks Shared/_CommonRedist/vcredist/2010/vcredist_x64.exe
./Steamworks Shared/_CommonRedist/vcredist/2008/vcredist_x86.exe
./Steamworks Shared/_CommonRedist/vcredist/2008/vcredist_x64.exe
./Steamworks Shared/_CommonRedist/vcredist/2005/vcredist_x86.exe
./Steamworks Shared/_CommonRedist/vcredist/2005/vcredist_x64.exe
./Borderlands 2/Binaries/Redist/vcredist_x86_vs2010sp1.exe
./Borderlands 2/Binaries/Redist/vcredist_x86.exe
./Borderlands 2/Binaries/Redist/vcredist_2008_x86.exe
./Borderlands 2/Binaries/Redist/vcredist_2005_atl_x86.exe
./Borderlands 2/Binaries/Redist/vcredist_2005_x86.exe

(deck@steamdeck steamapps)$ pwd
/run/media/360gsd1/steamapps/common/
(deck@steamdeck steamapps)$ find . -type f -name "*vcredist*"
./Borderlands/Prerequisites/vcredist_x64.exe
./Borderlands/Prerequisites/vcredist_x86.exe
./Borderlands/EULA/vcredist_eula_eng.txt
./Borderlands/EULA/vcredist_eula_fra.txt
./Borderlands/EULA/vcredist_eula_ita.txt
./Borderlands/EULA/vcredist_eula_esp.txt
./Borderlands/EULA/vcredist_eula_deu.txt
./BorderlandsPreSequel/Binaries/Redist/vcredist_2005_x86.exe
./BorderlandsPreSequel/Binaries/Redist/vcredist_2005_atl_x86.exe
./BorderlandsPreSequel/Binaries/Redist/vcredist_x86_vs2010sp1.exe
./BorderlandsPreSequel/Binaries/Redist/vcredist_x86.exe
./BorderlandsPreSequel/Binaries/Redist/vcredist_2008_x86.exe
CryoByte33 commented 1 year ago

I don't really want to mess with things inside of prefixes, as that could cause unwanted breakages or re-downloads of similar assets later. In particular, this could cause a metered connection to churn through data quite a bit.

I'll contemplate this, but chances are low that I'll implement it. Thank you for opening the issue regardless!

markstinson commented 1 year ago

Sure. No worries. I figured it was the Windows complimentary to the proton_dist.tar. The proton_dist.tar is a safe, easy, guaranteed huge space saver. The space saved removing vcredist may not be as much, and being spread out, a bit more complicated to gather for removal.

And you're right.

I've personally removed them from Steam installs before without issue. But everyone's mileage varies.

If someone feels to need to remove vcredist (like myself), it could be done with a script. Just like if someone wants to personally remove LANG files from their game to save space -- it's not always text strings given their sound & image assets too.

This enhancement is definitely a backburner kind of thing for now, especially if maintaining a "best user experience" for steam-deck-utilities. Thanks for the review and consideration.

bvierra commented 1 year ago

I don't really want to mess with things inside of prefixes, as that could cause unwanted breakages or re-downloads

What about hard linking them to a single copy of each on the internal drive?

Steam actually recommends to use their "Common Redistributables" setting in steamworks now which all use a single download in the Steamworks Shared folder and not the install.vdf file (which required you to include the file). Many if not most developers have removed them... On my windows machine that has a few hundred games installed a total of 3 copies were found, 2 of those were from games, the 3rd being the Steamworks Shared.