Jump to content
  • Advertisement
Sign in to follow this  
wildboar

Game Autopatcher

This topic is 2646 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am working on a small game patcher/launcher and I am wondering if my current plan would work.
This is my first time coding something like this so I want to see that im on the right path.

The Plan:

Client.exe and Launcher.exe have version info inside them

Server refuses client with lesser version that required
Client also has a small check to make sure that launcher is ran first

Launcher gets every single file including inside subdirectories in the current working directory
Launcher makes checksum out of every single file
Sends encrypted string of checksums and filenames to server
server backend accepts, compares local server side client folder and sees what items it needs to send back to client

Launcher overwrites said files

Questions:
Launcher deletes files which no longer used??
Launcher updates itself? how??
What if user drags exe into other folder, will that force server to send entire client to user? this could be abused?

I hope someone can help me thanks :D

Share this post


Link to post
Share on other sites
Advertisement
Launcher deletes files which no longer used??

Yes. Shouldn't be a problem to delete the files.

Launcher updates itself? how??

Build the launcher so that it doesn't need to be updated. Why update the launcher? It should be kept pretty simple. If you have text data or image data you need to update in the launcher, then maybe it should be set up to just download and display that data inside the launcher without having to replace the actual executable. Even putting everything into a web page that you could update externally would help with that.

Worst case scenario, you have to update the launcher, then you could have the launcher check for newer versions of itself, and if there is a new version, it downloads it, installs the new version as something like "Launcher_new.exe" or something, and then runs that, and closes itself. When the "Launcher_new.exe" opens, it could then check for the old Launcher.exe file, delete it, and rename itself as Launcher.exe. I mean, technically you could do this directly with the game and not have a launcher at all, but if your game exe is large in file size, that might be an issue.

What if user drags exe into other folder, will that force server to send entire client to user? this could be abused?

I would imagine that yes, the server would send the entire client to the user. Could it be abused? I suppose... But really who is going to download the game over and over? You can't really do much about this... I see it as a non-issue. I suppose you could have the launcher check for the game across all of the drives on the computer... If it is really a concern. Then when it finds the file, it would alert the user that the game has moved location and then allow the user to update the game's directory to that? I dunno... I mean if someone wanted to download your game over and over as a form of abuse, they could do it regardless... By deleting everything and installing from scratch.

Share this post


Link to post
Share on other sites



Launcher deletes files which no longer used??


Launcher updates itself? how??


What if user drags exe into other folder, will that force server to send entire client to user? this could be abused?


1) Yes, it should do that. For a "thorough check" you could implement the server sending the list of all files, with a SHA checksum on each file, and then have the launcher remove each file that doesn't match, and re-get what's needed from the server.
2) The problem is that a running executable can't replace its own file. The client can download the latest version of the launcher and replace the launcher, once the launcher has quit. Another alternative is to download "launcher_new.exe" then start that, quit "launcher.exe," then have "launcher_new.exe" write the new "launcher.exe" file and start over.
3) Do you consider it "abuse" that people can download your game as many times as they want?

Share this post


Link to post
Share on other sites
Thanks for answers, I have 1 more question about deleting files.
What if the player places the Launcher.exe into another folder, that means that the server will think that all those files are wrong and delete them?
I have added a small check that checks if Client.exe is in same folder then begin patching process but I am worried that someone could figure that out too and if they place it in C drive for example and it deletes all the files there, that would be very bad.

I am not really sure how to handle this.

Share this post


Link to post
Share on other sites

What if the player places the Launcher.exe into another folder, that means that the server will think that all those files are wrong and delete them?


I am not really sure how to handle this.


[color=#1C2837]

I don't understand what your problem is?

[color=#1C2837]



[color=#1C2837]

Someone can also select all files in the directory and send them to the trash can. That will be faster than going the slow way of starting your launcher.
[color=#1C2837]



[color=#1C2837]

If you really care, then you can say that all game files (including Game.exe) live in a subdirectory named "mygameisamazing" inside the folder the Launcher.exe runs in, and Launcher.exe will only edit any files that live inside "mygameisamazing."
[color=#1C2837]



[color=#1C2837]

Someone could still put launcher.exe in C: and rename "Program Files" to "mygameisamazing" and screw themselves, but at some point, you can't prevent idiots from being idiotic :-)
[color=#1C2837]



[color=#1C2837]

Also, you can install launcher.exe into program files\mygame, but put all the patchable files in %APPDATA%\mygameisamazing (including game.exe) -- at that point, the user would have to open the registry and re-direct %APPDATA% to make your launcher find "unintended" files, and it would still have to be a directory called mygameisamazing.
[color=#1C2837]



[color=#1C2837]

Btw: putting patchable files in %APPDATA% is recommended by Microsoft to get around UAC and virtualization for Program Files. However, you are supposed to include a public key in the Program Files directory, and verify the signature of everything you download into %APPDATA% before you start Game.exe, so that users or "bad actors" can't subvert your launcher/patcher system to introduce their own, unsigned code.
[color=#1C2837]


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!