In a previous post, we discussed the basics of Microsoft’s Updater block from their Enterprise Library: that clients connect to a server, pull XML files describing updates (files to update and an execution script/task to execute), grab those updates passively via BITS, and then download and execute updates.
As promised, this post will describe how to include multiple updates in a single manifest file.
The key here is really to understand that manifest files and refer to other manifest files. This means we have a master/index manifest file, which links all the update manifests.
Conceptually, you can have recursive manifests, nested manifests, or a tree/graph of manifests (with an unlimited amount of nesting, as far as I can tell). And in terms of performance, only new manifests are downloaded, so you don’t need to worry about a performance hit.
Our previous manifest looked like this:
Let’s rip out and stub out tasks and files, and instead, put them into a child manifest called
update1.xml. This file will look like:
Now that we have encapsulated our update into its own manifest, let’s update the original manifest to reference this one:
You’ll notice the
section, which references our
update1.xml manifest. Great!
That’s it! If you wanted to add another update, simply create an
update2.xml (or whatever you want to call it), and add another
to your master/index manifest file to reference it.
The Updater block uses manifest IDs to tell if a manifest has changed. The updater is smart enough to know if the original file has additional referenced files, even if the ID hasn’t changed. So you just need to add the new manifest, and you’re golden.
Simple as that!