Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find steam games folder [closed]

Tags:

vb.net

steam

How can I get to a Steam game folder without hardcoding it?

Instead of hardcoding C:\Steam\steamapps\common\<game_folder>\GameData in my code can I use something involving the steamappid of a game to obtain this information automatically?

like image 506
Thomsen1707 Avatar asked Dec 04 '15 14:12

Thomsen1707


1 Answers

In order to obtain a Steam games folder you have to follow this steps:

  1. find Steam installation folder
  2. check Steam acf files and libraryfolders.vdf

You can find Steam InstallPath in windows registry:

  • 32-bit: HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam
  • 64-bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Valve\Steam

You can read a Value from a Registry Key using this code:

Dim strSteamInstallPath as String = My.Computer.Registry.GetValue(
    "HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam", "InstallPath", Nothing)

MsgBox("The install path is " & strSteamInstallPath)

Once you have Steam main folder (the one containing steam.exe) you can read games installation folder from appmanifest_<steamappid>.acf files contained in \steamapps subfolder.

For example, appmanifest_2280.acf contains informations about Ultimate Doom.

You can search for a particular steamappid or analyze every files and get game name from name key.

Also check libraryfolders.vdf in \steamapps subfolder for other game installation folders.

For example I have some games in D:\mygames so my libraryfolders.vdf is:

"LibraryFolders"
{
    "TimeNextStatsReport"   "xxxxxxxxxxx"
    "ContentStatsID"        "xxxxxxxxxxx"
    "1"                     "D:\\mygames"
}

Once you have this alternative folder, check for acm files contained in \steamapps subfolder.

like image 86
tezzo Avatar answered Oct 20 '22 18:10

tezzo