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.
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
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
Copy link to clipboard
Copied
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();
}