[wix-users] Handling hash mismatch errors in custom bootstrapper
Martin.Schulze at haufe-lexware.com
Mon Jun 12 02:10:19 PDT 2017
I'm new to bootstrapper and working on an existing custom bootstrapper project, so please bear with my questions.
We got the following problem. Example: new version of something shall be installed. Bootstrapper executable was already downloaded into download directory and is run. But: files from an older installation still exist in proper relative path in download directory. Bootstrapper executable will find and try to cache them without triggering a ResolveSource event. CacheAquireComplete will be successful but CacheVerify will fail (due to hash mismatch). Then the engine will retry, but it caches the old/wrong file again, the result will stay the same and after 2 retries the installation will fail.
Our solution for now is to see if CacheAquireComplete was called a 2nd time for the same payload and just assume that a hash mismatch occured. We then try to rename the file in question, so it isn't found anymore and resolveSourceEvent occurs on retry (and downloads the proper file). Problem with this is, that it is only an assumption that a hash mismatch occured. Also there seems to be no information about the actual path the payload was resolved from in CacheAquireComplete. For now we assume it has to be relative from WixBundleOriginalSource, but I'm not sure if this is correct.
So is there a better, more precise way to handling this error situation?
More information about the wix-users