Question

How to implement MD5 check into Inno Setup, so that it could verify base installer files (exe + bins) on InitializeSetup - this is standard NSIS functionality, which is quite useful as it informs if the installer is OK or corrupted?

In case of IS that would probably require to embed MD5Summer or other MD5 checker and to create MD5 sums during/after the compilation.

Was it helpful?

Solution

What about creating md5 hashes for all .bin files? This should be done in 2 steps:

1) creating md5 hashes from compiled .bin(s) - hashes will be stored as text files inside setup.exe [so this is a 2 step compilation: create .bins, create hashes for .bins and compile again to include hashes into setup.exe]

2) at runtine in InitializeWizard() function using plug-in.

You can easily compare hashes with some Pascal string comparison function or simply '='. If hashes do not match you can exist the installer before any window is shown.

It is important to have small setup.exe - hashes must be always in the same place somewhere near the top of the [Files] section to have fast uncompress. And everything must be solid so adding hashes into setup.exe will not modify the md5 of .bins.

OTHER TIPS

Inno already does a full integrity check of its own contents. There is no need to do an extra check.

If you're using disk spanning (implied by the existance of .bin files) then the .bin files may not be available (on different disks) and so are not scanned until setup gets to that disk.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top