window.runtime propertywindow.runtime.flash.desktop.Updater
InheritanceUpdater Inheritance Object

The Updater class is used to update the currently running application with a different version. To use it, instantiate an Updater object and then call its update() method.



Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
  
The constructor function for the Updater class.
Updater
 Inherited
hasOwnProperty(name:String):Boolean
Indicates whether an object has a specified property defined.
Object
 Inherited
isPrototypeOf(theClass:Object):Boolean
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
propertyIsEnumerable(name:String):Boolean
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
toString():String
Returns the string representation of the specified object.
Object
  
update(airFile:File, version:String):void
Updates the currently running application with the version of the application contained in the specified AIR file.
Updater
 Inherited
valueOf():Object
Returns the primitive value of the specified object.
Object
Constructor Detail
Updater()Constructor
function Updater()

The constructor function for the Updater class. Note that the update() method is not a static member of the class. You must instantiate an Updater object and call the update() method on it.

Method Detail
update()method
function update(airFile:File, version:String):void

Updates the currently running application with the version of the application contained in the specified AIR file. The application in the AIR file must have the same application identifier (appID) as the currently running application.

Calling this method causes the current application to exit (as if the NativeApplication.exit() method had been called). This is necessary because Adobe AIR cannot fully update an application while the application is running. Upon successfully installing the new version of the application, the application launches. If the runtime cannot successfully install the new version (for example, if its application ID does not match the existing version), the AIR installer presents an error message to the user, and then the old version re-launches.

When testing an application using ADL, calling the update() method installs and runs a new version of the application only if the runtime is installed. If the runtime is not installed, the call to the method results in a runtime exception.

Note: Specifying the version parameter is required for security reasons. By requiring the application to verify the version number in the AIR file, the application will not inadvertantly install an older version, which might contain a security vulnerability that has been fixed.

Parameters

airFile:File — The File object pointing to the AIR file that contains the update version of the application.
 
version:String — The required version in the update AIR file. The string in the version attribute of the main application element of the application descriptor file for the AIR file must match this value in order for the update to succeed.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/air/1/jslr/flash/desktop/Updater.html