Skip to content

Repository files navigation

SteamGamesCleaner — Depot Diff & Cleaner

Displays diff between local game files and Steam depot file list (from SteamDB), and lets you delete extra files per-file to Recycle Bin.

Tested with D:\Games\Assassin's Creed (AppID 15100) — correctly identifies mod extras: scripts/*, dinput8.dll, imgui.ini, REXAGAMES.COM.url, testapp.exe.

How it works

  1. Scan Local: recursively enumerates Game Folder (relative \ paths, case-insensitive, like Sak32009 PathHelper.NormalizeKey).
  2. Fetch Depot:
    • Primary (no ownership needed): embedded WebView2 (Edge) to https://steamdb.info/app/{AppID}/depots/ and /depot/{DepotId}/. You solve Cloudflare captcha manually if prompted, then click Extract Depots / Extract Files or Auto Fetch All. JS mirrors Sak32009/GetDataFromSteam-SteamDB:
      • Depots: tr[data-depotid] + td[data-sort] + OS detection (Windows/macOS/Linux/all).
      • Files: #files.tab-pane .table.depot-files DataTable().data() fallback to plain tbody tr parsing, hash truncated first10***last10 handling (HashService.HashMatches).
    • Fallback: Import manifest (hash *path text, *.manifest, DepotDownloader -manifest-only output, or Sak32009 export). Also Load/Save cache (%AppData%\SteamGamesCleaner\cache\{AppID}.json, 3-day expiry).
    • Advanced: bundle DepotDownloader (SteamKit2) for owned games: DepotDownloader.exe -app X -manifest-only -username ... then import manifest.
  3. Compare: DiffService (ce.withSteamDB logic) → Extra (local only), Missing (depot only), Modified (hash mismatch), OK. Merge across selected depots (default Windows/all). Path separator se/oe normalized.
  4. Hash: optional streaming SHA1 (HashService.ComputeSHA1Async) with progress, truncated-hash support. Without hashes, diff is filename+size; with hashes, exact/partial match.
  5. Delete: checkbox per row (Extra pre-checked) → RecycleService (Microsoft.VisualBasic.FileIO.FileSystem.DeleteFile(..., RecycleOption.SendToRecycleBin)), confirm dialog, bulk delete with log, empty dirs not removed automatically (safe).

Usage — Any AppID

  1. Run publish\SteamGamesCleaner.exe (or bin\Release\net8.0-windows\SteamGamesCleaner.exe). Requires Edge WebView2 Runtime (preinstalled on Win11).
  2. Enter AppID (e.g. 15100) and Game Folder (Browse…).
  3. Click Scan Local.
  4. In left browser, wait for https://steamdb.info/app/15100/depots/ to load. If Just a moment appears, solve captcha, wait for table.
  5. Click Extract Depots → depots appear in list (check desired OS, e.g. Windows).
  6. Either:
    • Visit each depot (https://steamdb.info/depot/{id}/) and click Extract Files, or click Auto Fetch All (iterates checked depots automatically).
    • Or Import manifest if you have a .manifest file (from ManifestAutoUpdate etc).
  7. Click Compare (build diff). Filter via Filter + Search.
  8. Optional: Compute SHA1 for Extra/Mismatch (slow for large .forge files) for hash verification.
  9. Check files to remove, Delete Selected → Recycle Bin (restorable).

Cloudflare & SteamDB notes

  • SteamDB blocks direct HttpClient (403 verified). This app uses user-initiated WebView2 so you solve captcha once — no auto-bypass, respects steamdb.info/faq no-scraping rule.
  • Some depots show File names are encrypted / No files → SteamDB bot doesn't own that depot (needs donation/key since 2022 manifest request codes). Use Import manifest workaround.
  • Depot file hashes are truncated 10+10 in HTML; the app correctly matches startsWith/endsWith like Sak32009.

Build

dotnet build SteamGamesCleaner.csproj -c Release
dotnet publish SteamGamesCleaner.csproj -c Release -r win-x64 --self-contained false

Requires .NET 8 SDK and Microsoft.Web.WebView2 NuGet (already restored).

Project layout

  • Models/DepotFile.cs — DepotFile, DepotInfo, DiffRow
  • Services/PathHelper.cs — oe/se normalization
  • Services/LocalEnumerator.cs, HashService.cs, DiffService.cs, CacheService.cs, RecycleService.cs
  • Services/SteamDbExtractor.cs — JS JsExtractDepots/JsExtractFiles
  • MainWindow.xaml / MainWindow.xaml.cs — UI + orchestration

Safety

  • Defaults to Recycle Bin, never permanent unless Shift+Delete is added (not enabled).
  • Extra only pre-checked; Missing/OK rows not selected.
  • Confirm dialog shows count + size + 12 sample paths.

License

MIT (Sak32009 logic ported per MIT).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages