没有任何数据可供显示
| 开源项目社区 | 当前位置 : |
|
| www.trustie.net/open_source_projects | 主页 > 开源项目社区 > air-simple-updater |
|
air-simple-updater
|
| 0 | 0 | 0 |
| 贡献者 | 讨论 | 代码提交 |
PurposeAirSimpleUpdater uses Adobe AIR's Updater class to help you build self-updating AIR apps with just a few lines of extra code:
var myUpdater = new AirSimpleUpdater(
'http://www.example.com/air/application.xml',
'http://www.example.com/air/MyUpdateableAirApp-%version%.air'
);
myUpdater.run();
Getting startedTo use AirSimpleUpdater, you need to keep two files on your web server: The latest AIR installer archive for your application, and a copy of its application.xml file.
When you release a new version, simply overwrite the application.xml file and upload the new AIR installer archive. If the filename of your AIR file changes with each version (it contains the version number), then include version in your URL (optional).
If the code snippet in the first section is enough of an introduction for you, download updater-1.0.js to get started.
Or, you can download the sample application code and poke around.
To see AirSimpleUpdater in action, install version 1.0 of the sample application. After launching the application, you will be able to "auto-update" to version 1.1.
If you run into any trouble or have any feedback please email me.
Advanced usageYou may want to provide your own implementation for some of the functions in updater-1.0.js. For example:
myUpdater.noUpdateRequired = function()
{
alert("You already have the latest version! Congratulations!");
}Or:
myUpdater.whileWaiting = function(status)
{
switch (status)
{
case "CHECKING_FOR_UPDATE" :
statusText = "Checking for update, please wait...";
break;
case "DOWNLOADING_UPDATE" :
statusText = "Downloading update, please wait...";
break;
}
document.getElementById("status_update").innerHTML
= statusText;
}Some of the other functions you might want to customize:
Function Returns Default behavior Possible customized behavior noUpdateRequired Trigger normal program initialization beforeUpdate false to cancel update Asks the user if they would like to update Force the update compareVersions true if update required Numerically compares version numbers Compare using your own version numbering scheme whileWaiting Changes window title to update status Show a customized status box finishedWaiting Restores window title Hide customized status box handleError Displays error in an alert box Show a customized error box
标签:
