如何重新启动独立的Adobe Air / Flex应用程序

时间:2009-11-30 19:07:22

标签: flex air adobe

如何让独立的Adobe Air / Flex应用程序重启?

它不适用于http://www.colettas.org/?p=267上建议的解决方案。

任何帮助都会很棒,

感谢。

2 个答案:

答案 0 :(得分:7)

亲爱的亲爱的,我已经为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();
    }
}

答案 1 :(得分:3)

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

还要确保   “allowBrowserInvocation”选项是   在AIR应用程序中打开   描述符模板

"How to restart an AIR application from code"