How to restart a standalone Adobe Air/Flex applica

2019-02-13 14:00发布

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.

标签: flex air adobe
2条回答
我命由我不由天
2楼-- · 2019-02-13 14:33

Hello dear i have been fixed this methode for Flex 4.6

package
{
    import adobe.utils.ProductManager;

    import flash.desktop.NativeApplication;

    import mx.core.FlexGlobals;
    import spark.components.WindowedApplication;

    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();
    }
}
查看更多
贪生不怕死
3楼-- · 2019-02-13 14:38
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"

查看更多
登录 后发表回答