Skip to main content
Participating Frequently
June 18, 2013
Question

How to download new modules to desktop air app

  • June 18, 2013
  • 1 reply
  • 758 views

Hello,

I'm developping a air desktop app that acts as a library and connects to a server to download games and such.

I'm wondering what the best approach would be for the dowloading and installing of the games. Would using a byteArray be a good start ? I'm thinking of publishing the games themselves as Air applications. Can an Air application contain other Air apps.

I can't seem to find alot of documentation regarding this.

Cheers,

This topic has been closed for replies.

1 reply

Ollie Edge
Inspiring
June 19, 2013

Hey Joseph,

Sound like your creating some sort of "App Store" and you want to be able to run the "apps" that you download.

ByteArray would not be the option I would go for on this one. There are a load of FileDownloader classes available on the net, just google AIR FileDownloader, to save time here is one I found:

http://stackoverflow.com/questions/342994/download-a-file-with-adobe-air

--

Once you've got the file downloaded, you need to run it. "AIR apps" cannot contain other "AIR Apps", however AIR can download a .air file and save it to the application storage directory. AIR can execute files within it's own directory, thus leading me to the next phase:

File.openWithDefaultApplication()

Your AIR application can run a ".air" file. As these are usually the installers of the apps you'll need, you can do a check to see if the application is already installed on the machine and if so, run it without having to run the .air file.

--

These two methods used in-conjuctionwith each other should give you a good start.

Hope that helps,

O.

Participating Frequently
January 6, 2014

Thanks Ollie,

Your suggestions where a great help.

But now I'm actually wondering if it's wise to publish the game modules as Air files (the modules that are being downloaded and references added to the main destop app). My main concern is that the user will be able to choose where to install each new module, I'd prefer to keep everything in the main app storage directory.

So I'm thinking of using SWFs instead for the modules, and opening the up in a new NativeWindow.

Do you know of any limitations concerning this technique ? Will my downloaded SWFs be able to comunicate with the main App.

Or would it be possible to force the user to install all air modules to the same directory ?

Again, thank you for your previous answer, it's been a while but I've only just begun this part of the app.

Cheers !