Launcher / Updater

We're using jME to develop a game. That game requires that everyone have the same version when playing against each other. Updates can be made to the game at any point. What I'm wondering is how to best approach that.

My idea was to have a Launcher app that goes and checks to see if the copy it has is the same as what's on the website, if not, then it updates the necessary components before launching the game. Much like WoW or Steam games.

What I don't know is how to do this at all. I can probably make a program that can check and update the application, but I have no idea how to run it automatically after it's done. Or even if it's run by clicking the "ready" button when everything checks out.

The thing is when I build this main app, it's a jar file in the end.

Examples would be nice, I think I just need a smack in the head and a push in the right direction and I can take it from there. But I just can't seem to get started with this launcher for some reason.

Well i'm currently for the moment not useinga ny jar files at all, but it should work if the stuff is in differnet jar field, you just have to provide the needed classpath as far as i know. Thoretically the normal Webstart should also be able to only update changed jar files, however only the complete jar file, so one material change means you need to redownload all. Of course there is an exception, that is when you sue a java based webserver, some are ablet o create patches for the diferent versions on the fly.

Hmmm, simple JNLP launchers will check to make sure they are using the most recent JAR files and automatically download them for you; perhaps you could just use that…

I had the same problem just recently, here is my solution (not perfectly object oriantated, but works), only disadvantage is, that you need to modify it a bit to work with every system.

File scripFile = new File(installationfolder+ "/data/start.bat");
           ProcessBuilder processBuilder = new ProcessBuilder(scripFile.getAbsolutePath());
      catch (Exception e) {
         // TODO Auto-generated catch block
      try {
      } catch (InterruptedException e) {
         // TODO Auto-generated catch block

Needs a switch for the sciptfile, operation system based,
however the advantage is, that you do not have to bear with any problem that could be related to a webstart.

If you want to take a look at the complete Autoupdater, just pm me.

I didn't know if jpln did that or not. But I have more than just a jar file. I have a directory with textures and models, and another for the jme library itself and others. Would it do that too? Or would I have to make the whole thing a jar file? I thought JME didn't work if the engine files were in a jar file.

The game itself isn't that big, a meg or two, but the resources could easily be 100 megs. I don't want i to download the whole thing each time.