views:

260

answers:

3

Hello,

Is it possible to get list of installed AIR applications, optionally only by one vendor?

Or, is it possible to check, whether is one application (checked by name/some id/vendor) installed (this method would be preferred)

Thank you.

+1  A: 

This is an interesting question. I don't think there are any places on the client's computer where Adobe is storing a list of AIR apps installed on the computer, but you may be able to find it via airdownload.

Another decent alternative would be to use Adobe AIR 2.0's Command Line Integration feature. With that you could write an OS-dependent, yet fairly simple, script (shell, ruby, python, etc.) that recursively checked some directories for .AIR files by name, and if they weren't found, your startup app could say "Sorry we haven't found these two apps: X and Y. Please either specify their location or download them here". And after they specified the install path, you could infer where they might have other AIR apps installed.

Or you could install a text file in their home directory with a list of the AIR apps you have installed and read that to figure out what steps you should take next. That would probably be easier.

Hope that helps, Lance

viatropos
text file seems like doable option - I don't know, however, if there isn't any other. I think I'll try Google with rephrased searches, thank you for ideas though.
Adam Kiss
A: 

If you know the appID and the publisherID, adobe.utils.ProductManager might have something magical for you... but productManager is such a poorly documented class that I'm going to guess that my suggestion is a dead-end. I used it once for something and as I recall, because of the package location, I didn't get any code insight and it was a very trial-and-error process.

jeremym
+2  A: 

You can do this:

        private function loadAIR():void
        {
            var loader:Loader = new Loader();
            var loaderContext:LoaderContext = new LoaderContext();
            loaderContext.applicationDomain = ApplicationDomain.currentDomain;
            loader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
            loader.load(new URLRequest("http://airdownload.adobe.com/air/browserapi/air.swf"), loaderContext);
        }

        private function onInit(e:Event):void
        {
            var air:Object = e.target.content;
            try
            {
              air.getApplicationVersion("appID", "publisherID", versionDetectCallback);
            }
            catch (e:Error)
            {
              trace('air not installed');
            }
        }

        private function versionDetectCallback(version:String):void
        {
            if (version == null)
            {
                trace('app not installed');
            }
            else
            {
                trace('app version ' + version + ' installed');
            }
        }
James Ward
Some Adobe docs on the `air.swf` James uses here: http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.html
Michael Brewer-Davis
That's awesome!
Adam Kiss
very cool, can't wait to try it.
viatropos