air.updateApplicationUpdater The ApplicationUpdater class defines the basic functionality of the update framework for Adobe® AIR® applications, without providing any default user interface.flash.events:EventDispatcher The ApplicationUpdater class defines the basic functionality of the update framework for Adobe® AIR® applications, without providing any default user interface. (The ApplicationUpdaterUI class includes update functionality and a default user interface.)

This class is included in the applicationupdater_ui.swc file, included in the Adobe AIR SDK. The applicationupdater_ui.swc file is in the frameworks/libs/air directory of the AIR SDK.

Adobe® Flex™ Builder™ loads this class automatically when you create a project for Adobe AIR. You should include the SWC file when compiling the application using the Adobe® Flex™ SDK.

Managing updates of applications can be complicated. The AIR update framework provides APIs to assist developers in providing good update capabilities in AIR applications. The functionality in the AIR update framework assists developers in the following:

  • Periodically checking for updates based on an interval or at the request of the user

  • Downloading AIR files (updates) from a web source

  • Alerting the user on the first run of the newly installed version

  • Confirming that the user wants to check for updates

  • Displaying information on the new update version to the user

  • Displaying download progress and error information to the user

The AIR update framework lets you store information about the update version of an AIR application in simple XML configuration files. For most applications, setting up these configuration files and including some basic code provides good update functionality to the end user.

Use the AIRUpdater class if you want to define your own user interface for use with the AIR update framework.

The update process includes a sequence of states. The currentState property of the updater object reflects the current state of the updater:

currentState value Description "UNINITIALIZED"The updater has not been initialized."INITIALIZING"The updater is initializing."READY"The updater has been initialized"BEFORE_CHECKING"The updater has not yet checked for the update descriptor file."CHECKING"The updater is checking for an update descriptor file."AVAILABLE"The update descriptor file is available."DOWNLOADING"The updater is downloading the AIR file."DOWNLOADED"The updater has downloaded the AIR file."INSTALLING"The updater is installing the AIR file."PENDING_INSTALLING"The updater has initialized and there are pending updates.

When testing an application using the AIR Debug Launcher (ADL) application, attempting to update the application results in an IllegalOperationError exception.

The AIR update framework is only supported in the desktop profile. It is not supported for extended desktop applications (applications installed with a native installer), and it is not supported on the mobile profile (iPhone applications written with ActionScript 3.0). Check the Updater.isSupported property at runtime to see if the update framework is supported.

For details on using the AIR update framework, see the "Updating AIR Applications" chapter of Developing Adobe AIR Applications with Adobe Flex.

For details on using the AIR update framework, see the "Updating AIR Applications" chapter of Developing Adobe AIR Applications with Adobe Flash.

ApplicationUpdaterUIflash.desktop.Updatererror Dispatched when an error occurred either during initialization or during the update process (if something unexpected happens).flash.events.ErrorEvent.ERRORflash.events.ErrorEvent Dispatched when an error occurred either during initialization or during the update process (if something unexpected happens). progress Dispatched as the update file is downloaded.flash.events.ProgressEvent.PROGRESSflash.events.ProgressEvent Dispatched as the update file is downloaded. fileUpdateError Dispatched when an error occurs validating the file passed as the airFile parameter in a call to the installFromAIRFile() method.air.update.events.StatusFileUpdateErrorEvent.FILE_UPDATE_ERRORair.update.events.StatusFileUpdateErrorEvent Dispatched when an error occurs validating the file passed as the airFile parameter in a call to the installFromAIRFile() method. fileUpdateStatus Dispatched after the updater successfully validates the file in the call to the installFromAIRFile() method.air.update.events.StatusFileUpdateEvent.FILE_UPDATE_STATUSair.update.events.StatusFileUpdateEvent Dispatched after the updater successfully validates the file in the call to the installFromAIRFile() method. downloadError Dispatched if there is an error while connecting or downloading the update file.air.update.events.DownloadErrorEvent.DOWNLOAD_ERRORair.update.events.DownloadErrorEvent Dispatched if there is an error while connecting or downloading the update file. It is also dispatched for invalid HTTP statuses (such as 404 - File not found).

When this event is dispatched the periodic timer is automatically restarted (if the delay is greater than 0).

updateError Dispatched if an error occurs while trying to download or parse the update descriptor file.air.update.events.StatusUpdateErrorEvent.UPDATE_ERRORair.update.events.StatusUpdateErrorEvent Dispatched if an error occurs while trying to download or parse the update descriptor file.

When the updater dispatches this event, the periodic timer is automatically restarted (if the delay setting is greater than 0). The application should consider hiding any error dialog boxes when the updater dispatches a new checkForUpdate event.

updateStatus Dispatched after the updater successfully downloads and interprets the update descriptor file.air.update.events.StatusUpdateEvent.UPDATE_STATUSair.update.events.StatusUpdateEvent Dispatched after the updater successfully downloads and interprets the update descriptor file.

The default behavior is to start downloading the update if the available of the available property of the StatusUpdateEvent object is set to true. The default behavior can be prevented only when using the ApplicationUpdater class, not when using the ApplicationUpdatorUI class..

beforeInstall Dispatched just before installing the update, after the installUpdate() method was called.air.update.events.UpdateEvent.BEFORE_INSTALLair.update.events.UpdateEvent Dispatched just before installing the update, after the installUpdate() method was called. Sometimes, it is useful to prevent the installation of the update at this time, because the user could lose all current work when the runtime exits the application to install the update.

Calling this event's preventDefault() method postpones the installation until the next restart. If you call the preventDefault() method, no additional update process can be started during this application session (via a call to the installUpdate() method or because of the periodic check).

The default behavior for ApplicationUpdater library is to download the update descriptor file. You can call the preventDefault() method to cancel this behavior.

downloadComplete Dispatched when the download of the update file is complete.air.update.events.UpdateEvent.DOWNLOAD_COMPLETEair.update.events.UpdateEvent Dispatched when the download of the update file is complete.

Usually this event is used to display a message asking if the user wants to proceed with the installation of the update.

The default behavior for the the ApplicationUpdater library is to automatically call the installUpdate() method.

downloadStart Dispatched after a call to the downloadUpdate() method and the connection to the server is established.air.update.events.UpdateEvent.DOWNLOAD_STARTair.update.events.UpdateEvent Dispatched after a call to the downloadUpdate() method and the connection to the server is established. When using ApplicationUpdater library, you may want the event handler for this event to display a progress bar to report the download progress to the user. checkForUpdate Dispatched before the update process begins, just before the updater tries to download the update descriptor file.air.update.events.UpdateEvent.CHECK_FOR_UPDATEair.update.events.UpdateEvent Dispatched before the update process begins, just before the updater tries to download the update descriptor file. The updater can dispatch this event as a result of directly calling the checkNow() method or because the periodic check timer expired. initialized Dispatched after the initialization is complete.air.update.events.UpdateEvent.INITIALIZEDair.update.events.UpdateEvent Dispatched after the initialization is complete. ApplicationUpdater The constructor function. The constructor function. cancelUpdate Cancels the update process. Cancels the update process. Calling this method cancels any pending downloads, deleting any incomplete downloaded files, and restarts the periodic check timer.

The update process can be canceled at any time except when the state machine is in "UNINITIALIZED" or "INITIALIZING" state. It does nothing when it is called in one of the "UNINITIALIZED" or "INITIALIZING" states.

checkForUpdate Asynchronously downloads and interprets the update descriptor file. Asynchronously downloads and interprets the update descriptor file. Calling this method advances the updater state to "CHECKING". Call this method only if the checkForUpdate event was cancelled.

This method only executes when the updater is in the "BEFORE_CHECKING" state.

updateStatusair.update.events:StatusUpdateEventThe updater has successfully downloaded and interpreted the update descriptor file. The updater has successfully downloaded and interpreted the update descriptor file.updateErrorair.update.events:StatusUpdateErrorEventAn error occured while trying to download or parse the update descriptor file. An error occured while trying to download or parse the update descriptor file.
checkNow Starts the update process. Starts the update process. Calling this method does not stop the periodic timer; however, the method detects that an update process is running and will skip the current iteration.

This method only executes if the current state is "READY".

This method can result in the updater object dispatching the following event:

checkForUpdateair.update.events:UpdateEventDispatched just before the update process begins. Dispatched just before the update process begins.
downloadUpdate Asynchronously downloads the update file. Asynchronously downloads the update file. Calling this method advances the state machine to "DOWNLOADING". This method needs to be called only if the StatusUpdateEvent.UPDATE_STATUS event was cancelled when the available property of the event was true.

This method only executes if the current state is "AVAILABLE".

downloadStartair.update.events:UpdateEventDispatched after the connection to the server is established. Dispatched after the connection to the server is established.progressflash.events:ProgressEventDispatched after the initialization is complete. Dispatched after the initialization is complete.downloadErrorair.update.events:DownloadErrorEventDispatched if there is an error while connecting or downloading the update file. It is also dispatched for invalid HTTP statuses (such as 404 - File not found). Dispatched if there is an error while connecting or downloading the update file.
initialize Initializes the updater. Initializes the updater. Calling this method does the following:

  1. It initializes the update framework, silently (and synchronously) installing any pending updates. You should call this method during application startup, since it may restart the application.

  2. It checks if there is a postponed update and installs it.

  3. If something went wrong with a prior update, it clears the update file and version information from the storage area.

  4. If the periodic timer delay has expired, it starts the update process; otherwise it starts the periodic timer. However, when testing an application using the AIR Debug Launcher (ADL) application, attempting to update the application results in a IllegalOperationError exception.

initializedair.update.events:UpdateEventThe initialization is complete. The initialization is complete.errorflash.events:ErrorEventThere is an error during initialization. There is an error during initialization.
installFromAIRFile Starts the update process using a local AIR file.fileflash.filesystem:FileThe local AIR file to install. Starts the update process using a local AIR file.

Calling this method has no effect if an update process is running (if the state is not "DOWNLOADED").

This function is useful for an application that has the customUpdateUI element set to true in the application descriptor file.

When testing an application using the AIR Debug Launcher (ADL) application, calling this method results in an IllegalOperationError exception.

fileUpdateStatusair.update.events:StatusFileUpdateEventDispatched after the updater successfully validates the AIR file. Dispatched after the updater successfully validates the AIR file.updateErrorair.update.events:StatusFileUpdateErrorEventDispatched if an error occurs while trying parse the update descriptor file. Dispatched if an error occurs while trying parse the update descriptor file.
installUpdate Installs the update file. Installs the update file. Calling the method advances the state machine to "INSTALLING" and needs to be called only if the downLoadComplete event was cancelled.

Call this method when the updater is in the "DOWNLOADED" state. Calling it in any other state will do nothing.

When testing an application using the AIR Debug Launcher (ADL) application, calling this method results in an IllegalOperationError exception.

beforeInstallair.update.events:UpdateEventDispatched just before installing the update. Sometimes it is useful to prevent the installation of the update at this time, because the user could lose all current work when the runtime exits the application to install the update. Dispatched just before installing the update.
configurationFile The location of the configuration file that sets the values for delay and updateURL properties.flash.filesystem:File The location of the configuration file that sets the values for delay and updateURL properties. If this property points to a non-existent file, calling the initialize() method results in an Error being thrown.

Here is a sample configuration file:

<?xml version="1.0" encoding="utf-8"?> <configuration xmlns="http://ns.adobe.com/air/framework/update/configuration/1.0" > <url>app:/server/update.xml</url> <delay>1</delay> </configuration>

Instead of loading a configuration file, you can use ActionScript code to set the delay and updateURL properties.

delayupdateURL
currentState The internal state of the updater.String The internal state of the updater. The property can be set to the following values:

  • "UNINITIALIZED"—The updater has not been initialized.

  • "INITIALIZING"—The updater is initializing.

  • "READY"—The updater has been initialized

  • "BEFORE_CHECKING"—The updater has not yet checked for the update descriptor file.

  • "CHECKING"—The updater is checking for an update descriptor file.

  • "AVAILABLE"—The update descriptor file is available.

  • "DOWNLOADING"—The updater is downloading the AIR file.

  • "DOWNLOADED"—The updater has downloaded the AIR file.

  • "INSTALLING"—The updater is installing the AIR file.

  • "PENDING_INSTALLING"—The updater has initialized and there are pending updates.

currentVersion The current version of the application.String The current version of the application. This property is set during a call to the initialize() method. It is set to the version from the application descriptor file. delay The interval, in days, between periodic checks of new updates.Number0 The interval, in days, between periodic checks of new updates.

A value of 0 (the default value) indicates that the timer is not active, so no periodic check is done. This can be set either via this property or via the configuration file. When the value is set using both methods, the value set using the property is used.

isFirstRun Whether this is the first run after a successful update (true) or not (false).Boolean Whether this is the first run after a successful update (true) or not (false). The updater sets this value during the call to the initialize() method. The developer should check that isFirstRun is set to true if there is a need to migrate data from one version to another. wasPendingUpdateisNewerVersionFunction A function that the updater should use to perform version comparisons.Function A function that the updater should use to perform version comparisons. By default, the update framework does a version comparison to detect whether the version from the remote site is newer than the version of the installed application. However, sometimes the default comparison does not match the developer's versioning scheme. Set this property to provide a new function that does the comparison.

The default comparision function accepts versions like x.y.z, where x, y, and z can contain letters and digits. There are some special conditions that the default comparision function recognizes. If the test function finds "alpha", "beta", or "rc" in the version strings, the order is alpha < beta < rc.

The following code defines a custom function, customFn, for the appUpdate updater object. The example function is intentionally simple. Your custom function should return a Boolean value based on the rules of your versioning scheme. appUpdate.isNewerVersionFunction = customFn; function customFn (currentVersion:String, updateVersion:String):Boolean { return updateVersion > currentVersion; }
previousApplicationStorageDirectory The previous location of the application storage directory, if it changed after an update.flash.filesystem:File The previous location of the application storage directory, if it changed after an update. The application storage directory location changes after an upgrade with a certificate migration. If there is no certificate migration, the application storage directory does not change when the user updates the application. and this property is set to null. This property is set during a call to the initialize() method.

A developer can sign new version of AIR application with a new certificate if the developer uses the -migrate option when packaging the AIR file with ADT. If a new version of an AIR application uses a new signing certificate, the local storage directory of the application changes when the user installs the new version. Use this property to transfer data from the old application storage directory to the new application storage directory (File.applicationStorageDirectory). For more information, see "Signing an AIR file to change the application certificate" in the "Creating an AIR application using the command line tools" chapter of the Adobe AIR developer's guide.

previousVersion The previous version of the application.String The previous version of the application. This property is set during a call to the initialize() method. Returns the previous version of the application before the upgrade (set only if isfirstRun is true); otherwise it is set to null. updateDescriptor The content of the update descriptor file downloaded from the update URL.XML The content of the update descriptor file downloaded from the update URL. This property is non-null only the updater object dispatches an updateStatus event. updateURL The location of the update descriptor file.String The location of the update descriptor file. Any location valid for a URLRequest path is accepted. This is the only mandatory setting required by the updater. You can set the update URL either via this property or via the configuration file. When the value is set using both methods, the updater uses the value set using this property. wasPendingUpdate Whether there was a postponed update, even if it failed to install (true); false otherwise.Boolean Whether there was a postponed update, even if it failed to install (true); false otherwise. The updater sets this property during a call to the initialize() method. Use the wasPendingUpdate and isFirstRun properties to check if an update failed to install (in which case wasPendingUpdate is set to true and isFirstRun is set to false). isFirstRun
ApplicationUpdaterUI The ApplicationUpdaterUI class defines the basic functionality of the update framework for Adobe&#xAE; AIR&#xAE; applications, and it provides a default user interface.flash.events:EventDispatcher The ApplicationUpdaterUI class defines the basic functionality of the update framework for Adobe® AIR® applications, and it provides a default user interface. (The ApplicationUpdater class defines update functionality without implementing a default user interface.)

This class is included in the applicationupdater_ui.swc file, included in the Adobe AIR SDK. The applicationupdater_ui.swc file is in the frameworks/libs/air directory of the AIR SDK. The version in the frameworks/libs/air directory in the AIR 2 SDK is for Flex 4 development. If you use Flex 3, use the version in the frameworks/libs/air/flex3 subdirectory.

Adobe® Flex™ Builder™ loads this class automatically when you create a project for Adobe AIR. You should include the SWC file when compiling the application using the Adobe® Flex™ SDK.

Managing updates of applications can be complicated. The AIR update framework provides APIs to assist developers in providing good update capabilities in AIR applications. The functionality in the AIR update framework assists developers in the following:

  • Periodically checking for updates based on an interval or at the request of the user

  • Downloading AIR files (updates) from a web source

  • Alerting the user on the first run of the newly installed version

  • Confirming that the user wants to check for updates

  • Displaying information on the new update version to the user

  • Displaying download progress and error information to the user

The AIR update framework lets you store information about the update version of an AIR application in simple XML configuration files. For most applications, setting up these configuration files and including some basic code provides good update functionality to the end user.

The AIRUpdateUI class implements a default user interface that your application can use. It provides the user with basic information and options related to application updates.

The update process goes through a sequence of states:

State Description UninitializedThe updater has not been initialized.InitializingThe updater is initializing.ReadyThe updater has been initializedBefore checkingThe updater has not yet checked for the update descriptor file.CheckingThe updater is checking for an update descriptor file.AvailableThe update descriptor file is available.DownloadingThe updater is downloading the AIR file.DownloadedThe updater has downloaded the AIR file.InstallingThe updater is installing the AIR file.Pending installThe updater has initialized and there are pending updates.

When testing an application using the AIR Debug Launcher (ADL) application, attempting to update the application results in an IllegalOperationError exception.

The AIR update framework is only supported in the desktop profile. It is not supported for extended desktop applications (applications installed with a native installer), and it is not supported on the mobile profile (iPhone applications written with ActionScript 3.0). Check the Updater.isSupported property at runtime to see if the update framework is supported.

For details on using the AIR update framework, see the "Updating AIR Applications" chapter of Developing Adobe AIR Applications with Adobe Flex.

For details on using the AIR update framework, see the "Updating AIR Applications" chapter of Developing Adobe AIR Applications with Adobe Flash.

ApplicationUpdaterflash.desktop.Updatererror Dispatched when an error occurred either during initialization or during the update process (if something unexpected happens).flash.events.ErrorEvent.ERRORflash.events.ErrorEvent Dispatched when an error occurred either during initialization or during the update process (if something unexpected happens). progress Dispatched as the update file is downloaded.flash.events.ProgressEvent.PROGRESSflash.events.ProgressEvent Dispatched as the update file is downloaded. fileUpdateError Dispatched when an error occurs validating the file passed as the airFile parameter in a call to the installFromAIRFile() method.air.update.events.StatusFileUpdateErrorEvent.FILE_UPDATE_ERRORair.update.events.StatusFileUpdateErrorEvent Dispatched when an error occurs validating the file passed as the airFile parameter in a call to the installFromAIRFile() method. fileUpdateStatus Dispatched after the updater successfully validates the file in the call to the installFromAIRFile() method.air.update.events.StatusFileUpdateEvent.FILE_UPDATE_STATUSair.update.events.StatusFileUpdateEvent Dispatched after the updater successfully validates the file in the call to the installFromAIRFile() method. downloadError Dispatched if there is an error while connecting or downloading the update file.air.update.events.DownloadErrorEvent.DOWNLOAD_ERRORair.update.events.DownloadErrorEvent Dispatched if there is an error while connecting or downloading the update file. It is also dispatched for invalid HTTP statuses (such as 404 - File not found).

When this event is dispatched the periodic timer is automatically restarted (if the delay is greater than 0).

updateError Dispatched if an error occurs while trying to download or parse the update descriptor file.air.update.events.StatusUpdateErrorEvent.UPDATE_ERRORair.update.events.StatusUpdateErrorEvent Dispatched if an error occurs while trying to download or parse the update descriptor file.

When the updater dispatches this event, the periodic timer is automatically restarted (if the delay setting is greater than 0). The application should consider hiding any error dialog boxes when the updater dispatches a new checkForUpdate event.

updateStatus Dispatched after the updater successfully downloads and interprets the update descriptor file.air.update.events.StatusUpdateEvent.UPDATE_STATUSair.update.events.StatusUpdateEvent Dispatched after the updater successfully downloads and interprets the update descriptor file. beforeInstall Dispatched just before installing the update, after the installUpdate() method was called.air.update.events.UpdateEvent.BEFORE_INSTALLair.update.events.UpdateEvent Dispatched just before installing the update, after the installUpdate() method was called. Sometimes, it is useful to prevent the installation of the update at this time, because the user could lose all current work when the runtime exits the application to install the update.

Calling this event's preventDefault() method postpones the installation until the next restart. If you call the preventDefault() method, no additional update process can be started during this application session (via a call to the installUpdate() method or because of the periodic check).

downloadComplete Dispatched when the download of the update file is complete.air.update.events.UpdateEvent.DOWNLOAD_COMPLETEair.update.events.UpdateEvent Dispatched when the download of the update file is complete. downloadStart Dispatched after a call to the downloadUpdate() method and the connection to the server is established.air.update.events.UpdateEvent.DOWNLOAD_STARTair.update.events.UpdateEvent Dispatched after a call to the downloadUpdate() method and the connection to the server is established. When using ApplicationUpdater library, you may want the event handler for this event to display a progress bar to report the download progress to the user. checkForUpdate Dispatched before the update process begins, just before the updater tries to download the update descriptor file.air.update.events.UpdateEvent.CHECK_FOR_UPDATEair.update.events.UpdateEvent Dispatched before the update process begins, just before the updater tries to download the update descriptor file. The updater can dispatch this event as a result of directly calling the checkNow() method or because the periodic check timer expired. initialized Dispatched after the initialization is complete.air.update.events.UpdateEvent.INITIALIZEDair.update.events.UpdateEvent Dispatched after the initialization is complete.

This event has the following read-only properties:

  • isFirstRun (Boolean) true if this is the first run after a successful update; false otherwise.

  • previousVersion (String) The previous version of the application before the upgrade (set only if isfirstRun is true).

  • currentVersion (String) The version from the application descriptor file of the currently installed version.

ApplicationUpdaterUI The constructor function. The constructor function. addResources Dynamically adds a new resource bundle for the specified language.langStringThe language code (such as "ro" for Romanian). resObjectThe object contains the keys and values for the translation. The keys are the ones from the language property file. The following table lists the possible keys (property names).

Key English value Dialog Box Description appWidth 530 All Width of the dialog box. titleWindow Updating: All Displayed in the native window title bar before the application name. titleCheck Check for updates Check For Updates Dialog box title. msgCheck Allow the application to check for updates? Check For Updates Dialog box message. btnCheck Check for Updates Check For Updates Check for Updates button label. btnCancel Cancel All dialog boxes with a Cancel button Cancel button label. titleCheckNoUpdates No updates available CheckForUpdates - No updates available Dialog box title. msgCheckNoUpdates There are no updates available for the application. Check For Updates - No updates available Dialog box message. btnClose Close All dialog boxes with Close button Close button label. titleCheckError Update error Check For Updates - Connection Error Dialog box title. msgCheckError There was an error checking for updates. Error# {0} Check For Updates - Connection Error Dialog box message. {0} will be replaced with the error ID. titleUpdate Update available Update Available Dialog box title. msgUpdate An updated version of the application is available for download. Update Available Dialog box message. lblApplication Application: Update Available Label displayed before the application name. lblInstalledVersion Installed Version: Update Available Label displayed before the installed version. lblAvailableVersion Update Version: Update Available Label displayed before the update version. btnDownload Download now Update Available Download Now button label. btnDownloadLater Download later Update Available Download Later button label. lnkReleaseNotes Release notes All with release notes link The "Release notes" link name. titleProgress Download progress... Download Progress Dialog box title. msgProgress Downloading update Download Progress Dialog box message. titleDownloadError Download failed Download Error Dialog box title. msgDownloadError There was an error downloading the update. Error# {0} Download Error Dialog box message. {0} will be replaced with the error ID. titleInstall Install update Install Update Dialog box title. msgInstall The update for the application is downloaded and ready to be installed. Install Update Dialog box message. btnInstall Install now Install Update "Install" button label btnInstallLater Postpone until restart Install Update "Postpone until restart" button label titleFileUpdate Update available File - Update Available Dialog box title. msgFileUpdate The file contains an updated version of the application. Install? File - Update Available Dialog box message. lblFile File: File - Update Available Label displayed before the file name titleFileNoUpdate No update available File - No updates available Dialog box title. msgFileNoUpdate The file doesn't contain a newer version of the application. File - No updates available Dialog box message. titleFileError File error File - Error Dialog box title. msgFileError An error occurred validating the update file. Error# {0} File - Error Dialog box message. {0} will be replaced with the error ID. titleUnexpectedError Unexpected error Unexpected Error Dialog box title. msgUnexpectedError An unexpected error occurred. Error# {0} Unexpected Error Dialog box message. {0} will be replaced with the error ID.

Dynamically adds a new resource bundle for the specified language. JavaScript developers use this method to dynamically add a new language for the dialog boxes that the application updater UI displays. (Flex developers can directly add a new language to the "ApplicationUpdaterDialogs" resource bundle.)
localeChain
cancelUpdate Cancels the update process. Cancels the update process. Calling this method cancels any pending downloads, deleting any incomplete downloaded files, and restarts the periodic check timer.

The update process can be canceled at any time except when the state machine is in "uninitialized" or "initializing" state. It does nothing when it is called in one of the "uninitialized" or "initializing" states.

checkNow Starts the update process. Starts the update process. Calling this method does not stop the periodic timer; however, the method detects that an update process is running and will skip the current iteration.

This method only executes if the current state is "Ready".

This method can result in the updater object dispatching the following event:

checkForUpdateair.update.events:UpdateEventDispatched just before the update process begins. Dispatched just before the update process begins.
initialize Initializes the updater. Initializes the updater. Calling this method does the following:

  1. It initializes the update framework, silently (and synchronously) installing any pending updates. You should call this method during application startup, since it may restart the application.

  2. It checks if there is a postponed update and installs it.

  3. If something went wrong with a prior update, it clears the update file and version information from the storage area.

  4. If the periodic timer delay has expired, it starts the update process; otherwise it starts the periodic timer. However, when testing an application using the AIR Debug Launcher (ADL) application, attempting to update the application results in a IllegalOperationError exception.

initializedair.update.events:UpdateEventThe initialization is complete. The initialization is complete.errorflash.events:ErrorEventThere is an error during initialization. There is an error during initialization.
installFromAIRFile Starts the update process using a local AIR file.fileflash.filesystem:FileThe local AIR file to install. Starts the update process using a local AIR file.

Calling this method has no effect if an update process is running (if the state is not "Downloaded").

This function is useful for an application that has the customUpdateUI element set to true in the application descriptor file.

When testing an application using the AIR Debug Launcher (ADL) application, calling this method results in an IllegalOperationError exception.

fileUpdateStatusair.update.events:StatusFileUpdateEventDispatched after the updater successfully validates the AIR file. Dispatched after the updater successfully validates the AIR file.updateErrorair.update.events:StatusFileUpdateErrorEventDispatched if an error occurs while trying parse the update descriptor file. Dispatched if an error occurs while trying parse the update descriptor file.
configurationFile The location of the configuration file that sets the values for delay and updateURL properties.flash.filesystem:File The location of the configuration file that sets the values for delay and updateURL properties. It also has settings for determining whether the application displays various confirmation dialog boxes during the update process. If this property points to a non-existent file, calling the initialize() method results in an Error being thrown.

Here is a sample configuration file:

<?xml version="1.0" encoding="utf-8"?> <configuration xmlns="http://ns.adobe.com/air/framework/update/configuration/1.0" > <url>app:/server/update.xml</url> <delay>1</delay> <defaultUI> <dialog name="checkForUpdate" visible="true" /> <dialog name="downloadUpdate" visible="false" /> <dialog name="downloadProgress" visible="true" /> <dialog name="installUpdate" visible="true" /> </defaultUI> </configuration>

Instead of loading a configuration file, you can use ActionScript code to set the following properties of the ApplicationUpdaterUI object: delay, isCheckForUpdateVisible, isDownloadProgressVisible, isDownloadUpdateVisible, isFileUpdateVisible, isInstallUpdateVisible, and updateURL properties.

delayupdateURL
currentVersion The current version of the application.String The current version of the application. This property is set during a call to the initialize() method. It is set to the version from the application descriptor file. delay The interval, in days, between periodic checks of new updates.Number0 The interval, in days, between periodic checks of new updates.

A value of 0 (the default value) indicates that the timer is not active, so no periodic check is done. The delay can be set either via this property or via the configuration file. When the value is set using both methods, the value set using this property is used.

configurationFile
isCheckForUpdateVisible Enables the visibility of the Check for Update, No Update, and Update Error dialog boxes.Boolean Enables the visibility of the Check for Update, No Update, and Update Error dialog boxes. When set to true, the updater displays these dialog boxes as part of the update process. This can also be set in the update configuration file. A value set using this property overrides the setting in the update configuration file. isDownloadProgressVisible Enables the visibility of the Download Update dialog box.Boolean Enables the visibility of the Download Update dialog box. When set to true, the updater displays this dialog box as part of the update process. This can also be set in the update configuration file. A value set using this property overrides the setting in the update configuration file. isDownloadUpdateVisible Enables the visibility of the Download Update dialog box.Boolean Enables the visibility of the Download Update dialog box. When set to true, the updater displays these dialog boxes as part of the update process. This can also be set in the update configuration file. A value set using this property overrides the setting in the update configuration file. isFileUpdateVisible Enables the visibility of the File Update, File No Update, and File Error dialog boxes.Boolean Enables the visibility of the File Update, File No Update, and File Error dialog boxes. When set to true, the updater displays these dialog boxes as part of the update process. This can also be set in the update configuration file. A value set using this property overrides the setting in the update configuration file. isFirstRun Whether this is the first run after a successful update (true) or not (false).Boolean Whether this is the first run after a successful update (true) or not (false). The updater sets this value during the call to the initialize() method. The developer should check that isFirstRun is set to true if there is a need to migrate data from one version to another. wasPendingUpdateisInstallUpdateVisible Enables the visibility of the Install Update dialog box.Boolean Enables the visibility of the Install Update dialog box. When set to true, the updater displays this dialog box as part of the update process. This can also be set in the update configuration file. A value set using this property overrides the setting in the update configuration file. isNewerVersionFunction A function that the updater should use to perform version comparisons.Function A function that the updater should use to perform version comparisons. By default, the update framework does a version comparison to detect whether the version from the remote site is newer than the version of the installed application. However, sometimes the default comparison does not match the developer's versioning scheme. Set this property to provide a new function that does the comparison.

The default comparision function accepts versions like x.y.z, where x, y, and z can contain letters and digits. There are some special conditions that the default comparision function recognizes. If the test function finds "alpha", "beta", or "rc" in the version strings, the order is alpha < beta < rc.

The following code defines a custom function, customFn, for the appUpdate updater object. The example function is intentionally simple. Your custom function should return a Boolean value based on the rules of your versioning scheme. appUpdate.isNewerVersionFunction = customFn; function customFn (currentVersion:String, updateVersion:String):Boolean { return updateVersion > currentVersion; }
isUnexpectedErrorVisible Enables the visibility of the Unexpected Error dialog box.Boolean Enables the visibility of the Unexpected Error dialog box. When set to true, the Application Updater displays this dialog box as part of the update process. This can also be set in the update configuration file. A value set using this property overrides the setting in the update configuration file. isUpdateInProgress A Boolean property, which is true if an update is running, false otherwise.Boolean A Boolean property, which is true if an update is running, false otherwise. localeChain An array defining the locale chain used by the user interface.Array An array defining the locale chain used by the user interface. Typically, only JavaScript (HTML) developers use this property.

Flex developers can use the ResourceManager to handle the locale chain.

By default, in an HTML-based application, the languages are sorted between those languages in the Capabilities.languages array and the ten languages supported by the user interface. If no match is found, the user interface uses the English language.

This JavaScript example uses the AIR HTML localization framework, included in the AIR SDK. It sorts the languages against the list of languages, and then it sets English as the default fallback language:

appUpdater.addResources("ro_RO", {titleCheck: "Titlu", msgCheck: "Mesaj", btnCheck: "Buton"}); appUpdater.addResources("hu", {titleCheck: "Cím", msgCheck: "Üzenet"}); var languages = ["ro", "hu"]; languages = languages.concat(air.Capabilities.languages); var sortedLanguages = air.Localizer.sortLanguagesByPreference(languages, air.Capabilities.language, "en-US"); sortedLanguages.push("en-US"); appUpdater.localeChain = sortedLanguages;
addResources()
previousApplicationStorageDirectory The previous location of the application storage directory, if it changed after an update.flash.filesystem:File The previous location of the application storage directory, if it changed after an update. The application storage directory location changes after an upgrade with a certificate migration. If there is no certificate migration, the application storage directory does not change when the user updates the application. and this property is set to null. This property is set during a call to the initialize() method.

A developer can sign new version of AIR application with a new certificate if the developer uses the -migrate option when packaging the AIR file with ADT. If a new version of an AIR application uses a new signing certificate, the local storage directory of the application changes when the user installs the new version. Use this property to transfer data from the old application storage directory to the new application storage directory (File.applicationStorageDirectory). For more information, see "Signing an AIR file to change the application certificate" in the "Creating an AIR application using the command line tools" chapter of the Adobe AIR developer's guide.

previousVersion The previous version of the application.String The previous version of the application. This property is set during a call to the initialize() method. Returns the previous version of the application before the upgrade (set only if isfirstRun is true); otherwise it is set to null. updateDescriptor The content of the update descriptor file downloaded from the update URL.XML The content of the update descriptor file downloaded from the update URL. This property is non-null only after the updater object dispatches an updateStatus event. updateURL The location of the update descriptor file.String The location of the update descriptor file. Any location valid for a URLRequest path is accepted. This is the only mandatory setting required by the updater. You can set the update URL either via this property or via the configuration file. When the value is set using both methods, the updater uses the value set using this property. configurationFilewasPendingUpdate Whether there was a postponed update, even if it failed to install (true); false otherwise.Boolean Whether there was a postponed update, even if it failed to install (true); false otherwise. The updater sets this property during a call to the initialize() method. Use the wasPendingUpdate and isFirstRun properties to check if an update failed to install (in which case wasPendingUpdate is set to true and isFirstRun is set to false). isFirstRun