Mobile Updater Application Block

 

之前由于项目的需要做了移动客户端升级模块,今天无意中在codeplex上看到mamadero的Mobile Updater Application Block,见识了,呵呵。。。在此和大家分享。             移动客户端系统升级思路
Codeplex地址:   http://www.codeplex.com/MobileBlocks

Mobile Updater Application Block

Welcome

The Mobile Updater Application Block has been developed by the Q4Tech Engineering Team, based on the Microsoft patterns & practices Updater Application Block. It incorporates the Connection Monitor and the Configuration Application Block, both part of the Mobile Client Software Factory.

Continuing with the good work done by the patterns & practices group for the Mobile Client Software Factory, Q4Tech has decided to address an unsolved necessity in the mobile application development: the deployment and maintenance of applications.

This application block is not simply a port of the desktop version. It includes specific functionality specifically targeting the needs of the mobility scenario. We've cleaned up the original code striving for as small as possible a footprint. The block includes an Updater Agent that runs as a service on the mobile device, allowing you to share updating logic among your applications, and letting you manage the deployment and maintenance process from a centralized server.

Goals

The design of the application block provides a manageable and scalable solution that strikes a balance between flexibility and complexity. The main design goals of the Mobile Updater Application Block are the following:

  • Simplify the addition of self-updating capabilities to a mobile application using standard protocols like TCP/IP and HTTP
  • Adapt and extend patterns & practices Updater Application Block 2.0 to the Mobile domain
  • Make efficient use of network bandwidth
  • Allow processing of complex updates
  • Leverage the mobile device's status variables from the updating process
  • Support background updating for mobile applications through an Updater Agent

Use Cases

The main focus of the block is the client side of the updating process. For the client side, the block includes basic functionality and a Web Service contract which allows you to add business-specific functionality based on a Device Id identifying uniquely the device.

Like its desktop counterpart, the Mobile Updater Application Block is designed to support the most common scenarios for self-updating applications:

  • It supports applications that need to be kept up-to-date with current executable versions.
  • It supports applications that use multiple plug-ins that users can download and activate on their desktops.
  • It supports applications that rely on reference data (for example, a large set of documents) that need to be cached on the client and be occasionally updated from a server.

Features

The Mobile Updater Application Block helps you in the following ways:

  • It helps you implement a "pull model" to automatically download updates for .NET Compact Framework applications.
  • It helps you perform pre-download and pre-configuration tasks based on device status queries.
  • It helps you perform post-download configuration tasks without requiring user intervention.
  • It helps you drive the download and configuration tasks from your live, already-running application, ensuring protection from data loss.

System Requirements

The Mobile Updater Application Block requires the following software:

See Also


Design of the Mobile Updater

The Mobile Updater Application Block is designed to provide a "no touch" solution to the problem of keeping mobile applications up-to-date in enterprise environments. You can use it out-of–the-box to download and activate updates for your applications. It is also designed to be extensible, so you can customize the default application block to perform exactly the functionality that your application requires, whether using a different type of download technology or performing a complex set of tasks after the download process is complete. The mobile application block, which resides at client side, consists of four subsystems, each one designed to fulfill a specific role in the application update process:

  • Update management subsystem: It consists of the ApplicationUpdaterManager, the RegistryManager, and the UpdaterTask classes. ApplicationUpdaterManager is a facade into the Updater Application Block. This is a singleton, and it is responsible for interacting with the ManifestManager to determine when the updates are available. It also provides methods both to the client application and to the agent to start the download and activation processes.
  • Manifest management subsystem: The manifest is the configuration information required to apply the update to the client application. It is stored on the server; this information describes the updates that are available and their configuration. It also defines how the update should be downloaded, what are the conditions that must be satisfied in the client in order to download and activate it, and the activation processors that should be executed after the files are transferred. Manifest classes access this information and make it available to the other classes in the application block.
  • Downloader subsystem: It is responsible for connecting to the server and downloading the updates to the client computer.
  • Activation subsystem: It is responsible for performing any activation processing; for example, copying the downloaded files to a specified location, deleting temporary files and folders, or executing a .cab file installation.

Updater Agent

Your auto-updating mobile application can use the Mobile Updater Application Block in-process to get the application updates described server-side in the manifest XML file. An alternative operational model is to centralize the update logic in the Updater Agent. This approach is highly recommended if you have several updatable applications on the device. Instead of adding auto-updating logic to each application, you can delegate that responsibility to the Updater Agent. In this scenario, the Updater Agent will get a manifest list from the server via a Web Service (which can be modified according to your needs); then, it will check for updates related to that manifest list. Since the Agent runs in the background, your application can subscribe to the Updater Agent Notification Subsystem. By doing so, it will receive events informing, for instance, that new updates were found and/or downloaded. This will let your code decide if the update can be activated, or even downloaded; also, it will give it the opportunity to shut down itself cleanly and controlledly.

The Updater Agent uses the Configuration Application Block and the Connection Monitor from the Mobile Client Software Factory, and uses the Mobile Updater Application Block to get and activate updates. It is comprised of four components:

  • Device ID subsystem: This subsystem is responsible for getting the device id to be supplied as a parameter to the Manifest List Provider web service in order to get the manifest list for one specific device. The device ID can be a configurable ID in the app.config file for the Updater Agent, or the hardware device ID. You can select which provider to use in your configuration file.
  • Updater Configuration Subsystem: This subsystem is responsible for setting up and starting the updating process. It provides the corresponding downloader and default configuration to the Mobile Updater Application Block.
  • Updater Agent Management Subsystem: This subsystem is responsible for controlling the agent behavior. It monitors connectivity status through the Connection Monitor, gets the manifest list, starts the updating process and notifies running applications of updating events through the NotificationManager by using the Updater Agent Common Notification Subsystem.
  • Updater Agent UI: The Updater Agent provides a user interface permitting the user to monitor the updater status, force a check for updates, and to shutdown the agent. This UI is implemented using the Model-View-Presenter pattern.


This shows the high level design of the Mobile Updater Application Block.

High level design of the Mobile Updater Application Block

为成功找方法,不为失败找借口!

猜你喜欢

转载自blog.csdn.net/wt0731/article/details/3588009