Codeusa / SteamCleaner

:us: A PC utility for restoring disk space from various game clients like Origin, Steam, Uplay, Battle.net, GoG and Nexon :us:
https://andrew.im/
GNU General Public License v3.0
1.97k stars 96 forks source link

Battlenet cleanup #26

Closed stephen-moyer closed 8 years ago

stephen-moyer commented 8 years ago

Looking at the old code it looks like it just looked for paths that start with \u0021 or \u001F then trimmed that first character and used that as the directory. I replaced this with just one regex that should work.

I tested this against my product.db and it was able to read the same paths as the last one. I just don't have any cached files or something because there's only the C:/ProgramData/Battle.net/Agent and C:/Program Files (x86)/Battle.net paths.

andrewmd5 commented 8 years ago

So this actually makes paths like Hearthstone not be detected, the product.db has malformed paths, some start with ! or other strangers chars, because I don't know what database format the db is, im stripping all the unreadable content and attempting to detect valid paths.

.product.zip

I've attached my product.db for you

stephen-moyer commented 8 years ago

I had it detecting all those paths, but I don't think the old one was so I removed it, plus it was picking up the game executables. Are the installer packages supposed to be in the games directory?

andrewmd5 commented 8 years ago

They should be, however Battle.net is a lot better about cleaning up left over files. On occasion if the client exits before a complete install, they can be left over.