Adobe® AIR® API Reference for HTML Developers
Home  |  Show Classes List |  Index  |  Appendixes

Language Reference only       
Updater 
3D:
Context3D
Context3DBlendFactor
Context3DClearMask
Context3DCompareMode
Context3DProgramType
Context3DRenderMode
Context3DStencilAction
Context3DTextureFormat
Context3DTriangleFace
Context3DVertexBufferFormat
CubeTexture
IndexBuffer3D
Program3D
Stage3D
Texture
VertexBuffer3D
Air.net:
ServiceMonitor
SocketMonitor
URLMonitor
Air.update:
ApplicationUpdater
ApplicationUpdaterUI
DownloadErrorEvent
StatusFileUpdateErrorEvent
StatusFileUpdateEvent
StatusUpdateErrorEvent
StatusUpdateEvent
UpdateEvent
Data:
EncryptedLocalStore
SQLCollationType
SQLColumnNameStyle
SQLColumnSchema
SQLConnection
SQLError
SQLErrorEvent
SQLErrorOperation
SQLEvent
SQLIndexSchema
SQLMode
SQLResult
SQLSchema
SQLSchemaResult
SQLStatement
SQLTableSchema
SQLTransactionLockType
SQLTriggerSchema
SQLUpdateEvent
SQLViewSchema
Desktop:
Clipboard
ClipboardFormats
ClipboardTransferMode
DockIcon
Icon
InteractiveIcon
NativeApplication
NativeProcess
NativeProcessStartupInfo
NotificationType
SystemTrayIcon
Display:
BitmapData
NativeMenu
NativeMenuItem
Screen
Stage
StageDisplayState
StageQuality
Events:
ActivityEvent
AsyncErrorEvent
BrowserInvokeEvent
DataEvent
DatagramSocketDataEvent
DNSResolverEvent
DRMAuthenticateEvent
DRMStatusEvent
ErrorEvent
Event
EventDispatcher
FileListEvent
HTTPStatusEvent
InvokeEvent
InvokeEventReason
IOErrorEvent
LocationChangeEvent
MouseEvent
NativeProcessExitEvent
NetDataEvent
NetMonitorEvent
NetStatusEvent
OutputProgressEvent
ProgressEvent
SampleDataEvent
SecurityErrorEvent
ServerSocketConnectEvent
StatusEvent
StorageVolumeChangeEvent
TimerEvent
UncaughtErrorEvent
UncaughtErrorEvents
File:
File
FileMode
FileStream
StorageVolume
StorageVolumeInfo
Functions:
trace()
generateRandomBytes()
navigateToURL()
sendToURL()
Geom:
Matrix
Point
Rectangle
Media:
AudioDecoder
AudioPlaybackMode
H264Level
H264Profile
H264VideoStreamSettings
ID3Info
InputMediaStream
Microphone
MicrophoneEnhancedMode
MicrophoneEnhancedOptions
Sound
SoundChannel
SoundCodec
SoundLoaderContext
SoundMixer
SoundTransform
VideoCodec
VideoStatus
VideoStreamSettings
Native window:
NativeWindow
NativeWindowBoundsEvent
NativeWindowDisplayState
NativeWindowDisplayStateEvent
NativeWindowInitOptions
NativeWindowRenderMode
NativeWindowResize
NativeWindowSystemChrome
NativeWindowType
Net:
AAAARecord
ARecord
CertificateStatus
DatagramSocket
DNSResolver
FileFilter
InterfaceAddress
IPVersion
LocalConnection
MXRecord
NetConnection
NetMonitor
NetStreamAppendBytesAction
NetStreamMulticastInfo
NetworkInfo
NetworkInterface
ObjectEncoding
PTRRecord
ResourceRecord
Responder
SecureSocket
ServerSocket
SharedObject
SharedObjectFlushStatus
Socket
SRVRecord
URLLoader
URLLoaderDataFormat
URLRequest
URLRequestDefaults
URLRequestHeader
URLRequestMethod
URLStream
URLVariables
XMLSocket
Security:
ReferencesValidationSetting
RevocationCheckSettings
SignatureStatus
SignerTrustSettings
X500DistinguishedName
X509Certificate
XMLSignatureValidator
System:
Capabilities
Security
System
Updater
Ui:
Keyboard
KeyboardType
KeyLocation
Mouse
MouseCursorData
Utils:
Vector
ByteArray
Collator
CollatorMode
CompressionAlgorithm
CurrencyFormatter
CurrencyParseResult
DateTimeFormatter
DateTimeNameContext
DateTimeNameStyle
DateTimeStyle
Endian
HTMLLoader
HTMLPDFCapability
LastOperationStatus
LocaleID
NationalDigitsType
NumberFormatter
NumberParseResult
StringTools
Timer
window.runtime propertywindow.runtime.flash.desktop.Updater
InheritanceUpdater Inheritance Object

Runtime Versions:  1.0

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.

The Updater class 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 AIR mobile profile or AIR for TV profiles. Check the Updater.isSupported property.

Extended desktop application (applications installed with a native installer) can download a new version of the native installer and launch it using the File.openWithDefaultApplication() method.

See also



Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  isSupported : Boolean
[static] [read-only] The isSupported property is set to true if the Updater class is available on the current platform, otherwise it is set to false.
Updater
 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
toLocaleString():String
Returns the string representation of this object, formatted according to locale-specific conventions.
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
Property Detail

isSupported

property
isSupported:Boolean  [read-only]

Runtime Versions:  2

The isSupported property is set to true if the Updater class is available on the current platform, otherwise it is set to false.

Constructor Detail

Updater

()Constructor
public function Updater()

Runtime Versions:  1.0

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
public function update(airFile:File, version:String):void

Runtime Versions:  1.0

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 relaunches.

The update process relaunches the application whether or not the update is successful. Updates can fail for a variety of reasons, including some that the application cannot control (such as the user having insufficient privileges to install the application). Applications should take care to detect failures and avoid reattempting the same failed update repeatedly. The resulting infinite loop would effectively disable the application. One way to check for a successful update is to write the current version number to a file before starting the update, and then compare that to the version number when the application is relaunched.

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

On Mac OS, to install an updated version of an application, the user needs to have adequate system privileges to install to the application directory. On Windows or Linux, the user needs to have adminstrative privileges.

If the updated version of the application requires an updated version of the runtime, the new runtime version is installed. To update the runtime, a user needs to have administrative privileges for the computer.

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 new 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.


Throws
IllegalOperationError — The method was called when running in ADL.

See also


Example  ( How to use this example )

Note that the update() method is not a static method of the class. You instantiate a Updater object, and call the update() method of that object.
 
var updater = new air.Updater();
var airFile = air.File.applicationStore.resolvePath("Example Application.air");
var version = "2.01";
updater.update(airFile, version);