This article shows how to use the Windows API function ReadFile with Inno Setup. This function is sometimes quite useful because Inno Setup's file handling functions don't support security or any kind of locking/sharing mechanism. You can read from a file after opening it with CreateFile ().
The following declaration is required in a [Code] section:
function ReadFile ( hFile : THandle; lpBuffer : String; nNumberOfBytesToRead : LongInt; var lpNumberOfBytesRead : LongInt; lpOverlapped : LongInt ) : Boolean; external 'ReadFile@kernel32.dll stdcall';