I am wondering about that for a while now for my current project. I want to easily distribute the game to friends. I have the server+bandwith but not the tools. Is there really no established way?It's about time somebody wrote something. Maybe I will provide mine if I can come up with something useful.

Each version will require a version.txt file or something similar which contains the version number.

The patcher downloads the current version.txt from the server and compares the version numbers.

If they are different (or the client-side version is corrupt (not a number) or missing) then it downloads the new game files.

To download the files from the internet, you use create a URL and use url.openStream() as the input stream, and the output stream is just a file.

Then, you need to use ProcessBuilder.

You set the directory to the folder that the game jar is in.You set the application to "java", the commands to "-jar Game.jar"Then you execute the processbuilder (which launches the game) and exit the launcher.

(if you use the err/out streams then you may need to handle those from the launcher)

One should use GetDown for patching n stuff. Things that can be tricky are: to have write access in the folder, because its usually in a protected area. Also if you just have one jar you couldn't replace the self jar while its running n stuff.

I personally dont use it YET, is simply because of server cost - you would have to have stable server with enough traffic bandwidth and so on.

I've been working on making my own GameUpdater libraries and I started with C# because it looked easier to me. I just finished and am now going to make one in Java (mainly because C# apparently isn't easily multi-platform, if it wasn't I would just use the C# one). The source may help you if you'd like to make your own. I'll update this post with my Java one when I finish that, but for now I will just have my C# one posted.

EDIT: I finally finished the Java version. I stayed up way later than I normally do because I forgot to add 1 to Calendar's month lol. I'll add a README to the repository tomorrow because I'm too tired right now. This is a library, by the way, so if you want to use this as your library, go ahead. Do you think it should go into tools or something? I would be amazed if this was good enough for that (though it is incredibly basic). It requires Java 7 as Java 7 added really helpful file functions. That shouldn't be too much of a problem however. If you use it as a library, be sure to use it in a separate JAR than your game JAR, so that it can update your game JAR. It can't update itself (I assume that would cause an error but I never tried that). It wouldn't be too troubling to have (for an example I'm using my game PixelZombies as the title) PixelZombiesLauncher.JAR and PixelZombies.JAR. Likely you could put PixelZombies.JAR in a folder so that noobs don't see it and click on it (though that wouldn't be the end of the world if they did). I'll say most of this in the README I make tomorrow but it will be in more depth, so stay tuned for that.

Both READMEs are now high quality. I'm pretty proud of the libraries, I think they could be used for game launchers pretty easily. If you'd like to get information on either one of my two libraries, click on the link and the README is quite massive for both.

EDIT: As I saw your (StonePickaxes) post request a progress bar, I am implementing a progress bar, although it's just via the console. To make it work nicely, you could write a batch script that users click on so that they can see the progress on the cmd screen. It's done on the Java version now I believe and I will now work to put it in the C# version.

EDIT2: I have now finished adding the printing of progress. I think I'll make a topic for these two libraries in a few hours, since I see them as good enough to do so.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org