简体   繁体   中英

How does CheckAndDownloadUpdateAsync actually work behind the scenes?

它会下载所有二进制文件还是仅下载一部分二进制文件,以便评估二进制文件是否为新版本?

In short, it evaluates the XAP, which contains all binaries, but if the version on the XAP hasn't changed it doesn't see any changes.

Here is a bit more light on that method (lifted from here but pasted for historical reasons):

Features:

• Detect network connectivity (and sometimes it fails miserably…)

• Connect to the original authorized URL that it was installed from

• Download the new XAP file and compare the current version against the downloaded version from the manifest

• Detect the current Silverlight version vs. the new version's Silverlight version

• If a failure occurs, failure exception types are provided for recovery such as “PlatformNotSupportedException”

Limitations:

• Can't interrupted the request. So when it times out, we wait for it.

• Can't download the update and make it optional to install and replace the currently running XAP. A flag to just detect a newer version would be better. This would allow the UI to show the current version and available update version.

• Returns a false for the “UpdateAvailable” property for several reasons such as the new XAP is not signed, is a newer Silverlight Version, or various other errors. We must then look at ALL of the possible error class types placed in the error collection. A bunch of try-catches are therefore necessary. The try-catches do the job as long as we have every possible error type in a catch. An enum for the actual error reason may be better.

• Can't revert to a previous stable version and have it install over a newer bad version. It makes sense, but real development teams have recovery plans when updating production versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM