Dynamic Toolbar

Updating a deployed toolbar

DTX toolbars are able to update themselves on a computer connected to Internet. By adding some specifics tags in manifest.xml and placing some files on a HTTP server, the toolbar will be able to check periodically for updates and apply them. To do so, we need to specify to the toolbar where and when to check for an update. This information goes into the manifest.xml at the root of the toolbar project. Here is an example of a manifest.xml update section.

<toolbar-manifest>
...
<update
version="1"
url="http://www.myservername.com/toolbar/update/version.xml"
frequency="1440"
/>
...
</toolbar-manifest>

The update tag contains 3 mandatory attributes for the updates to work properly. The version attribute specifies the current version of the toolbar. The url attribute is telling the toolbar where it needs to check on the Internet for a new version. Finally, the frequency attribute is specifying the amount of time (in minutes) when checks for updates should be triggered.

In the above example, the toolbar will check every 24 hours, if a new version is available by reading the contents of  http://www.myservername.com/toolbar/update/version.xml
Let's take a look of a basic version.xml file that would be hosted on the http server.

<version>
<update
version="2"
zip="http://www.myservername.com/toolbar/update/update.zip"/>
</version>

This file is specifying that a new version (version 2) is available to download at the zip attribute location. The toolbar will, silently, download the zip file and uncompress it on the user’s computer. The changes will be shown and made available to the user on the next browser session. The user won't have the possibility to deny this update.

The update system is not enabled by default. To enable the updates, you will need to add the following code when the toolbar is loaded.

toolbarNamespace.onload = function(){
toolbarNamespace.framework.update();
}

Please take note that you need to replace toolbarNamespace with your actual toolbar namespace. Also, your toolbar.xml file need to have an entry like this :

<toolbar
...
onload="toolbarNamespace.onload()"
...

This will start the update process where the toolbar will check if it is time to apply an update or not.

If you want to give the user the option to accept or deny the update, you can specify some labels to prompt for whether to upgrade or not. Also, you have the possibility to tell the user that the update was successful and that changes will appear on the next browser session. Here an example how to specify these labels:
<version>
<update
version="2"
zip="http://www.myservername.com/toolbar/update/update.zip"

confirm="A new version of MyToolbar is available. Do you want to upgrade?"
done="Update complete. To finish the update, you will have to restart your browser."
/>
</version>

This file will trigger the following dialog:

Dialog

Then, after the update is completed, the user will see:

Dialog

Finally, downloading and extracting a zip file to update a toolbar is easy to deploy, small to download but cannot help you if you want to deploy a major update. For example if you need to deploy an antispyware within a toolbar update, you will not be able to install this software and register its dlls by this update method. For this you will need that the user download and start an executable which will start the installation of this antispyware and, at the same time, update the toolbar's files to the new build.

To to this, you need to specify in the zip attribute an url which points on a executable file. For example :

<version>
<update
version="2"
          zip="http://www.myservername.com/toolbar/update/myBigUpdate.exe"

confirm="A new version of MyToolbar is available. Do you want to upgrade?"
done="Update complete. To finish the update, you will have to restart your browser."
/>
</version>

This file will result as this :

Dialog

The zip file contents should contain all the files you have changed since you last build. For example, let's say you added a submenu link to your toolbar with an icon (mynewicon.png) then the folder structure inside the zip file should look like this :

update.zip
chrome/
content/
toolbar.htm
toolbar.xul
skin/
mynewicon.png

 
Dynamic Toolbar Home | Privacy | Contact Us©2010 Visicom Media Inc. All rights reserved.