Why does every build change the exe-file?

Building the same project (without any changes) produces binary different exe-files: some small regions of them are different. Empty project, version information (and auto-increment on every build) is turned off.

Why it happens? And is it possible to make delphi produce binary equal files for the same projects?

Answers


The various structures in the PE executable file format used by Windows include timestamps that are set by the compiler and linker.

It is possible to post-process the file to reset these values to a defined constant (I wrote a tool to do exactly this for a secure product that needed exact hash values), but this should only be done on ready-to-ship executables, as some debuggers rely on the timestamps for source lookup, etc.


Need Your Help

How can we list all files and folders recursively?

java recursion apache-commons-io file-listing

As search via google, and in this SO site, results will come up with FileUtils.listFilesAndDirs() method from Apache Commons IO.

Is there a way to prevent two Python programs from executing the same binary at the same time?

python race-condition

I have two Python scripts, that both need at regular intervals (think cronjobs) to call an external program.