views:

2031

answers:

4

-How can I check for a new version of my application upon installation?

I feel like I remember installing an AIR application and during the install being alerted that there is a new version, and a prompt as to whether or not I wish to update.

-How do I alert the user, via textfield, that there is an update for the application and to run the "Check for updates" option?

I do not want to force the check for updates, ApplicationUpdaterUI, I want to notify users that there is a new version, and then allow then to bring up the ApplicationUpdaterUI.

Currently, upon initialization the application is popping the "Check for updates" dialog box. I would greatly appreciate some insight on either of these two questions.

I would like to note that I am developing using FlashDevelop3 RC2 and Flex 3 SDK which contains the AIR SDK and the AIR Update Framework.

Brian Hodge
blog.hodgedev.com

+1  A: 

I don't think you can check for updates during installation. What you could do is install a basic shell app that always loads in the actual application as a swf file. You could even download this swf file the first time the app is run. After that you can always check for a new version of the app (swf) and download/update accordingly.

Luke
+1  A: 

This link might be useful: Adding auto update features to your AIR application in 3 easy steps

grapefrukt
Thanks, but I am already using the framework and can use the AppicationUpdaterUI. I want to know specifically know if you can check for updates upon install, and how to check for updates without end-user interaction, presenting them with a string of text saying an update is avail.
Brian Hodge
A: 

Hey Brian,

Hope this helps... During install - NO - you really can't run anything if you're using the standard AIR installer. You can move to a custom installer - but that's a much more work.

However, when you're first invoked - when your application starts - you can check then (and you can check as often as you want thereafter ).

The guy you want to see is ApplicationUpdater instead of ApplicationUpdaterUI. Using ApplicationUpdater you can get all of the checking / downloading / etc... But then display ANY or NO UI - of your own.

For example - you can check for updates, download them of you determine they are needed and on next 'start' of your application - you can literally 'install' all without asking the user.

I don't recommend this... But it's possible.

Fitting the scenario you asked above - you can check for updates, determine if the update is needed (comparing version or whatever) and then notify the user any way you want - as subtle as you want - to ask the user to update.

You can also do this with ApplicationUpdaterUI - you just need to turn all of the UI stuff OFF (which sort of defeats the purpose of using the UI guy) and just catch the events and display your own UI --- like:

_applicationUpdater.isCheckForUpdateVisible = false; _applicationUpdater.isDownloadUpdateVisible = false; _applicationUpdater.isDownloadProgressVisible = false;

Hope that helps.

Gabriel
Thanks for your input. I actually already use ApplicationUpdater and implement my own UI with some preventDefault() usage. This still doesnt provide me with a way to check for updates upon the package install, it merely allows me to check once the package has been successfully installed and ran.
Brian Hodge
A: 

I think your best bet here is to either:

a) Make sure the .air package that people are installing is always the latest version (this may not be possible if you're distributing an app on solid media, like CDs)

b) Make the update process the first thing that happens in the application (i.e. don't show your primary UI until you've checked for an updated version / shown them the update UI)

However, if you contact Adobe, you can get permission to use a bundled installer which can install both AIR and your application in a non-standard way (e.g. through InstallShield). With this method, you could do pretty much anything you wanted when the app installed, including running a simple script which would check whether they have the latest version.

You can check out http://www.adobe.com/devnet/air/articles/distributing_air_in_enterprise_02.html for a bit more info about bundled installation.

Chris R