Native Process Issue in AIR 2.0

I have written an AIR application in "Windows" that invokes a third party application through "Native Process APIs" offered in Adobe AIR 2.0 Beta. The issue is when my application invokes the third party application, a command prompt window appears until it get finished executing. Its really irritating in terms of GUI and I would like to get rid of it. Please let me know if there is any solution?
Waiting for all of your precious words...
Thanks

Yes, my application is taking command line aurguments. Here is the code:
            var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
            nativeProcessStartupInfo.arguments = aurguments; // Array of aurguments
            nativeProcessStartupInfo.executable = file;
            this.process = new NativeProcess();
            process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
            process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
            process.addEventListener(NativeProcessExitEvent.EXIT, onProcessExit);
            process.start(nativeProcessStartupInfo);

Similar Messages

  • Problem with AIR 2 Native Process?

    I had installed Adobe AIR 1 before and Flex Builder 3.0 (licensed) on a Windows Vista machine. Now i have installed AIR 2 framework (without uninstalling AIR 1, assuming that it will update that). I m trying to write a small code to use AIR 2 Native Process functionality but AIR is not recognizing Native Process classes/objects. Even i have tried a sample code from Adobe Developers Center article http://www.adobe.com/devnet/air/flex/quickstart/interacting_with_native_process.html but no way.
    Please let me know wat is wrong? How i can use AIR 2 new features? How to upgrade to AIR 2?
    Looking forward for an earliest response.
    Thanks
    Asad Ijaz

    Thanks romil!
    I have installed AIR 2 but without uninstalling AIR 1. Should i uninstall AIR 1 before i install AIR 2?
    Regard,
    Asad Ijaz

  • Launch App with Native Process

    Hi,
    I want to launch serproxy application (http://www.lspace.nildram.co.uk/freeware.html) using native process in adobe air. But it seems not working.
    Here is my code:
    protected function launchSerproxy():void{
        if(NativeProcess.isSupported){
         var serproxy:File = File.applicationDirectory;
         serproxy = serproxy.resolvePath("serproxy/serproxy.exe");
         var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
         nativeProcessStartupInfo.executable = serproxy;
         var process:NativeProcess = new NativeProcess();
         process.start(nativeProcessStartupInfo);
         // connect to the com port
         setTimeout(connect,1500,"127.0.0.1",5339);
    Flex did not return any error or problem on runtime. What should I do to have Adobe Air load and run serproxy? Thanks.

    I think you just missing the working directory.
    "nativeProcessStartupInfo.workingDirectory = File.applicationDirectory;"

  • Very strange bug with AIR and native process (Windows 7, EXE)

    Hello to everyone!
    The situation is:
    I've made an AIR Application, inside of that is running a native process - EXE file.
    I'm using Flash CC as IDE and tried to use compile that as EXE with AIR 2.6 and 3.6 - results are same.
    So I've insert inside a checking if Native Process is supported or not and the Native process is supported all the time.
    When I've just installed the application and run it - the very first attempt is good - everything is working as a must: internal EXE is called by my Application with necessary parameters as many time as I'm need.
    However if I'll close the App and then will run it again - internal EXE is not starting at all, doesn't depends on number of attempts to re-start of the App.
    So only way is to uninstall, install it back and then you'll be one more session of successful internal EXE-requests, till the next re-start of the App.
    That's it.
    I've tried to "google it" but unsuccessful. Probably the bug is very rare.
    Help me please?
    Update: at compilation with Flash CC IDE it's working all the time with no any issues.
    Update-2: when I'm running installator-EXE, there is going a notification "Same version is installed, etc." and then selected "Run Now" - there is also working with no problems.

    Well, I've found the solution and answer by myself and here is it please:
    In case with same situation as above you need to add just one line in your AS3-code
    nativeProcessStartupInfo.workingDirectory = File.applicationDirectory;
    And you will be happy so much

  • Invoking methods on a native process in Air 2.0

    Hi all,
    I wanted to know if it was possible to call methods (declared as public) on a native process with Air 2.0.
    Any help would be appreciated,
    Thanks in advance,
    Julien

    Hi Julien,
    It isn't possible to call methods directly with the new native process api's.  Instead you'll communicate via stdin and stdout.  Please check out this document for further details: Interacting with a Native Process
    Thanks,
    Chris

  • Native Process calling TabTip.exe not working on Windows 8

    Hey,
    I'm desperately trying to get the nice Touch Keyboard to display on Windows 8 for my AIR App.
    Looking at this article http://sukantadas.wordpress.com/2012/10/16/executing-exe-file-from-desktop-through-adobe-a ir/ it seems possible, and it works nicely on my windows 7 machine, beit that TabTip.exe is a slightly different keyboard on Win7.
    Over to windows 8, I can't get it to work for love nor money. ('m testing on this http://www.samsung.com/us/business/computing/tablet-pcs/XE700T1C-A03US).
    It works fine if I wrapp the SWF with MDM.ZINC - Mdm.System.exec("C:\\Program Files\\Common Files\\microsoft shared\\ink\\TabTip.exe"); but then I'm out of the AIR SDK and stuck with MDM Zinc; which doesn't even recognise MouseDown events on Windows 8 (touching the screen).. but that's another story - http://www.mdmforum.com/forum/index.php?showtopic=29963
    Please can someone help me as I've been pulling my hair out..

    I lost my password to respond.
    Thanks for helping me out. I found out how to do it in ASP.net though. I use the app for native process because I was having some huge issues with AIR.
    Thanks again
    My code below. I took into account Windows 8
    Imports System.Threading
    Imports System.Runtime.InteropServices
    Module Module1
        Sub Main(ByVal sArgs As String())
            If sArgs.Length = 0 Then
                Console.WriteLine("<-no arguments passed->")
            Else
                Dim i As Integer = 0
                If i < sArgs.Length Then
                    If sArgs(i) = "1" Then
    If My.Computer.FileSystem.FileExists("C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe") Then
          Process.Start("C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe")
    Else
          Process.Start("c:/windows/system32/osk.exe")
    End If
                    ElseIf sArgs(i) = "0" Then
                        Dim TouchhWnd As New IntPtr(0)
                        Dim hWnd As New IntPtr(0)
                        TouchhWnd = FindWindow("IPTip_Main_Window", Nothing)
                        PostMessage(TouchhWnd, WM_SYSCOMMAND, SC_CLOSE, 0)
                    End If
                End If
            End If
        End Sub
        Dim WM_SYSCOMMAND As Int32 = 274
        Dim SC_CLOSE As UInt32 = 61536
        <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
        Private Function PostMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean
        End Function
        <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
        Private Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
        End Function
    End Module

  • Execution of Java Native Process slow in Mac OS X

    Hi,
    I'm having some performance issues when executing an java native process on Mac OS X. I am developping an application in AIR that searches for people in the ldap of our organisation. It has to be usable both on Mac as on Windows. When I execute my app on windows, the search process takes about 2-3 seconds. However, when I try to execute it on mac, the search process takes about 6-8 seconds. This is a bit to long to make it usable.
    Has anybody encountered this problem as well and does anyone know what the problem can be?
    Thanks in advance
    Ronald Kamp
    Junior Flex/Java/LiveCycle Consultant at iDA MediaFoundry

    Hi Ronald,
    Have you tried benchmarking your java process without the inclusion of AIR?  If so, did you find a difference which points to AIR being a culprit for the performance hit?
    I'd be very interested in trying this out.  If you could provide me with a sample project that illustrates the slow down on Mac, I'll take a look right away.  Please feel free to contact me via private message on the forum or at [email protected] if you'd like to take this offline.
    Thanks,
    Chris

  • How can you enable back the Android native Menu button in AIR 2.7?

    I've noticed in AIR 2.7 for Android, that now the bottom icons in Android 3.0 Honeycomb are hidden (replaced by small dots) in AIR 2.7, whereas in AIR 2.6 they were always visible. That's cool. Since the bottom bar can never be hidden in Android 3, at least now those icons are less visible (unless you intentionally touch the bottom bar, then the icons show up for a few seconds).
    BUT I also noticed in AIR 2.7 compiled apps, the native "Menu" icon is not visible anymore, even after touching the bottom bar. In AIR 2.6 you could see and press that button (which can be captured from AIR so you can show a custom settings menu or whatever).
    So, quoting the subject --> How can you enable back the Android native Menu button in AIR 2.7?

    There is a work around and a reason for the menu issue.  Honeycomb doesn't natively support a menu softkey, it is only to support old apps comiled in phone API levels.  If you compile a Honeycomb app in 2.7 or 3.0, it is expected you manage the settings within the larger tablet UI framework.  See below link for more info and work around. 
    http://forums.adobe.com/message/3964792#3964792

  • Native process execution problem in mac os

    hi,
         In my flex application i have to get mac serial  number as a unique id for each system . On searching i got one terminal command to get serial number. For that i have  run terminal command through flex native process. I have set supportedprofile as <supportedProfiles>extendedDesktop desktop</supportedProfiles> in app xml. But when i install and run application on mac terminal is getting opened but command is not executing. I couldn't trace out the problem.  I could execute cmd in windows and that worked . Please help me to findout a solution................... The test code is adding below
    private var process:NativeProcess
    =
    new NativeProcess();
    protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
                    // TODO Auto-generated method stub
                    if(NativeProcess.isSupported) {
                        Alert.show("Yes NativeProcess");
                        process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutput);
                        process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onIOError);
                        process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, onIOError);
                        process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, onIOError);
                        process.addEventListener(NativeProcessExitEvent.EXIT,onIOError);
                        var info:NativeProcessStartupInfo     =     new NativeProcessStartupInfo();
                        info.executable                               =     new File("/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal");
                         /*  var startupArgs:Vector.<String>    =     new Vector.<String>();
                             startupArgs[0]                              =    'system_profiler |grep "r (system)" '; 
                             info.arguments                              =    startupArgs;*/
                        //Alert.show(String(info.arguments.length));
                         process.start(info); 
                        process.standardInput.writeUTFBytes('system_profiler |grep "r (system)" '+ "\n");
                    }else
                        Alert.show("No");
                protected function onIOError(event:IOErrorEvent):void
                    // TODO Auto-generated method stub
                    Alert.show("Error");
                protected function onOutput(event:ProgressEvent):void
                    var processID:String            =    process.standardOutput.readMultiByte(process.standardOutput.bytesAvailable,"");       
                    Alert.show("Path : " + processID );
    I have tried to set arguments but didn't execute......
    Message was edited by: aswathykrishnan

    Hello Aswathy, these days I'm also coding an application which uses AIR NativeProcess and I required to open the MacOS terminal with some parameter/commands. I also eventually turn to the AppleScript, but I considerably new to the AppleScript, yet trying to findout a way to passing parameters (the command argument) to the AppleScript; the appleScript I managed to open but not passing the argument. Can you please help? here's my some probable codes for the application:
    My appleScript is:
    #!/bin/bash
    on run argv
              tell application "Terminal"
                        set currentTab to (do script) & item 1 of argv
              end tell
    end run
    I've packaged the appleScript as an Application (Contract.app) and here's my Flex code:
    var npInfo : NativeProcessStartupInfo = new NativeProcessStartupInfo();
    npInfo.executable = new File( "/Applications/Contract.app/Contents/MacOS/applet" );
                                  var arg:Vector.<String> = new Vector.<String>;
                                      arg[0]="ssh [email protected]";
                                  npInfo.arguments = arg;
                                  process = new NativeProcess();
      process.start( npInfo );
    Can you please help?
    Thank you.

  • Native Process works OK in FlashBuilder 4.6 'run' but won't export build

    Hi,
    I have a small application that uses the 'native process' feature to invoke Image Magick to process an image file. My environment is Widows 7/64 bit.
    The application runs perfectly within FlashBuilder 4.6 using the 'run' facility and with 'supported profiles' set to 'extendedDesktop' in the -app.xml file.
    But when I try to export-build it, I get an error message (306) listing the supported profiles but extendedDesktop is not one of them.
    I have also tried to package this using the native Flex 4.6 SDK but the same error occurs.
    If I add 'desktop' to the supported profiles, the application will export build, and then allows the creation of the exe from the air file.
    But the exe will not run and just 'hangs' once you get to the point where the native proessing is invoked.
    The native process documentation says that extendedDesktop is required so the application using 'desktop' perhaps understandably 'hangs'.
    Any assistance with this will be most appreciated.

    OK, found the problem - I need to export-build the app as 'signed native installer' not 'signed AIR package'.
    Thanks to the answer to a similar problem in this forum from 2010.

  • Error in 'Native process' project in AIR2.0 samples

    Hi,
    I am getting following errors in my Flex Builder-3 while compiling "Native Process" project in AIR2.0 samples:
    1046: Type was not found or was not a compile-time constant: NativeProcess.
    1046: Type was not found or was not a compile-time constant: NativeProcessStartupInfo.
    1119: Access of possibly undefined property STANDARD_ERROR_DATA through a reference with static type Class.
    1119: Access of possibly undefined property STANDARD_OUTPUT_DATA through a reference with static type Class.
    1120: Access of undefined property NativeProcess.
    1180: Call to a possibly undefined method NativeProcess.
    1180: Call to a possibly undefined method NativeProcessStartupInfo.
    I am using Flex4 sdk (flex_sdk_4.0.0.13875). What needs to be done in this case?
    Regards
    Bsg12

    Hi there, have you integrated the AIR 2.0 SDK with your Flex 4 SDK? It is needed to run the AIR 2 samples. It's not yet included in the Flex 4 SDK.
    You can download the SDK here: http://labs.adobe.com/downloads/air2.html
    and the instructions for how to integrate it with your Flex 4 SDK are listed in the release notes (or here: http://labs.adobe.com/wiki/index.php/AIR_2:Release_Notes)
    Hope that helps!!
    Holly

  • Native Process Not Supported in Flash Builder 4.1

    Hi,
    I am using Flash Builder 4.1 and I am trying with native processing with the example from http://www.adobe.com/devnet/air/flex/quickstart/articles/interacting_with_native_process.h tml. When I tried to run the project in Flash Builder, it shows "NativeProcess not supported.". However, after I export release build, the application is working properly.
    How can I have the native process to be able to run in Flash builder? So that it will be easier for me to test and troubleshoot the application. Thanks.

    You need to add the following line in your  ***-app.xml file for debugging mode
    <supportedProfiles>extendedDesktop</supportedProfiles>
    and
    <supportedProfiles>extendedDesktop desktop</supportedProfiles>
    for release build

  • How to set the Native Process Installer generatedFile.exe's icon

    hi
    i have made the (Native Process packaged) .exe by using adt command
    how can i change the default icon to the desiered one
    thanks,
    Dhaivat

    Ah I see what you mean now.  Unfortunately, this isn't available directly through AIR.  However, there are third party utilities on Windows that will allow you to modify the icon resources and it should be simple enough on Mac through File Info.
    If you'd like to see this functionality added to AIR, I'd like to suggest you add a feature request to our ideas.adobe.com page.
    Thanks,
    Chris

  • Native Process running from Flash Builder but not from the installed exe

    I have created an AIR application to launch a native process. The   application works fine when tested in Flash Builder but doesn't runs   when I create and AIR  installer and run the installed exe. Any idea  what might be wrong?

    Have you created a native installer instead of just an AIR file.
    -ted

  • Running native processes internally

    Just like Eclipse runs javaw.exe without the java process appearing in the processes list, and air apps probably do the same with the air runtime.
    is it possible to do the same with air apps to run other processes?
    for example im thinking of writing a java jar app which mediates a java socket and building a as3 class which simulates the socket class (when actually its just using native process), but i dont want the air app to apear to be running 2 processes.
    how can i do this?
    thank you
    marcidus

    are both your variabels called name? in the same scope??
    Robert

Maybe you are looking for

  • How to Block Bill of material.

    Dear  Sirs, Following is the scenario. Some of our Bill of materials are Imported.  These BOM are exclusively procured to manufacture certain Finished Products.   I would like to know how these BOM can be blocked or  how i can block the issue of thes

  • Change file access in FTP

    Hi, i'm new in java and i'm trying to make a program that moves a file to a FTP server, I already made that part of the program. but i'm having problems finding the way of change the access of the file, when was already moved it. This is an example o

  • I can't get my iTunes together with my Library onto my new user.

    I am having a lot of difficulty getting my iTunes together with my Library onto my new user that I just created on my XP. I can get my iTunes and Library folders over there, but once there, I can neither open my Library nor put it onto my iTunes. I a

  • Tried sending via a list (contains my own address twice), send folder is updated, no email returned, no error messages returned

    T'bird 32.1.0. I send a newsletter each week to 3 different mailing lists. (my own address is on first list.) Today I got no error messages. Sent folder contained confirmation copies. No one received a copy. I created a new list, 2 entries - both my

  • Promise RAID problems

    Hi all, I was wondering if anyone on the list had problems with the Promise RAID. My system is a 875P Neo. The two SATA drives are Seagate ST2380023AS. The system shas been wrking fone for about a month than troubles started. My system is updated to