Skip navigation
Currently Being Moderated

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

Jan 20, 2012 8:56 AM

Tags: #air3.1 #flex4.6

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.

 
Replies
  • Currently Being Moderated
    Jul 31, 2012 3:55 AM   in reply to Jens Eckervogt

    White publishing my build, it says:

    "Browser invocation is not supported for this target"

     

    NOTE: I am using air captiveRuntime to build my project instead of regular *.air.

     

    And airappinstaller" is a keyword ? or i can use any namespace ?

     

    regards,

    Mitesh

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points