Automatic Software Updater: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Hendrik Brummermann No edit summary |
imported>Hendrik Brummermann |
||
| Line 12: | Line 12: | ||
== Internals == |
== Internals == |
||
== Creating |
== 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. |
|||
The updated files now need to be signed in a way that hides the signature from Java. This way we can use a long time key without risking evil-grade attacks. |
|||
The signatures are saved in update.properties and generated by |
|||
java -cp .:classes games.stendhal.tools.updateprop.UpdatePropUpdater /tmp/update-0.86.properties /tmp/out.txt 0.94 0.94.5 build/lib stendhal-0.94.5.jar stendhal-data-0.94.5.jar stendhal-data-diff-0.94-0.94.5.jar ... |
|||
* 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 <code>ant dist</code> 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 == |
== See also == |
||