.exe launcher

Hi Guys,

I have been wanting to implement a simple .exe launcher for my jME application - since end users seem to be more comfortable with a .exe file, since “they feel familiar with it”, even if it is just a wrapper, and also because I would like to incorporate version updating / downloading and authentication.

I have seen that MineCraft provides such a launcher, I lately noticed that @pspeed also uses a similar scheme in his tests / Mythruna.

Now my question is, are these files simply .bat like wrappers calling the main class through a console command, or is there more I can / should put into such a file. Such as configuration / downloading missing libraries / validation. The Minecraft launcher seems to be handle versioning / downloads and authentication, though I am unsure exactly where the .exe stops and the .jar takes over.

Specifically I am looking for key-words / resources / opinions for further research into the topic.

So far I have these resources:
http://winrun4j.sourceforge.net/ - I am not sure if replacing javaw.exe is a bit overkill?
http://www.codeproject.com/Articles/115090/EXE-Launcher-for-Java-Desktop-Application

look at launch4j I used it for one of my projects, worked fine for me.

1 Like

You can also just use the MonkeyPlatform

3 Likes

Thanks both of you. launch4j has an impresse feature list, I will be checking that out. And thanks benkibitzer, never noticed the auto-generation function in the SDK, seems that is what pspeed was using, judging by the output - loving this project more and more.

Does anyone have any opinions about how updates should be distributed from server to clients? Should I simply implement a separate java application that runs before my game, checking the current client against the newest on the server, then downloads or cancels and proceeds to shutdown, allowing the game to launch?

This is thinking quite far ahead, as I am not ready to really distribute anything, but it has been on my mind for a while.

What the minecraft launcher does is start a new process when the user is successfully authenticated. The minecraft launcher is a separate program from the actual game code, which is downloaded to a different location. See here on how to run a jar file from within java code: http://stackoverflow.com/questions/1320476/execute-another-jar-in-a-java-program

Minecraft has a very complex authentication system, which really is not necessary unless you have a very popular game and have a lot of time to do something like that. I can try to explain it if you need me to.

Checking for updates isn’t too complicated. You can keep a file on a web server (with domain) with only one line, the latest version of the game. In the launcher, get the file (see this: http://stackoverflow.com/questions/1485708/how-do-i-do-a-http-get-in-java ) and compare it to what version is on the users computer. If they do not match, download the update from a constant web location which will always have the latest version of the game.

HeroDex uses getDown for updates, launch4j to wrap getDown in an exe. (It doesn’t use the SDK wrapper but internally the SDK actually uses launch4j).

It works well, although there are a few annoying limitations in getDown (such as that you can’t install to a “restricted” area such as program files…You need to install to user data folders as otherwise it hits windows access control and can’t cope.

actually if you name your exe setup.exe windows automagically does a uac dialog as far as i remember.

The problem is that getdown writes to the local directory every time - even if no update is needed.

That means you always need to run with admin privs… with an annoying and scary popup each time.