tags:

views:

721

answers:

3

Hi,

How can I get a standalone Adobe Air/Flex application to restart itself?

It doesn't work with the suggested solution on: http://www.colettas.org/?p=267.

Any help would be great,

Thanks.

+2  A: 
package
{
  import mx.core.Application;
  import mx.core.WindowedApplication;
  import adobe.utils.ProductManager;

  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();
  }
}

Also make sure that the “allowBrowserInvocation” option is turned on in the AIR application descriptor template

"How to restart an AIR application from code"

0A0D
fYI: This doesn't work in debug mode. Because the code you posted was exact the same as we used already. Now I tried it in an installed instance and it did work!Thanks.
Gabriël
A: 

try the above code, did not work for the Flex 4 SDK

A: 

allowbrowserInvocation should be true not on, i found out fro this similar solution and it works

http://askmeflash.com/qdetail/1124/restart-app

Robert