Looking for a quick way of listing all currently installed steam games in c#. I've been using a method of checking the registry at the moment for installed apps, but if the user has their steam games on another hard drive and has swapped it into the machine then they won't be in the registry right?
So Looking for a way. Has anyone got any experience with the SteamAPI to point me in the right way if there is anything in there at all? Or any experience with this sort of thing?
Any help is appreciated.
Thanks.
If you already know the SteamApps directory, you can look at each appmanifest_1010.acf files in that directory. The numbers are the game's appid, and the file contains information about that game including its name and install path.
Related
I am currently working on a basic chatroom system for my college using text files, allowing everyone to save chatrooms in their area and share them with others. For this to work I need to get the actual directory of each users file on the server and not their local (relative) directory.
My college has a layout of each users E:\ drive being equal to \ServerName\Student\ (StudentNameHere)\
and in the past I have just been using .Replace("E:\","\\ServerName\Student\"+Enviroment.Username +"\")
But upon finding out that my college has different locations such as instead of Student lets say Student1, it makes my code more prone to breaking.
I have tried using
Path.GetFullPath(<File in this Users Directory>);
But it's only returned the path relative to users directory and not to the server, I don't know the type of link they used, but I thought symbolic would be good practice, tho trying this same command again on my own pc which I know has junction links for visual studio source/repos, didn't mention it's true (absolute) path either, any help on this would be much appreciated as this will fix a lot of bugs in my code and hopefully be a clean way to fix it all up as well, Thank You.
Thanks To #KevinGosse (https://stackoverflow.com/users/869621/kevin-gosse)
The problem I was having was Server Based and the link you commented did help, Thank You
I couldn't test this until today because I needed server access but it works like a charm, Thank You.
How do I determine a mapped drive's actual path?
I know this question has been asked lots of times but mostly I couldnt find the answer I was looking for.
How do popular applications update themselfs ?
I found some libraries that update applications but mostly they just replace all the application files. This way my Updater would need to download around 200mb everytime.
Also ClickOnce is used a lot but this in my oppinion is an ugly way to update and install because the GUI is not really fancy and you can't even specify where to install the application.
I know some applications also replace the installer and just run the new one to deinstall the old version and install the new one but that cant be that right way...
So how do Programs like Mobirise, Discord or Teamspeak update themselfs ?
I have a have made a POS Solution(C#), working in 4 Shops.
This is what i've done to give client side updates.
Used Google Drive to upload installer file + a text file mentioning installer version, once uploaded each time the programe starts up it downloads the version text file from Google Drive, if it doesn't match the current version of the software which the clients Has, Messagebox Prompts a newer version is avaliable. Client then can click Upgrade and it will download the installer file, once downloaded software exits completely calling a python script which will Run the installer file.
This is not the best way but it works, becouse Google Drive has its own file version history which makes it easy for me to keep track of updates i send.
Hope I Helped <3
You can design the application to be patchable.
Patching is not a hot flavour in windows world.
I work for an IT company where we all carry around flash drives that have our most used programs on them.In my spare time I am hoping to create a "main menu" item that is kind of a fun and convenient way to access these files. I am working on creating this using Visual Studio 2013 and using visual C# windows forms. I have come across a snag however that I can't seem to find a workaround for. I am by no means fluent in C#, but I need to have a button on the windows form open a file without specifying what drive it comes from. I understand that I have to specify a path, but as these will be stored on the flash drives of myself and my coworkers I cannot foresee that the path will always begin with E:. Depending on what USB slot the drive is plugged into it could be N: or F: or the like. I have provided an example below:
Using what I currently know I am opening files using this line of code:
System.Diagnostics.Process.Start("C:/Users/Myname/Desktop/Asmodeus/Anti-Virus/Anti-Virus Installers/avast_free_antivirus_setup.exe");
Is there any way possible I can have the file open simply from
System.Diagnostics.Process.Start("Asmodeus/Anti-Virus/Anti-Virus Installers/avast_free_antivirus_setup.exe");
or something of that nature?
Thanks in advance.
There must have been some mis-communication when I asked my question previously. what I am looking to do is open an executable file via a button click on the windows form using a relative path. I am not able to specify the absolute path because the application will be run from a flash drive and therefore will change depending on what USB slot it is currently inserted into.
What I am hoping to accomplish is insert a line of code that will allow me to open an executable file that is located in the \bin\debug folder along with the application itself. I have a picture for clarification but apparently do not have enough reputation to post it. Thank you and sorry for the earlier confusion.
Usually you can just use Environment.GetFolderPath (MSDN) to give you what you need. It doesn't do absolutely everything, but if you need Desktop and the like, that is plenty.
Depending on the target version of .Net, the SpecialFolders exposed are not all there. It may turn out that you need more than they provide, but in your case it doesn't sound like it.
If there is more you need that is not covered in the default, check out this project. I'm sure there are others like it, but it does a little more than the default BCL version, using the API directly. It is at least something to read and learn (and translate from vb.. use an online translator, very quick). I haven't looked at it, but it seems like you are learning this c#/.net thingy, so it might be helpful
This article is about accessing Windows special folders.
These folders include your “Favorites”, “Cookies”, system libraries and the like.
Here is code, including a large number of constant definitions, plus documentation,
allowing access to and creation of these folders.
So, I want to create a simple launcher for a game that I'm making for Windows. I want to write it on Visual Studio so it can do the following:
Launch the game wherever the .exe file is. (either via registry key or by the user selecting the destination)
Auto-install all the needed dependences for the game if they are missing or provide a link to install them.
Verify intergrity of the files.
Auto download the latest patch or take the user to the patch download site (optional).
In addition of these, I need some help on the following:
Assuming that I can set it up to download the patch, how can I deliver it? I'm not sure that the program can download files from SkyDrive can it?
How do I set it up as a 32-bit program? I have a 64-bit system here.
Is it possible to write a Metro version of the launcher using the same code?
Please note that the game will be in a "installable format". I'll be using Install Creator for this.
Thanks for any help in advance.
I've written a similar software before for a game, that did almost the same things as you described. Given that you have not shown any code, I'll answer the 3 questions in a general, basic way.
1.) Depends on what you mean by patch. An installer that supposed to replace or extend existing files, delete old files, deploy new ones? In that case it's up to the installer to manage it. If a patch simply downloads a file and puts it in the right place you can download it from either Skydrive (DriveOne) or any other place. Check out the API and the examples here.
2.) I'm not sure I understand this question, but I think you just want to compile your binary to 32bit in visual studio and that's it.
3.) Yes.
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 the Wow6432Node part 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:
Steam App 40100 - Supreme Commander 2
Steam App 41500 - Torchlight
Steam App 630 - Alien Swarm
Steam App 8980 - Borderlands
If you want to do it the way Valve does, you will need code to read Steam's clientregistry.blob binary data file.
There is some floating around out there in C# (largely from sites where people are trying to pirate games.) I made a Java version for an SDK-tool project.
That will have the information you need about what games the user "owns", as well as some data about file paths.
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