tags:

views:

57

answers:

2

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!

+1  A: 

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 (I'm on 64-bit Windows 7, and I have no idea how that Wow6432Node figures into it), then 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:

Steam App 40100 - Supreme Commander 2
Steam App 41500 - Torchlight
Steam App 630   - Alien Swarm
Steam App 8980  - Borderlands
Lasse V. Karlsen
Seems to work for me! All 4 of my installed Steam games are there. Torchlight's fun.
Rei Miyasaka
Will be more fun next year when they add multiplayer :)
Lasse V. Karlsen
Unfortunately, there's no executable link in that uninstall location, so you might not get exactly what you need.
Lasse V. Karlsen
Hmm, I cant seem to find any entries for it. Strange.
Jamie Keeling
A: 

As another angle of attack what about piggy-backing the windows games folder? as far as i know all steam games are automatically added to the windows games folder, you can find a list of all games and their launch executables in the regestry under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\GameUX

If you look under

c:\users\<username>\appdata\local\Microsoft\windows\game explorer 

you might find info on users statistics

GreyCloud