- Home /
How to make a game updater/launcher?
I'm making a 2d side scroller platform game and i was wondering.. as i'm probably going to release several versions of the game and/or fixed scripts i will need a launcher that detects if there's a new asset or a new script on the server or if there's a modified version of a script of the server(this could easily be done with checking upload dates right?) and after that starts downloading the files and putting them where they belon.
an example of this would be:
User starts game, launcher window pops up and prompts the user with a new update (can be an updated script,asset,file, rar, etc). User clicks update game button and the launcher connects to the server and retrieves the files. if file is a modified version of an existing one, the launcher goes to it's directory and overwrite the file with the newer version. after that i believe that the launcher would have to rebuild the game.
How do one achieves succesfully that series of requirements? i guess this should be easy as it is just download and overwriting if existing or putting new file where it belongs.
i haven't done any code for that part yet as i just started the project and i'm in the designing phase so don't ask me to see what i've tried. i ask this because i know i lack the required knowledge to complete that task even though i haven't started development.
Answer by HappyMoo · Jan 04, 2014 at 11:52 AM
The Problem is if you do the checks from the game.exe, you can't overwrite that exe, because it's locked. If you have a separate launcher, it can update the game, but not the launcher itself.
So you would need to develop an application outside the game, which means you have to make yourself sure it works on all your platforms etc.
Check out this simple open source Autoupdater as an inspiration: http://gc.codehum.com/p/sharpdate/
Ok thanks for the link i will take a look at it, but that leaves me wondering. How does people update their games in unity if the game.exe isn't overwritable? and we all know that waiting for the launcher app to download the entire game again and again even if is small is just a bad user experience.
If your game finds a new update is up, it cans start the updater and stop itself The updater then starts the download an by the time it has the data, the game is stopped.
Also, you can get as complex as you want with the data you send over... you could create a diff and just send the bytes that changed from version to version
btw: the exe file never needs to be "updated" unless you (the developer) have updated your Unity version. The exe is just a player. All your actual game data (including compiled mono assemblies which contains your script code) are located in the data folder. That's true at least for standalone builds which i guess you talk about. Other platforms work differently (web, android, iOS)
Thanks bunny, that will probably help me. i'll think about something to modify the data in the data folder and update the game.
Your answer
![](https://koobas.hobune.stream/wayback/20220613125509im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Sending an RPC 1 Answer
Unity Networking - Error on spawning Player 0 Answers
Networking - Serving multiple instances of a scene. 0 Answers