How to deliver automatic updates for your module

Jungle Ide provides a way for module developers to automatically allow module users to get latest available version.

This system does notify your module users when an update is available, giving them the option to automatically update it. Jungle Ide will take care of backing up previous module version, download the latest version ZIP module and install it on the user hard drive.

This system also allow you to roll-back any update in case something is broken on your latest experimental version. We all know, whenever this happens, it is very important to make it easy to roll back changes!

As a module developer, there’s very little to do in order for your module to be automatically handled by Jungle Ide. 

 

Gear

First Step. Create a Module signature file

You’ll need to create a module signature file. A module signature file is a xml document in plain text, with extension lmbs (lemonbytes module basic signature). This file is used by Jungle Ide to determine whether a module has to be updated or not. This file also contains information about where to get the downloads etc. It’s very easy to set up, all you need to do is to create a plain document text file (notepad will do the job) and fill it with the following structure.

This document has to contain the following information:

<?xml version=”1.0″?>

<ModSignature xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>

<Name>module display name</Name>

<MajorVersion>Major version number</MajorVersion>

<MinorVersion>Minor version number</MinorVersion>

<Revision>Revision</Revision>

<Build>Build</Build>

<Kind>ZipFolder</Kind>

<UpdateURL>update location in internet</UpdateURL>

<RemoteSignatureURL>remote signature location in internet</RemoteSignatureURL>

<ShortDescription>Description of this latest version</ShortDescription>

<RequireCredentials>True or False if the update download requires authentication</RequireCredentials>

<MoreInfoURL>Module additional info</MoreInfoURL>

</ModSignature>

All the parameters marked in RED are the parameters that have to be customized for each module signature file (lmbs). As instance, for the Fontmachine module, we’ve created this lmbs file:

<?xml version=”1.0″?>

<ModSignature xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>

<Name>FontMachine module for Mojo</Name>

<MajorVersion>12</MajorVersion>

<MinorVersion>02</MinorVersion>

<Revision>17</Revision>

<Build>A</Build>

<Kind>ZipFolder</Kind>

<UpdateURL>http://www.jungleide.com/fontmachine-12-02-17-A.zip</UpdateURL>

<RemoteSignatureURL>http://www.jungleide.com/fontmachine.lmbs</RemoteSignatureURL>

<ShortDescription>This new version features some additional methods and has several visualization fixes</ShortDescription>

<RequireCredentials>false</RequireCredentials>

<MoreInfoURL>http://www.jungleide.com/fontmachine/</MoreInfoURL>

</ModSignature>

I’ll explain here each parameter:

  • Name: This parameter is the module display name. The name that the module is given. It can be any natural name, if does not need to match the module folder name, but it has to be clear which module it is.
  • MajorVersion, MinorVersion, Revision and Build: This parameters are used to identify the current module version. As instance, in the fontmachine module description above, the module version is 12.02.17-A (being, major, minor, revision and build). It is recommended that the major version contains the year of the module version, while the minor version contains the month, and the revision contains the day of the month when it was released. Also, a build letter to identify possible version released in the same day (quick fixes).
  • Kind: This parameter indicates the way the module update is delivered. Currently only ZipFolder is supported. So this parameter is always ZipFolder (other uses are reserved for future version of the module updater tool).
  • UpdateURL: This parameter has the URL location of the ZIP file containing the update described in this signature document. This signature file will be used to download the module, so we need to know where to find the Zip file in the Internet (or intranet or any other http location). The locatoin stated in this parameter has to be the location of the specific module version described in this signature document, and not the location of any other updated version.
  • RemoteSignatureURL: This parameter has the location on Internet where the module signature of the very latest version of the module is located. Jungle Ide will compare current module description with the one located at this URL address to determine whether an update action is required on a specific module. To do so, we need to tell Jungle Ide where to find the latest module description (so it can compare versions information and act accordingly).
  • RequireCredentials: This parameter has to be set to true if the module update download process requires http authentication to be completed. This functionality is not yet being supported, this parameter is reserved for future use.
  • MoreInfoURL: This parameter contains a Internet location with additional information about the module. It’s usually the module official website.

.

2  Saving the module signature file.

The module signature file has to be saved at the root folder of the module, and it has to have the same name as the main module file, but with extension lmbs. As instance, the fontmachine module, has this files:

[modfolder]/modules/fontmachine/fontmachine.monkey

[modfolder]/modules/fontmachine/fontmachine.lmbs

The fontmachine.lmbs is the signature file for fontmachine.monkey module.

 

3 Preparing everything to work

Once you’ve created your module signature file, all you have to do is:

1.- Zip your module folder (including the module signature file) and upload it to the UpdateURL location you specified in the module signature file.

IMPORTANT: You have to zip the module root folder in a way that the module main “monkey” file is on the “root” of the Zip file. If the zip file contains a folder containing the module, the process will fail to auto-update properly, as it will add an additional folder in the process. this is very important. 

2.- Upload separately the module signature file (the lmbs file) to the RemoteSignatureURL specified on the module signature file. It is very important that if you are updating a previous version of your module, replace previous version with this one in the same URL.

That’s it! Your module is ready to update itself. All users that download your Zip file containing the module (with the module signature file in the module folder) will have an  auto-update ready version of your module,and Jungle Ide will detect this and act accordingly.

 

4 Releasing an update

Releasing an update is as easy as:

1.- Edit the local module signature file (the lmbs file in your module folder) and change the following:

  • The update version number (if you don’t do that, the update process won’t detect that an update has been done on the module).
  • The UpdateURL where this new version will be uploaded
  • The ShortDescription of this new release.

2.- Zip and upload the zip file to the UpdateURL. This has to be the same Update Url specified on the module signature file (lmbs)

3-. Upload separately you new lmbs file to THE SAME RemoteSignatureURL where previous version description was set (overwrite it).

That’s it! you’ve released an update for everyone.