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)