nsIUpdate 编辑

toolkit/mozapps/update/nsIUpdateService.idlScriptable 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 66 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

AttributeTypeDescription
appVersionAStringThe Application version of this update.
billboardURLAStringThe URL to a page that is typically localized to display in the update prompt.
buildIDAStringThe 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.
channelAStringThe channel used to retrieve this update from the update service.
detailsURLAStringThe 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.
displayVersionAStringThe string to display in the user interface for the version. If you want a real version number use appVersion.
errorCodelongA 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.
extensionVersionAStringThe 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
installDatelong longThe date and time at which the update was installed.
isCompleteUpdatebooleantrue 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.
isSecurityUpdatebooleantrue 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.
licenseURLAStringThe 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.
nameAStringThe name of the update, in the form "application_name update_version"
patchCountunsigned longThe number of patches supplied by this update. Read only.
platformVersionAStringThe toolkit version of this update.
previousAppVersionAStringThe Application version prior to the application being updated.
selectedPatchnsIUpdatePatchThe currently selected patch for this update. Read only.
serviceURLAStringThe URL to the update service that supplied this update.
showNeverForVersionbooleanWhether 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.
showPromptbooleanWhether 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.
showSurveybooleanWhether to show the survey link in the update prompt. The url must also be present in the app.update.surveyURL preference.
stateAStringThe 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.
statusTextAStringAn optional message associated with the update.
typeAStringThe type of patch represented by the object:
"major"
A major new version of the application.
"minor"
A minor update, such as a security update.
versionAStringThe 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:20 次

字数:11371

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文