2 Replies Latest reply on Sep 1, 2011 2:57 PM by anynick

    Native process calling exe with admin role

    frcol

      Hi,

      I´m developing an AIR extended desktop application that call some executables (.exe) and receive data from them via STDOUT.

       

      problem: I must call a executable with admin privilegies and receive data from it.

       

      Does anybody faced this problem?

       

      I developed another C# Console application that uses manifest to run under admin privilegies and this console app call my desired executable. It opened, but it´s not sending data via STDOUT to AIR .

       

      any suggestion will be very welcome.

       

      thanks.

        • 1. Re: Native process calling exe with admin role
          frcol Level 1

          Another information:

           

          If i call this Console app with manifest direct from AIR, it shows me a message telling that I need elevation to run it.

          So I need to call it from AIR calling the "cmd.exe" (cmd /C RunAsAdmin.exe), then it show the window asking to run under admin privilegies and then the real application.

          • 2. Re: Native process calling exe with admin role
            anynick

            I ran into the extact same problem. When you launch a program using cmd.exe from AIR you are hooking the stdout for cmd.exe instead ofthe program launched by cmd.exe.

             

            The only way I accomplished what you are trying to do is to write 2 separate C# apps. The first does not require admin rights and AIR will launch this app and listen for the stdout. The first app then launches the second app (which does require admin rights) and connects to it via a created named pipe. So the second app writes out to the created named pipe, the first app recieves the info and writes it to stdout, AIR then receives the info and you can finally get some sleep.

             

            Ridiculous? YES!

            Does it work? YES!