• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Restarting an AIR desktop application

Explorer ,
Jul 05, 2018 Jul 05, 2018

Copy link to clipboard

Copied

Hello,

I need a DESKTOP AIR application (captive runtime bundle) to be able to restart itself after an update process.

The method involving productManager.launch doesn't work because <allowBrowserInvocation></allowBrowserInvocation> cannot be set to true for an application packaged with the captive runtime option :

Does anyone has a solution to this problem ?

Thanks.

Vincent.

TOPICS
Development

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jul 08, 2018 Jul 08, 2018

Hello el111,

Thank you.

Found a solution that works on both mac and win based on native script too.

public  function restartApplication():void
{
   var applicationDescriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;
   var xmlns:Namespace = new Namespace(applicationDescriptor.namespace());
   var applicationName:String = applicationDescriptor.xmlns::filename;
   var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
   var nativeProcess:NativeProces

...

Votes

Translate

Translate
Engaged ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

You can try running a bat script using NativeProcess

https://forum.starling-framework.org/topic/restart-standalone-application-on-desktop-windows

or you can use this ANE

which has a method called restartApp()

GitHub - tuarua/WindowsHelperANE: a set of methods for Adobe AIR for Windows

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 08, 2018 Jul 08, 2018

Copy link to clipboard

Copied

LATEST

Hello el111,

Thank you.

Found a solution that works on both mac and win based on native script too.

public  function restartApplication():void
{
   var applicationDescriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;
   var xmlns:Namespace = new Namespace(applicationDescriptor.namespace());
   var applicationName:String = applicationDescriptor.xmlns::filename;
   var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
   var nativeProcess:NativeProcess = new NativeProcess();
   var applicationExecutable:File;

   if (Capabilities.os.indexOf("Win") > -1)
   {
        applicationExecutable = new File(File.applicationDirectory.nativePath + "/" + applicationName + ".exe");

   }else{
 
        applicationExecutable = new File(File.applicationDirectory.nativePath.replace("Resources", "MacOS/" + applicationName));
   }

   nativeProcessStartupInfo.executable = applicationExecutable;
   nativeProcess.start(nativeProcessStartupInfo);
   NativeApplication.nativeApplication.exit();
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines