How to restart a standalone Adobe Air/Flex application

Gabriël picture Gabriël · Nov 30, 2009 · Viewed 7.8k times · Source

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.

Answer

SourceSkyBoxer picture SourceSkyBoxer · Jan 20, 2012

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