Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is AIR NativeProcess not supported?

I'm building a desktop app using Flash Builder and I need it to run a .exe program. I downloaded and installed the latest AIR SDK, put it in my Flash Builder sdks folder and had my project use it. Now i don't have any compiler errors, but:

     if(NativeProcess.isSupported)
            {
                var file:File = new File("C:\Torres.exe");
                var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
                nativeProcessStartupInfo.executable = file;
                var process:NativeProcess = new NativeProcess();
                process.start(nativeProcessStartupInfo);
            }

I checked and it just never goes inside the if block. Why wouldn't nativeprocess be supported? Any ideas?

like image 908
Samssonart Avatar asked Sep 19 '11 23:09

Samssonart


2 Answers

Add this

<supportedProfiles>extendedDesktop</supportedProfiles>

to your app's manifest file. Using NativeProcess requires extended rights.

The article is likely to be helpful: http://www.adobe.com/devnet/air/flex/articles/air_screenrecording.html

like image 194
SteAp Avatar answered Oct 19 '22 03:10

SteAp


Possibilities:

  1. Your AIR Runtime not 2.0 or Later version. Because NativeProcess supports in 2.0 and Later version only.

    You can check your Adobe AIR runtime version in two ways.
    a) Manual
    b) By Coding

    a) Manual

    • In Windows : Start -> Settings -> Control Panel -> Add or Remove Programs -> Select Adobe AIR -> Click the link "Click here for support information"
    • In MAC OSx : Finder Window -> Select Application -> Select Adobe AIR Installer -> Right Click -> Select "Get Info"

    b) By Coding

    Paste this code in your Desktop Application to find the AIR runtime version.

    trace(nativeApplication.runtimeVersion); // 2.6.0.19120

  2. Your not mentioned "extendedDesktop" value in the "supportedProfiles" property in the Application Descriptor file or Your not enable that property.

    <supportedProfiles>extendedDesktop</supportedProfiles>

like image 38
Ganesh Gandhi K Avatar answered Oct 19 '22 04:10

Ganesh Gandhi K