18
![]() |
The Updater API wrapped up in a framework from Adobe
Samples and download URL |
And Adobe decided to wrap up the update capabilities of Adobe AIR in a nice framework.
This far it looks good, still didn’t have the time to test it mysel, but the samples look interesting
The framework is configured via a simple XML file :
<?xml version=”1.0″ encoding=”utf-8″?>
<configuration xmlns=”http://ns.adobe.com/air/framework/update/configuration/1.0″ >
<url>app:/server/update.xml</url>
<delay>1</delay>
<defaultUI>
<dialog name=”checkForUpdate” visible=”true” />
<dialog name=”downloadUpdate” visible=”true” />
<dialog name=”downloadProgress” visible=”true” />
<dialog name=”installUpdate” visible=”true” />
</defaultUI>
</configuration>
And the code in JavaScript looks like this :
var application;
function initialize(){
application = new Application();
}
function Application(){
this.initializeUpdater();
}
Application.prototype = {
initializeUpdater: function(){
var that = this;
var appUpdater = this.appUpdater = new runtime.air.update.ApplicationUpdaterUI();
appUpdater.configurationFile = new air.File(”app:/config/update.xml”);
appUpdater.addEventListener( runtime.air.update.events.UpdateEvent.INITIALIZED, function(ev){ that.onUpdaterInitialized() } );
appUpdater.initialize();
},
onUpdaterInitialized: function(){
},
checkForUpdates: function(){
this.appUpdater.checkNow();
},
load: function(){
document.getElementById(’version’).innerHTML = this.appUpdater.currentVersion;
}
}
initialize();
Now … yes that looks ok, I have to try it and see .. maybe the Updater class I wrote for backit might be useless :) lol
Good job anyway - cheers for Adobe
Marin


Leave a Reply 666 Views