custom activation processor

Topics: Updater Application Block
Jul 29, 2005 at 6:51 AM
originally posted by: Puznee

I am in the middle of writing a custom activation processor to validate assembies based on their version: an assembly should only be downloaded if its version is greater than the current version of the assembly.

My code is based heavily on the ValidateHash processor, since I'm doing nearly the same thing. Version comparison is all working perfectly. If the version on disk is newer than the version in the manifest, I throw an exception (which seems to be exactly what the ValidateHash processor does).

However, instead of skipping that file and checking the rest of the files in the manifest, the UAB throws an exception and quits. What do I need to do to tell the UAB to skip only the current file when there is a version mismatch?

thanks,
Gabe
Jul 29, 2005 at 8:44 AM
originally posted by: Puznee

It appears I misunderstood the purpose of the ValidateHash processor. It does not allow partial updates based on hashing. Hash-based partial updates seem to be controlled only by the "hashComparison" attributes of the "files" tag.

Apparently the only thing that the ValidateHash processor does is raise an exception (halting the update in the process) when the manifest hash does not match the hash of the downloaded file (presumably because of a corrupted download). This is extremely confusing.

At any rate, the partial-update based on hash seems to be done internally. So to add a partial update based on assembly version will either be difficult or simply not possible without modifying the UAB code (which I'd rather not do). Does anyone have suggestions on how to implement partial updates based on a custom activation processor?

thanks,
Gabe
Jul 29, 2005 at 10:14 AM
originally posted by: Puznee

I could not figure out how to accomplish what I want with an activation processor. I think activation fires too late, after the files are already downloaded.

At any rate, I was able to achieve the result I wanted by pre-processing the manifest list - i.e., use "updater.CheckForUpdates()" to get the manifests, then remove files in the manifest with old versions (I also had to add a 'version' attribute to the manifest 'file' tag, of course), then start the download. It isn't as re-useable or as clean as an activation processor would have been, but it works.