bzztbomb

Microsoft Application Updater Block

Microsoft Application Updater Block is supposed to be an example of “best patterns and practices”. It is a decent amount of good code that can be used to build an automated updating solution for your software.

It’s got a lot of great features: compression, only downloading the files that have changed, and hash checking to ensure you’re getting the right file. It’s got unit tests for everything.

The problem with it is, if you try to use them all together it fails horribly. Out of the box if you try to use compression you can’t use the hashes to conditionally download. If you try to use all of these features together you need to store the following info per file:

Then you need to modify the code to check the uncompressed hash for the conditional download and check the compressed hash to verify the file you got is correct. Finally, you run it through the uncompressor component to get your uncompressed version. Another annoying bug with the hash checking feature is that it does not support salted hashes. But the tool you use to generate the hash has the salted hash enabled by default.

Overall, it’s a good package but needed some tweaking for real use. I think .NET 2.0 is suppossed to have a new mechanism for updates that I hope is more mature.