Closed Thread
 
Thread Tools Display Modes
Old 04-22-09, 03:25 AM   #1
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 829
Auto-Update API

One of the features module authors can take advantage of is the module auto-updating capabilities. This allows, without any additional code in the module, for the Minion core to check for updates to the module and alert the user to install them as necessary.

To do this, the manifest included in the bundle must include the "X-Auto-Update-URL" property. This property should specify a URL where an XML file is located which indicates the update tree. For example, a manifest may include the following line:

Code:
X-Auto-Update-URL: http://www.wowinterface.com/patcher_update.xml
The core will read this line from the manifest and obtain the XML file, parse it, and handle any available updates accordingly.

Updates can be either critical or non-critical. Critical updates are required to be installed by the user. These types of updates should only be specified if failure to update will result in a failure of the system, such as when an API has incompatibly changed. For bug-fixes and feature improvements, non-critical updates should be specified. Non-critical updates alert the user to install updates when possible without impeding operation.

Updates also specify a "start" and "end" version which is targeted. Version numbers should be entirely numerical and separated with decimal points only. Update blocks will only be checked if the currently installed version is within the "start" and "end" version, inclusively. The "tag" version is the version number of the update.

All update XML files specify an UpdateData element with two attributes: bundleName and protocol. Currently, the only supported protocol is 1.0. This is provided for backwards compatibility in the event that the XML schema changes in the future. bundleName must be equal to the Bundle-Name property in the bundle's manifest. If it is not equivalent, a warning will be logged and the updates will not be processed, to avoid overwriting the module with an incorrect one.

A sample XML file for updating is shown below.

XML Code:
  1. <UpdateData bundleName="MMOUI Manager - World of Warcraft" protocol="1.0">
  2.    <!-- Updates Listed Below -->
  3.         <Update startVersion="2.1.0" endVersion="2.1.8" tag="2.1.9" isCritical="true">
  4.                 <Package>http://some.url/update_2_1_9.jar</Package>
  5.         </Update>
  6.  
  7.         <Update startVersion="2.1.9" endVersion="2.1.9" tag="2.1.10" isCritical="false">
  8.                 <Package>http://some.url/update_2_1_10.jar</Package>
  9.         </Update>
  10. </UpdateData>


The schema for the auto-update XML is specified below. Please note this schema is subject to change.

XML Code:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  4.    targetNamespace="http://minion.mmoui.com/update/"
  5.    xmlns:tns="http://minion.mmoui.com/update/"
  6.    elementFormDefault="qualified">
  7.     <xsd:element name="UpdateData">
  8.         <xsd:complexType>
  9.             <xsd:sequence>
  10.                 <xsd:element name="Update" minOccurs="0" maxOccurs="unbounded">
  11.                     <xsd:complexType>
  12.                         <xsd:sequence>
  13.                             <xsd:element name="Package" type="xsd:anyURI"></xsd:element>
  14.                             <xsd:element name="Digest" minOccurs="0" maxOccurs="1">
  15.                                 <xsd:complexType>
  16.                                     <xsd:simpleContent>
  17.                                         <xsd:extension base="xsd:hexBinary">
  18.                                             <xsd:attribute name="type" type="xsd:string" use="required" />
  19.                                         </xsd:extension>
  20.                                     </xsd:simpleContent>
  21.                                 </xsd:complexType>
  22.                             </xsd:element>
  23.                         </xsd:sequence>
  24.                         <xsd:attribute name="startVersion" type="xsd:string" use="required"/>
  25.                         <xsd:attribute name="endVersion" type="xsd:string" use="required"/>
  26.                         <xsd:attribute name="tag" type="xsd:string" use="required"/>
  27.                         <xsd:attribute name="isCritical" type="xsd:boolean" default="false" use="optional"/>
  28.                     </xsd:complexType>
  29.                 </xsd:element>
  30.             </xsd:sequence>
  31.             <xsd:attribute name="protocol" type="xsd:string" use="required"/>
  32.             <xsd:attribute name="bundleName" type="xsd:string" use="required"/>
  33.         </xsd:complexType>
  34.     </xsd:element>
  35. </xsd:schema>
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/

Last edited by Shirik : 04-22-09 at 12:39 PM.
Shirik is offline  
Closed Thread

Go BackWoWInterface » Site Forums » MMOUI Minion » Minion Dev Discussion » Auto-Update API

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off