[AIR] communicates with a local process (application)

Source: Internet
Author: User

It's no exaggeration to say that this feature encapsulates the Windows command-line program (Cmd.exe) through an air app and directs it to do whatever you want.

AIR2.0 and above interact with local processes mainly in the following areas:

    • Start the process and provide the initial parameters

    • Writing data to a process

    • Read the output data of the process

Of course, Adobe always puts the security factor at the forefront of the platform's runtime. If you want your air app to be able to interact with the local process, you need to be aware of the following limitations:

  • Must be deployed through the installation tools of the operating system and cannot be installed directly using the air package (air is a cross-platform file format).

  • Processes that are located in the current Air application folder cannot be started.

  • The air application description file must indicate that Supportprofiles is extendeddesktop (or that the parameter is indicated by using the Air Command-line tool).

    varNativeprocess:nativeprocess =Newnativeprocess ();varNpsi:nativeprocessstartupinfo =Newnativeprocessstartupinfo ();varFile:file = File.resolvepath ("C:/Program files/Digital Whiteboard Lesson Release tool/zpack.exe"); Npsi.executable= file;//npsi.workingdirectory = file.desktopdirectory;varArgs:vector.<string> =NewVector.<string>; Args.push ("C:/users/johun/desktop/desktop.zpack");//to pass the parameter to the ZPack.exe applicationArgs.push ("e:/");//to pass the parameter to the ZPack.exe applicationnpsi.arguments=Args;nativeprocess.start (NPSI);/*When AutoExit is true (the default value), if all windows are closed, the application terminates. Dispatches the exiting and exit events. If AutoExit is false, you must call NativeApplication.nativeApplication.exit () to terminate the application. */NativeApplication.nativeApplication.autoExit=true;

    Note : The-app.xml generated at publish time needs to be <application xmlns= "http://ns.adobe.com/air/application/2.6" > followed by < Supportedprofiles>extendeddesktop </supportedProfiles>

[AIR] communicates with a local process (application)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.