Question

I was working on an update launcher for a java .jar application. I have several .jar-archives and a main.jar. My launcher adds/replaces the necessary jars when updating.

I am just not sure what criterias to look after. So I'll describe how the process works and you might tell me if I forgot something.

  1. Load and compare version.xml file from ftp update server
  2. Make a list of updated items with the help of both version.xml files
  3. Check (to be sure) if those files which are still valid really do exist on hard drive (either add them to the list of items that needs to be downloaded...shouldn't happen anyway)
  4. Create a list of files that needs to be downloaded (those items are on the server in a compressed form)
  5. Download all needed files to /temp folder
  6. Unpack all files to /temp/unpack
  7. Move all unpacked files to /data folder (or where they belong to)
  8. Update local version.xml
  9. Check if all files match the actual version-file-list

I am really not sure if I forgot something? If some users mess around with files in /data my updater recognizes this and proposes a "repair-update" where all missing files are beeing redownloaded. But what about users messing around with version.xml? I should store that encrypted. Is it necessary to keep the downloaded version.xml from update server open so that noone can change while checking version and updating? Or am I worried too much about all that?

Does all this work out so far and is it secure enough to not creaty messy installations on a users pc after patch?

Was it helpful?

Solution

Do you intend to use the System Tray class from Java 1.6 to notify the user of the update? To me, it seems like something like this would involve implementing an OSGi updater (sorta like how Eclipse project does it in the IDE). Also, the JVisualVM.exe tool (that comes with JDK) is an excellent example of this sort of thing and maybe you could get ideas from that although I suspect its coded in C++.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top