There are many programs available (like NSIS) that generate installers from a collection of files. One thing that I have noticed is, the installers produced by these programs have some kind of integrity checking built into them.
For a moment I thought that this was perhaps meant not as a security measure, but only to protect against a corrupted download. But, if it's a corrupted download, the installer won't even run, since the resources section is mangled; and even if it runs, extraction of the compressed data will inevitably fail.
The integrity check is, then, perhaps meant as a security measure. However, I'm really in doubt regarding the effectiveness of such a measure. An attacker able to MITM the download could easily disable the integrity checking for purposes of trojanisation (if not serve an entirely different binary).
So why is such a security measure implemented at all?