0 Replies Latest reply on Mar 29, 2012 12:25 PM by saot

    Update Air app

    saot

      Hi everyone! I work in Flash Builder...

       

      Can't find how to update my air app: i have air app v.1 and i want to update it to v.2

       

      This my test examle:

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                           xmlns:s="library://ns.adobe.com/flex/spark"

                                                           xmlns:mx="library://ns.adobe.com/flex/halo"

                                                           applicationComplete="init()">

       

                   <fx:Declarations>

                                    <!-- Разместить невизуальные элементы (например, службы или объекты значений) -->

                     </fx:Declarations>

       

                   <fx:Script>

                               <![CDATA[

                   import air.update.ApplicationUpdaterUI;

                                              import air.update.events.UpdateEvent;

       

                                              private var updater:ApplicationUpdaterUI = new ApplicationUpdaterUI();

       

                                              private function init():void

                                              {

                                                             updater.configurationFile = new File("app:/config/updaterConfig.xml");

                                                             updater.addEventListener(UpdateEvent.INITIALIZED, updaterInitialized);

                                                             updater.initialize();

                                              }

       

                                              private function updaterInitialized(event:UpdateEvent):void

                                              {

                                                             isFirstRun.text = event.target.isFirstRun;

                                                             previousVersion.text = event.target.previousVersion;

                                                             currentVersion.text = event.target.currentVersion;

                                              }

                               ]]>

             </fx:Script>

       

                   <s:Group width="300" height="200" horizontalCenter="0" verticalCenter="0">

                               <s:layout>

                                              <s:BasicLayout/>

                               </s:layout>

       

                               <s:Label text="isFirstRun:"                      x="80"   y="45" />

                               <s:Label           id="isFirstRun"                x="180" y="45" />

                               <s:Label text="previousVersion:"            x="78"   y="75" />

                               <s:Label           id="previousVersion"     x="180" y="75" />

                               <s:Label text="currentVersion:"              x="78"   y="105" />

                               <s:Label           id="currentVersion"        x="180" y="105" />

       

                               <s:Button click="updater.checkNow();" label="Check for Update" x="88" y="135" />

                </s:Group>

       

      </s:WindowedApplication>

       

      I have "updaterConfig.xml":

       

      <?xml version="1.0" encoding="utf-8" ?>

      <configuration xmlns="http://ns.adobe.com/air/framework/update/configuration/1.0">

                <url>http://mydomain.com/myairapp/update.xml</url>

                <delay>1</delay>

                <defaultUI>

                          <dialog name="checkForUpdate" visible="true" />

                          <dialog name="downloadUpdate" visible="true" />

                          <dialog name="downloadProgress" visible="true" />

                          <dialog name="instalUpdate" visible="true" />

                </defaultUI>

      </configuration>

       

      witch plase in my project: src\config\updaterConfig.xml

       

      in this srting "<url>http://mydomain.com/myairapp/update.xml</url>" i show way to find "update.xml" file on my server, then i'll show code of this file:

       

      <?xml version="1.0" encoding="utf-8" ?>

      <update xmlns="http://ns.adobe.com/air/framework/update/description/1.0">

                <version>1.0.1</version>

                <url>http://mydomain.com/air/myapplicationV2.air</url>

                <description><![CDATA[Varios bug fixes ]]></description>

      </update>"src/config/updaterConfig.xml"

       

      in this srting " <url>http://mydomain.com/air/myapplicationV2.air</url>" i show way to find my app v.2 on my server...

       

      If I correctly understand im doing all quite true, but it's not working(((

       

      Somebody, please, show my how to uppdate air app!) It will be perfect if you email me to 9506153635@mail.ru working project, or contact with my on skype absolut545...

       

      And looking forward thaks to every one!) PS: sorry for my eng)))