Reputation: 21
I have built a application that use a nativeProcess to open exe.
The application into Flex Builder 3 run whitout errors.
Then the problem come when I export the aplicaction AIR in .air and install the applicaction in the developer pc or other pc.
When I push the button to open the .exe, appear the message "Native Process is not supported".
The code in the main.mxml that I use:
if (NativeProcess.isSupported)
{
var file:File = new File("app:/config/AbrirAplicacion.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
process.standardInput.writeUTFBytes(textReceived.text+"\n");
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
}
else
{
textReceived.text = "NativeProcess not supported.";
}
Any ideas of what I'm doing wrong?
Upvotes: 2
Views: 1676
Reputation: 2030
NativeProcess is only available when applications are compiled to native binaries, not .air installers.
Upvotes: 3
Reputation: 7990
You have to set the supportedProfiles-tag to 'extendedDesktop' in order to work with Native Process.
Put / uncomment this line below in your app.xml:
<supportedProfiles>extendedDesktop</supportedProfiles>
Upvotes: 1
Reputation: 1010
NativeProcess can be compiled with Air2 it's just very tricky. The problem is that you have to COMPLETLEY overlay your Flex SDK and the new Air2. Surprisingly, according to this link, you cannot do it through the finder and should do it through the terminal. In Mac:
ditto -V folder1 folder2
in the terminal to overlay them.Now go to your project's preferences and select the folder2 as sdk (now it's overlay with folder1).
Also, you will probably need to change the description to:
http://ns.adobe.com/air/application/2.0
There is very good description on Installing the Adobe AIR 2 SDK in Eclipse (check part 3).
Hope that helps.
Upvotes: 0