开发者

AIR - Launching Native Process In Windows Not Working

i'm attempting to launch a command line executable program as a background process in Windows 7, but it's not working. my AIR application is a native installer application: myAIRApp.exe.

i've bundled myApp.exe with my AIR application, so that when it launches for the first time, the application copies myApp.exe to the applicationStorageDirectory (C:\Users\Administrator\AppData\Roaming\myAIRApp\ ). the copy is successful, but it refuses to launch on it's own. the copy is complete prior to trying to launch it. i doesn't show up a开发者_开发技巧s a running process in Task Manager and subsequently, my AIR application, which relies on myApp.exe to be running in the background, fails.

if i manually double-click the copied myApp.exe in the applicationStorageDirectory it will open in Windows Command Processor, so the file is fine. the code also works fine on my Mac version, but instead of launching an .exe it launches the the Mac version as a background process, which opens in Terminal when manually launched.

the process doesn't take any arguments and there is no requirement for my AIR application to directly communicate with the launched .exe background process. it only simply needs to be running.

the AIR application is authored in Mac OS X, and i'm using Parallels Desktop to compile the Windows native installer using ADT and to test the application.

var myApp:File = File.applicationStorageDirectory.resolvePath("myApp.exe");
var myAppProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
myAppProcessStartupInfo.executable = myApp;

myAppProcess = new NativeProcess();
myAppProcess.start(myAppProcessStartupInfo);

any ideas why this might not be working?


perhaps i missed something in the AIR documentation or don't have a strong enough knowledge of Windows security, but it seems that executable files on Windows can not be launched from any directory other than the applicationDirectory.

launching the .exe from the applicationDirectory works. (tested on Windows XP and Windows 7)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜