An interface that describes an object representing an available update to the current application - this update may have several available patches from which one must be selected to download and install, for example we might select a binary difference patch first and attempt to apply that, then if the application process fails fall back to downloading a complete file-replace patch. This object also contains information about the update that the front end and other application services can use to learn more about what is going on.
[scriptable, uuid(b0fb539e-f4ab-4ea1-bd75-e6d2813e5fc1)]
interface nsIUpdate : nsISupports
Attributes
The Build ID of this update. Used to determine a particular build, down to the hour, minute and second of its creation. This allows the system to differentiate between several nightly builds with the same |version| for example.
attribute
AString
buildID
The URL to a page which offers details about the content of this update. Ideally, this page is not the release notes but some other page that summarizes the differences between this update and the previous, which also links to the release notes.
attribute
AString
detailsURL
A numeric error code that conveys additional information about the state of a failed update. If the update is not in the "failed" state, then this value is zero. TODO: Define typical error codes (for now, see updater/errors.h)
attribute
long
errorCode
The Addon version of this update. Used by the Extension System to track compatibility of installed addons with this update.
attribute
AString
extensionVersion
When the update was installed.
attribute
long long
installDate
Whether or not the update being downloaded is a complete replacement of the user's existing installation or a patch representing the difference between the new version and the previous version.
attribute
boolean
isCompleteUpdate
Whether or not the update is a security update or not. If this is true, then we present more serious sounding user interface messages to the user.
attribute
boolean
isSecurityUpdate
The URL to a HTML fragment that contains a license for this update. If this is specified, the user is shown the license file after they choose to install the update and they must agree to it before the download commences.
attribute
AString
licenseURL
The name of the update, or "<Application Name> <Update Version>"
attribute
AString
name
The number of patches supplied by this update.
readonly attribute
unsigned long
patchCount
The currently selected patch for this update.
readonly attribute
nsIUpdatePatch
selectedPatch
The URL to the Update Service that supplied this update.
attribute
AString
serviceURL
The state of the selected patch: "downloading" The update is being downloaded. "pending" The update is ready to be applied. "applying" The update is being applied. "succeeded" The update was successfully applied. "download-failed" The update failed to be downloaded. "failed" The update failed to be applied.
attribute
AString
state
A message associated with this update, if any.
attribute
AString
statusText
The type of update: "major" A major new version of the Application "minor" A minor update to the Application (e.g. security update)
attribute
AString
type
The Application version of this update.
attribute
AString
version
Methods
Retrieves a patch.
@param index
The index of the patch to retrieve.
@returns The nsIUpdatePatch at the specified index.
nsIUpdatePatch
getPatchAt(in unsigned long index)
Serializes this update object into a DOM Element
@param updates
The document to serialize into
@returns The DOM Element created by the serialization process
nsIDOMElement
serialize(in nsIDOMDocument updates)
Compare to: