nsIUpdate

by 3 contributors:

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.
1.0
28
Introduced
Gecko 1.8
Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Method overview

nsIUpdatePatch getPatchAt(in unsigned long index);
nsIDOMElement serialize(in nsIDOMDocument updates);

Attributes

Attribute Type Description
appVersion AString The Application version of this update.
billboardURL AString The URL to a page that is typically localized to display in the update prompt.
buildID AString The build ID of this update. This is used to identify a particular build, down to the hour, minute, and second of its creation. This lets the system differentiate between several nightly builds with the same version, for example.
channel AString The channel used to retrieve this update from the update service.
detailsURL AString 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.
displayVersion AString The string to display in the user interface for the version. If you want a real version number use appVersion.
errorCode long A numeric error code that conveys additional information about the state of a failed update or failed certificate attribute check during an update check. If the update is not in the "failed" state, this value is zero.
OK (0)
No error.
MEM_ERROR (1)
A memory error occurred.
USAGE_ERROR (3)
A usage error occurred; this needs to be described in more detail.
CRC_ERROR (4)
A checksum error occurred.
PARSE_ERROR (5)
An error occurred while parsing the patch.
READ_ERROR (6)
An error occurred while reading the patch.
WRITE_ERROR (7)
An error occurred while writing the patched application.
UNEXPECTED_ERROR (8)
An unanticipate type of error occurred.
extensionVersion AString The add-on version of this update. Used by the extension system to track compatibility of installed add-ons with this update. Obsolete since Gecko 2.0
installDate long long The date and time at which the update was installed.
isCompleteUpdate boolean true if the update is a complete replacement of the existing installation; false if the update is a patch representing the difference between the new version and the existing version.
isSecurityUpdate boolean true if the update is a security update. If the update is a security update, a more seriously-worded user interface message is used to present the update to the user.
licenseURL AString The URL to an HTML fragment that contains a license for the 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 begins.
name AString The name of the update, in the form "application_name update_version"
patchCount unsigned long The number of patches supplied by this update. Read only.
platformVersion AString The toolkit version of this update.
previousAppVersion AString The Application version prior to the application being updated.
selectedPatch nsIUpdatePatch The currently selected patch for this update. Read only.
serviceURL AString The URL to the update service that supplied this update.
showNeverForVersion boolean Whether to show the "No Thanks" button in the update prompt. This allows the user to never receive a notification for that specific update version again.
showPrompt boolean Whether to show the update prompt which requires user confirmation when an update is found during a background update check. This overrides the default setting to download the update in the background.
showSurvey boolean Whether to show the survey link in the update prompt. The url must also be present in the app.update.surveyURL preference.
state AString The state of the selected patch:
"downloading"
The update is being downloaded.
"pending"
The update is ready to be applied.
"applying"
The update is in the process of being applied.
"succeeded"
The update has been installed successfully.
"download-failed"
The update failed to be downloaded.
"failed"
Installing the update failed.
Read only.
statusText AString An optional message associated with the update.
type AString The type of patch represented by the object:
"major"
A major new version of the application.
"minor"
A minor update, such as a security update.
version AString The application version of the update.Obsolete since Gecko 2.0

Methods

getPatchAt()

Retrieves a patch.

nsIUpdatePatch getPatchAt(
  in unsigned long index
);
Parameters
index
The index of the patch to retrieve.
Return value

An nsIUpdatePatch object describing the specified patch.

serialize()

Serializes the update object into a DOM element.

nsIDOMElement serialize(
  in nsIDOMDocument updates
);
Parameters
updates
The DOM document into which to serialize the update.
Return value

The patch object serialized into an nsIDOMElement.

See also

Document Tags and Contributors

Contributors to this page: Sheppy, trevorh, Soupdragon
Last updated by: Sheppy,