CodeMouse92
CodeMouse92

Reputation: 6898

Trouble with NativeProcess

I'm pulling my hair out.

I have a Flash Professional CS6 project using ActionScript 3.0 and Adobe AIR 2.7.

I have a very important class which uses NativeProcess to communicate with a command-line executable. It works perfectly when I'm debugging the program in Flash Professional, but as soon as I package it for Adobe AIR (Extended Desktop profile), the installed program will not respond to anything because it is silently getting hung up on this code. It doesn't crash, it just stops running code.

file = File.applicationDirectory.resolvePath("deepcore/" + module + ".exe");
startup.executable = file;
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, addToBuffer);
process.start(startup);

When I comment out startup.executable = file and process.start(startup), it works fine.

I have checked and double check that the deployed version supports NativeProcess (NativeProcess.isSupported returns true.)

All of my imports are working properly.

Why does my code hate me?

Upvotes: 0

Views: 324

Answers (1)

CodeMouse92
CodeMouse92

Reputation: 6898

Hah, okay, I feel a little silly now.

My path, you may notice, is inside the application directory. When debugging in Flash, the path "deepcore/*.exe" is present (with * being the module name).

However, after installing, this no longer works because the path does not exist in the installed application directory, and there was no provision for non-working file directories.

In Publish Settings, I added the deepcore folder, and everything worked fine. (And yes, I adjusted my code to check for file existence.)

Upvotes: 1

Related Questions