tags:

views:

73

answers:

2

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 http://stackoverflow.com/questions/2294091/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  A: 

Have you tried File.openWithDefaultApplication()?

Zárate
+2  A: 

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.

Tegeril
Sorry I was away when this reply came in. I think this is a useful answer sorry I didn't get to accept it.
Wes
No worries, glad it was of use :)
Tegeril

related questions