Suppose we have a .NET assembly where we update the file version on every build. Then the Inno Setup compiler should generate an installer with the same version. So in order not to update the value twice, we can use this:
#define MyAppVersion GetStringFileInfo("C:\path\to\my.exe", "FileVersion")