So, this is something that's been on my mind for a while now. How can you take a program, and make it 'auto-update'. So let's say an outer shell that checks Myserver.com/myProg/updates.xml (or some other resource) and checks to make sure version numbers are the same. Once I do that, how do I handle updating a program?
Let's say that my program was a simple main only class and the only output is:
System.out.println("Hello World"); On the update it turns into System.out.println("Hello Java");
How could I get this change into place at runtime?
Note: JNLP is not applicable for this, due to signing issues that I don't care to expand upon.
If JNLP is ruled out, I'd think only a solution using OSGI would achieve that. Otherwise, even at the very simplest design possible, you'll need another program to manage and download the versions of your current program.
You need 2 "applications":
The user always launches the bootstrap application, never the main application (in fact the user doesn't know about the bootstrap application). This is by far the most common pattern I've seen.
If you want to do auto-updates at runtime, you'll need to use OSGI as javabeats mentioned. But only take this path if you really need this. I've never used OSGI, but I can imagine that it's non-trivial.
I don't have a concrete example, but I can imagine that
Sorry, I can't give you a more detailed answer without writing the code myself, but I charge for that :).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With