Automatic Software Updater: Difference between revisions

From Arianne
Jump to navigation Jump to search
imported>Hendrik Brummermann
imported>Hendrik Brummermann
(No difference)

Revision as of 10:23, 10 July 2011

Use cases

  • U1. Updates of the production download-client (user)
  • U2. Initial download and updates of the production webstart-client (user)
  • U3. Running the client in a development environment (coder)
  • U4. Adding resources to the production client by non coders (graphic and sound contributor)
  • U6. Providing a production download-client without update (packagers for linux distributions)
  • U7. Providing production download-client and webstart-client for a forked projects (third party developers)

Requirements

Internals

Creating an automatic updater

  • Important: In the folder stendhal/src/games/stendhal/client/update copy game-default.properties to game.properties and change the GAME_NAME variable. This is vital because otherwise your updates and the official ones get mixed up.


  • Next you need to create a key pair and save it in a file keystore.ks in the stendhal root folder:
keytool -genkeypair -keyalg RSA -keystore keystore.ks -alias certificatename -keysize 2048
  • You may want to export a csf (certificate signing request) to get it signed by an official CA so that the Java Webstart does not complain about an untrusted signature
  • Export the certificate to a file in stendhal/src/games/stendhal/client/update and adjust the variables in the "Automatic Updates" section
  • Create a file build.ant-private.properties in the stendhal root folder with two entries: keystore.alias and keystore.password
  • Make sure you never ever give keystore.ks or the build.ant-private.properties away
  • Place the last stendhal-0.xx.jar into the folder build-archive and adjust version.old and version in build.ant.properties (Note: You may want to edit build.ant.properties and build.xml to use a different name).
  • Run ant dist piping the output into a file
  • Create your update.properties file based on the example version in the folder stendhal/src/games/stendhal/client/update. The file-signature.* section needs to be filled with the output from the build process. Alternativly you can use this command to generate the signature (for example for external files such as log4j.jar, marauroa.jar, jobirs.jar):
java -cp .:build/build_stendhaltools/:libs/ant.jar games.stendhal.tools.updateprop.UpdateSigner libs/log4j.jar libs/jorbis.jar ...

See also