4 Replies Latest reply: Mar 11, 2015 11:23 PM by ketan156 RSS

    Updated Reboot / Restart of Application Air!!!! For Flex 4.6 SDK is important!!!

    SourceSkyBoxer Community Member

      Hello dear people,

       

      welcome back! Did you know about old code for Flex 3.6x and Adobe Air 2.5x

      Look like this:

       

      package
      {
        import mx.core.Application;
        import mx.core.WindowedApplication;
        import adobe.utils.ProductManager;
           public class reboot
      
           {
      
             public function reboot():void
             {
               var app:WindowedApplication =
                   WindowedApplication(Application.application);
               
               var mgr:ProductManager = new ProductManager("airappinstaller");
          
               mgr.launch("-launch " + app.nativeApplication.applicationID + " " + app.nativeApplication.publisherID);
          
               app.close();
             }
           }
      
      }
      

       

      I have been tried for fixed problem for Flex 4.6 SDK and Adobe Air 3.1 Fix

       

      I have been replaced "Application" into "FlexGlobals" and changed all import-libraries for Flex 4.6 SDK Support.

      Example this:

       

      /**
       * 
       * Reboot of Air App
       * 
       */
      package
      {
                import adobe.utils.ProductManager;
      
                import flash.desktop.NativeApplication;
      
                import mx.core.FlexGlobals;
                import spark.components.WindowedApplication;
      
           public class reboot
           {
                public function Reboot():void
                {
                          var app:WindowedApplication = WindowedApplication(FlexGlobals.topLevelApplication);
      
                          var mgr:ProductManager = new ProductManager("airappinstaller");
                          mgr.launch("-launch "+app.nativeApplication.applicationID+" "+app.nativeApplication.publisherID);
                          app.close();
                }
           }
      }
      

       

      I add line for template-app.xml:

       

      <allowBrowserInvocation>true</allowBrowserInvocation>
      

       

      I have been tested with Application Air on Flex 4.6 SDK and Air 3.1 SDK. Yeah it works complety.

       

      And can you visit to my blog of byethost http://snakemedia.byethost7.com/blog/?p=15

       

      Thanks for help and support!

      Happy coding and best regards, Jens E.