I'm working on a self-updating application that checks for updates at app startup. I've got the version checking and download of new .jars from the server working. How do I tell my app to restart itself?
I'm working on a self-updating application that checks for updates at app startup. I've got the version checking and download of new .jars from the server working. How do I tell my app to restart itself?
But you are re-inventing WebStart! I have great difficulty in believing that your home-grown probably buggy WebStart is more acceptable than the Sun/Oracle WebStart. In your position, I would go back to whoever has made the decision not to use WebStart and tell them that the decision makes no sense.
P.S. Use a boot-strapping application that downloads the upgrade if it exists prior to running the main application.
Glen Divers
Ranch Hand
Joined: Jan 21, 2010
Posts: 61
posted
0
While I cannot find anything in your argument to disagree with, sometimes the real world can prove to be capricious. In this particular instance, the client, who are paying, have stipulated no Web-Start. The ability to remonstrate lies several pay grades upward - and, regrettably, that puts me in the hands of "Sales".
Regards
alex delaguardia
Greenhorn
Joined: Sep 07, 2004
Posts: 5
posted
0
See if this helps:
1- Run you application using a command file.
Inside your command file put something like this.
:restart
JRE\jre1.6.0_07\bin\java -cp .;.\program_name.jar
if exist fileName GOTO restart
before you exit you program for restarting write a file ("fileName") to the system.
Basically as long as the fileName exits the program will restart again. (you will need to remove the file after the application start).
Ah well... let's take the passive-aggressive method then. Just call System.exit(0) after the application has been running for a minute; and have a script which calls the application again as soon as it terminates.
Gilbert Ostlethwaite wrote:I'm working on a self-updating application that checks for updates at app startup. I've got the version checking and download of new .jars from the server working. How do I tell my app to restart itself?
Actually, what I just posted doesn't really make sense in the context of actually having read the original post.
If you're checking for updates at the time the application starts up, I don't see why you need to tell the application to restart itself at all. Wouldn't you just check for new versions, download them if present, and then start the application? If you're tasked with reinventing Web Start, then that's what Web Start does so that's what you should do.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.