简体   繁体   English

Adobe AIR 3.3更新框架

[英]Adobe AIR 3.3 Update Framework

I am building an application in AIR (v3.3) using Flash (NOT Flex), and I am having trouble with the update framework. 我正在使用Flash(NOT Flex)在AIR(v3.3)中构建应用程序,但更新框架遇到问题。 All the resources I have found are for older versions of AIR and / or refer to a Flex build. 我发现的所有资源都用于较早版本的AIR和/或引用Flex构建。 It's the first time I have done this, and would really appreciate some guidance... 这是我第一次这样做,非常感谢您提供一些指导...

I have a simple test app - an image (which changes v1 to v2) and a text field. 我有一个简单的测试应用程序-图像(将v1更改为v2)和文本字段。 This is what I have tried (following http://goo.gl/uvycg ): 这是我尝试过的方法(遵循http://goo.gl/uvycg ):

...
var appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI();
...
public function checkForUpdate():void
    {
        ...
        appUpdater.updateURL = "http://mysite.com/updates/update-descriptor.xml";
        appUpdater.isCheckForUpdateVisible = false;
        appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate);
        appUpdater.addEventListener(ErrorEvent.ERROR, onError);
        appUpdater.initialize();
    }
private function onUpdate(event:UpdateEvent):void
    {
        txt.text = 'onUpdate()';
        appUpdater.checkNow();
    }
private function onError(event:ErrorEvent):void {
        txt.text = 'onError() ' + event.toString();
    }

This is my updateDescriptor.2.5.xml: 这是我的updateDescriptor.2.5.xml:

 <?xml version="1.0" encoding="utf-8"?>
<update xmlns="http://ns.adobe.com/air/framework/update/description/2.5">
<versionNumber>2.0</versionNumber>
<versionLabel>Beta 2</versionLabel>
<url>http://mysite.com/updates/UpdateTest.air</url>
<description>               
    <![CDATA[ update of bees. geometric growth. ]]>
</description>

So, the update descriptor with v2 of the app is on the server, I install and run v1 of the app, and all that happens is I see the onUpdate() message in my text field, and no update happens. 因此,应用程序v2的更新描述符位于服务器上,我安装并运行了应用程序v1,所有发生的事情是我在文本字段中看到onUpdate()消息,并且没有更新发生。 Where am I going wrong? 我要去哪里错了? Thanks! 谢谢!

Based on the documentation , it would appear that you need to make sure the current state of the ApplicationUpdaterUI is "ready," otherwise "checkNow()" will do nothing. 根据文档 ,您似乎需要确保ApplicationUpdaterUI的当前状态为“就绪”,否则“ checkNow()”将不执行任何操作。

The most recent information on Adobe AIR updating can be found HERE . 此处可以找到有关Adobe AIR更新的最新信息。 It applies across the board. 它全面适用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM