首页 > 代码库 > AIR打开创建进程的两种方式

AIR打开创建进程的两种方式

写在这里,方便查阅

NativeApplication.nativeApplication.autoExit = true;// 主窗体关闭也跟着关闭

Debug.trace(‘ToursLocalConnection :: appExePath = ‘ + appExePath);
currFile = new File(appExePath);
//currFile = new File("C:/Users/lenovo/Desktop/LZPC_Test/LZPC/uninstall.exe");
Debug.trace(‘ToursLocalConnection :: currFile.nativePath = ‘ + currFile.nativePath)
//currFile.openWithDefaultApplication();
nativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = currFile;
nativeProcess = new NativeProcess();
nativeProcess.start(nativeProcessStartupInfo);

 

var file:File = File.documentsDirectory.resolvePath(installPath + ‘uninstall.exe‘);
trace(file);
file.openWithDefaultApplication();