David Ferguson

RSS
Dec 6

Adding support for Extension Updater to your extensions

So you want to add Extension Updater for Alfred support to your extension? Don’t worry, it’s easy.

Below is a sample update XML. Create an update.xml file in your extension folder. The VERSION value is the value of the current extension. The URL value should be a url to another xml file on a remote server. I suggest using Github for storing the remote XML and extension download, but it doesn’t have to be there.

update.xml example
<?xml version=”1.0” encoding=”ISO-8859-1”?>
<update>
<version>1.0</version>
<url>https://example.com/extensions/appcast.xml</url>
</update>

After you have the update.xml file created and available, use the same format to create the appcast.xml. This file name can be changed to whatever you would like, as long as the update.xml file has the correct url. The VERSION value will be the version number of the updated extension. Please only use x.x versioning numbers since values are converted to float for comparison. The URL value in the remote xml file will be a url that links directly to the .alfredextension file on the remote server. This is the url used to download the extension. There is one more optional value you can add to the remote xml and that is a ‘COMMENTS’. When using the Extension Updater, if using the ‘check’ command, users are displayed a list of all extensions that have updates, and the comment if it is available.

appcast.xml example
<?xml version=”1.0” encoding=”ISO-8859-1”?>
<update>
<version>1.0</version>
<url>https://example.com/extensions/extension.alfredextension</url>
<comments>This update contains many fixes!</comments>
</update>

Once you have your extension uploaded remotely and have the xml files in place, users should be able to query the remote site for the current version and download the extension via the url provided. I would recommend not including files that store settings and such in the new extensions, as they would overwrite previous ones when installed. 

Github Hosting

If using Github to host your extensions and xml files, make sure you use the raw urls. If you do not, the updater will not work properly.

More examples?

Download and install some of my extensions and look at the update.xml file included. Look at the content, the link to the remote version, check out the content of that file, etc. Several of my extensions support the Extension Updater already including AlfredTweet, Wunderlist for Alfred, and my Weather extension.