简体   繁体   中英

How to run file .exe by air?

this is my cod:

  var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();

  var file:File = File.desktopDirectory.resolvePath("android.exe");
  nativeProcessStartupInfo.executable = file;
  var myAppProcess = new NativeProcess();
  myAppProcess.start(file);

It does not work.

please help me thanks.

Have you checked if NativeProcess is supported?

if(NativeProcess.isSupported)
    setupAndLaunch();
else
    trace("NativeProcess not supported.");

The NativeProcess class and its capabilities are only available to AIR applications installed with a native installer (extended desktop profile applications). When debugging, you can pass the -profile extendedDesktop argument to ADL to enable the NativeProcess functionality. At runtime, you can check the NativeProcess.isSupported property to to determine whether native process communication is supported.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM