`
hehailin1986_163.com
  • 浏览: 151175 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

AIR 2.6 NativeProcess is not supported

阅读更多
使用Flex AIR2.6开发桌面程序,添加程序自己重启或启动其他exe程序, 发现NativeProcess.isSupported一直为false。除了配置文件中<supportedProfiles>extendedDesktop</supportedProfiles>,还需要在发布的时候勾选Export as:
Signed native installer, 而不是Signed AIR package.

源代码:

NativeApplication.nativeApplication.autoExit=true;       
var appFile:File = File.applicationDirectory.resolvePath("AIRSelfReStart.exe");
var str:String = appFile.nativePath;	
file = file.resolvePath(str);
var np:NativeProcessStartupInfo = new NativeProcessStartupInfo();
np.executable = file;
var process:NativeProcess = new NativeProcess();
process.start(np);
this.close();


开发环境 Flash Builder, SDK4.5

以下是AS3 API中对NativeProcess.isSupported的说明:
表示在当前的配置文件中是否支持运行本机进程。仅当在 extendedDesktop 配置文件中运行时,此属性才返回 true。此外,对于作为 AIR 文件安装的应用程序,NativeProcess.isSupported 始终为 false。您必须使用 ADT -target native 标志将 AIR 应用程序打包,才能使用 NativeProcess 类。

仅记录学习之用
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics