Air sub applications

被刻印的时光 ゝ 提交于 2019-12-24 01:37:29

问题


Hi Is it possible for an Adobe Air application to install, upgrade and execute other Adobe-Air files.

The basic use case is for a launcher application. It launches and manages other applications at user request, however doesn't need to install the runtimes until such a point as the user intends to execute it.

EDIT: A good starting point may be in this question AIR App that Loads and Runs Existing AIR swf

EDIT I'm going to cross post this to flexcoders though I'm not really happy with doing it.


回答1:


AIR 2.0, when installed with the extended desktop profile (native installers) can use the NativeProcess class to control any application on the system, monitor its commandline feedback, and terminate as needed. Extremely basic example below:

import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;

if (NativeProcess.isSupported) {
    var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();
    var processpath:File = File.applicationDirectory.resolvePath("MyApplication.whatever");
    var process:NativeProcess = new NativeProcess();

    npsi.executable = processpath;
    process.start(npsi);
}

You should additionally be monitoring specific IO events, error events, the exit event, and you can also provide command line arguments in the NativeProcessStartupInfo object. As for installing, that might be tricker, because AIR has a graphical installation process and I haven't experimented with it that much, but it should be able to run an installer.

AIR applications can also provide a custom upgrade interface; however, I don't think another AIR application can manage that task. Given that AIR apps upgrade themselves fairly seamlessly, that could be left as is.




回答2:


Have you tried File.openWithDefaultApplication()?



来源:https://stackoverflow.com/questions/3275746/air-sub-applications

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!