4 Replies Latest reply on May 31, 2011 5:42 AM by kid electric

    AIR NativeProcess "not supported" + trouble with arguments, Vector.<String>

    kid electric

      I am attempting to create an AIR app that will run a command-line (extendedDesktop) style call on a .exe file with an argument passed to it.

       

      I followed the example setup as outlined on this Adobe reference page. However, when I try to create a Vector.<String> I get the error "Error #1007: Instantiation attempted on a non-constructor."

       

      This is occurring at the following line:

       

      var processArgs:Vector.<String> = new Vector["<String>"]();

       

       

      I also tried it without the arguments declaration and simply calling the .exe without any arguments, and I get the error "The NativeProcess could not be started. 'Not supported in current profile.'"  I have multiple supportedProfiles set up in my file (including desktop and extendedDesktop) but not sure how to test/debug the file within Flash Builder with extendedDesktop rights.

        • 1. Re: AIR NativeProcess "not supported" + trouble with arguments, Vector.<String>
          Peter Blazejewicz Level 4

          Hi,

           

          that's not correct syntax for Vector (with <String>s),

          it should be e.g.:

          var arguments:Vector.<String> = new Vector.<String>();

           

          Arguments are only required to be set if your native process is expected to pass command line arguments: then for each required (switch/value/special char) you add each as token to arguments, e.g.:

          var arguments:Vector.<String> = new Vector.<String>();

          arguments.push("-a");

          arguments.push("TourDeFlex");

          or:

          var arguments:Vector.<String> = new Vector.<String>();

          arguments.push("/Applications/TourDeFlex.app");

          but you use arguments only if executable requires them.

           

          You need extended desktop profile (during authoring) and native installer for deployment.

           

          hth,

          regards,

          Peter

          1 person found this helpful
          • 2. Re: AIR NativeProcess "not supported" + trouble with arguments, Vector.<String>
            kid electric Level 1

            Doh! Thank you. That fixed the instantiation problem for the string vector.

             

            You state I need extended desktop profile during authoring. Is this something I can set within Flash Builder?  I'm aware that for deployment I will need to package it as a native executable (.exe in my case), but I was under the impression I would be able to test/debug without packaging first, so I'm not sure how to set my current authoring profile as extended desktop. I have the sneaking suspicion that it is set as standard Desktop.

             

            EDIT: Never mind, under File-->Properties I found the setting to switch from desktop to extendedDesktop profile.  However, now I am getting this error:

             

            "The NativeProcess could not be started. 'The requested operation requires elevation."

             

            Any ideas? I'm assuming this has to do with UAC (Windows 7), and is very annoying because I want to be able to deploy this app to machines that will likely have UAC enabled.

             

            In the meantime, I may try "openWithDefaultApplication" as recommended in this thread: http://forums.adobe.com/message/3094680

             

            I'm just not sure what the "default application" for opening a .exe is. this isn't an mp3 or Word document here, it's an executable in its own right (more specifically, it is Carl Kenner's GlovePIE interface for accessing various bluetooth devices such as Wiimote; so I am trying to trigger a command-line execution to open the GlovePIE script loader/editor and automatically load/start the appropriate GlovePIE script)

            • 3. Re: AIR NativeProcess "not supported" + trouble with arguments, Vector.<String>
              Peter Blazejewicz Level 4

              Hi,

              I believe Adobe's docs are not clear on "NativeProcess" requirements during authoring. The all articles/docs you could find via search mentions that one needs to make sure that descriptor is edited to contain:

              <supportedProfiles>extendedDesktop</supportedProfiles>

              e.g.; http://www.adobe.com/devnet/air/flex/articles/air_screenrecording.html

              while it seems to be required only for deployment build to make sure that application is built into "extended" profile that enables native installer and accessing native process.

              Anyway running from Flash Builder with built-in adl integration should allows you to test I believe (as I had never to manually modify descriptor during authoring/tests).

              I'd suggest you to make sure that all things are built as expected and start new thread on authoring issues with Flash Builder and adl (as it seems it does not run in correct privileges - so you are not able to test/author some features). I assume you're using admin-type account on your machine (and Flash Builder was installed and then run under the same account).

              (note: I'm using Mac)

              regards,
              Peter

              • 4. Re: AIR NativeProcess "not supported" + trouble with arguments, Vector.<String>
                kid electric Level 1

                Yes, I will need to try packaging it and installing it natively to see if I get the same issue (due to UAC) as I do in the testing environment.

                 

                I was able to get this to work with "openWithDefaultApplication()" in extendedDesktop mode (allowing me to execute a batch file to call the command line binary and pass it arguments/parameters), but even then I get a warning message popup window where you have to click to confirm you are okay with the program running. This wouldn't be a huge issue, except I am designing a program to be used by 6 year old children, and they are going to be clueless if they have to deal with that so my only alternative would be to include installation directions to force people to lower security settings or disable UAC, I'm sure neither of which people are going to want to do.

                 

                Microsoft really bugs me sometimes (unfortunately Macs bug me even more -- and the speech recognition engine I am calling does not run on Mac. Although I have to say that, for my current application, Mac OS's "say" terminal command for quick TTS would come in extremely handy)

                 

                But I digress... thanks for your useful answers. And to answer your question, yes I am Admin, with Flash Builder/Flex installed and running as admin