What is a good general approach to writing an update tool?

I need to write an updater for a simple java application. It should work with the existing installation directory and update the property and binaries. It should not destroy the existing directory in order to allow "cancel" in the event of a failure in the process.

I think of a general algorithm:

  • Create a new directory next to the existing one.
  • Extract new binaries to a new directory
  • Copy and merge everything you need to copy from the old directory to the new one.
  • Rename the older directory to what.tmp.random #
  • Rename the new directory to the original name of the source directory
  • Delete old directory

Is there a well-known template or free third-party update packages in Java? I do not want / need an expensive installer product.

+5
source share
1 answer

You are very calm about the idea of ​​how to do the update. Since the update process is unique to your application, third-party libraries and that probably will not be too useful. I would recommend just writing your own update methods.

+1
source

All Articles