Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

automatically updating application

 
Jack Donahey
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I'm developing application that has to automatically update.
Now it works as a windows service (using prunsrv http://commons.apache.org/daemon/procrun.html )
I'm wondering if you have any ideas that will help

the plan is much about:
1. application downloads update package
2. application runs update package and ends itself
3. update package do update (java classes or maybe a script ? )
4. update package ends and starts application (starts windows service)

using java during update is easy/comfortable ? or maybe some kind of scripts? BeanShell? (i don't want to learn a new scripting language - i don't have a time for this )
are there any advantages of using scripting languages? (over plain java)
 
Winston Gutkowski
Bartender
Pie
Posts: 10527
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jack Donahey wrote:I'm developing application that has to automatically update.

I'm afraid that covers a multitude of sins. If it's for a desktop system, the easiest is to just wrap the jar in an installer (there are plenty out there), have a notification system for new releases or bug-fixes, and let the user do it themselves.

I'm certainly no expert on this, but I suspect that true real-time auto-updating might be a very tricky business, so before you embark on such a project, I'd ask yourself whether you really need it .

Winston
 
Jack Donahey
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well...thanks for help

it was quite easy.
downloading package (zip), unpacking, setting up variables for package (like paths), launching updater
updater move/copy/delete files, makes backup, updates properties and launches application (windows service) at the end
 
Winston Gutkowski
Bartender
Pie
Posts: 10527
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jack Donahey wrote:it was quite easy.
downloading package (zip), unpacking, setting up variables for package (like paths), launching updater
updater move/copy/delete files, makes backup, updates properties and launches application (windows service) at the end

So, basically a manual update...yes?

Winston
 
Jack Donahey
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no, fully automatic.

application checks for update, downloads package, unpacks itp and then launches it.
 
Winston Gutkowski
Bartender
Pie
Posts: 10527
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jack Donahey wrote:application checks for update, downloads package, unpacks itp and then launches it.

And presumably it then also takes care of any existing running threads. So, does it:
(a) restart them all?
(b) inform the app that it has "refreshed" - in which case what does the app itself do?
My assumption is that any thread that has been "refreshed" could be running with a stale version of an existing class; although how critical that is may well depend on the type of update.

Winston
 
Jack Donahey
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
application runs update package in a new JVM
new JVM stops windows service (the application), updates files and then starts windows service (the application)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic