I am trying to detect a users Steam games that are installed on their computer, I wish to be able to find the appropriate .exe for each installation and backtrack through the directory to get the full path.
I’ve realized that there are several different games that use the same name for the executable file (hl2.exe) but they are in different folders.
Obviously this means I can’t just search for a specific game .exe to get the directory needed because they are the same name, one idea I have thought of is to search for every mention of “hl2.exe” in the users computer and create a list of entries from that, it should in theory show the paths for each instance.
It’s a bit difficult to explain without showing you but surprisingly enough a search for “hl2.exe” with Windows 7 shows no results..
I’d like to keep the programming language used to C# if possible!
I don’t know if this is foolproof, but here’s a thought.
If you open Regedit and navigate to
Computer\HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall(if you have a 32-bit version of Windows, leave out theWow6432Nodepart of the path), you’ll find one “Steam App XXX” for each installed game, where XXX is the Steam ID of the game installed.Inside each, there’s a DisplayName that gives you the game name, as well as InstallLocation for the path.
On my machine I have the following: