Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create updater for AIR application bundled with captive runtime?

What would be the logic of updating mechanism for AIR application with captive runtime? Application should be distributed for Windows and Mac.

I got stuck here:

Note that this does not necessarily mean that you need to implement your own auto-update mechanism. If you use a commercial tool to create your installer, it may include auto-update mechanisms that you can leverage. On the other hand, if you do need to write your own update mechanism, you should find the URLStream, File, and NativeProcess APIs handy in implementation.

after reading it at: http://www.adobe.com/devnet/air/articles/air3-install-and-deployment-options.html

Is it something like (for Windows, after app is installed with some .exe or .msi installer):

  1. upon starting app, check for new version
  2. if there is new version, download it
  3. overwrite existing app files and AIR runtime files

It should be forced update, before starting app.

How to overwrite running app? Or to make another app (updater) for replacing files, and after that start main app with NativeProcess?

like image 951
Nemi Avatar asked Mar 02 '12 12:03

Nemi


2 Answers

For Windows I use the Native Application Updater

http://code.google.com/p/nativeapplicationupdater/

and WinRAR SFX archive (.exe) to auto update my captive runtime apps.

Native Application Updater will check the version, download your new exe, close your app and run that new exe.

In the SFX options:

I use absolute path, something like: %USERPROFILE%\AppData\Local\com\thenewkid\appname\

Under "Modes" you can select "Hide All" in Silent Mode. Under "Setup" you get it to run your application.exe after extraction.

You can keep the update size low by removing the Adobe AIR folder until a new version of the SDK becomes available (i.e. just had to push a larger update out recently for 3.3)

For MAC I use Installer. It isn't as silent as the Windows Updater as the user will have to click through a couple installer prompts but it allows you to put it in their home directory so administrative privileged aren't required which is what I find the most useful aspect of captive runtime.

like image 63
thenewkid Avatar answered Oct 20 '22 06:10

thenewkid


Basically, you should have your app point to some XML file on your server which will contain things like newest version number, path to new files on server etc.

You can use a separate app to do the restart but keep in mind that since you are using Captive Runtime this will mean another 40-60MB just for the updater (unless you use some non-recommended hacks).

It would probably be better to just prompt the user to restart after you download the update.

The trick is not to overwrite the EXE but instead to overwrite the SWF (and any other files that need updating). From what I can tell, the EXE is simply a pointer to the XML manifest and the SWF.

You should not be updating AIR runtimes file every time - only for critical updates (since they are large files).

like image 41
Pixel Elephant Avatar answered Oct 20 '22 05:10

Pixel Elephant