This project is read-only.

Is it necessary to look at VersionItem.Type before marshalling VS_FIXEDFILEINFO?

Jan 30, 2013 at 6:39 PM

Hi guys,

I'm sad that there hasn't been much activity here recently! This is an awesome project--keep it up!

I have been scouring the web trying to find any implementations of reading a file's version out of its PE header. Everyone "cheats" and uses Win32 calls to pull this resource out. The first example I found that did what I was looking for was here:

Unfortunately, it is not strongly typed and it is in C++. But it was enough to get me started porting it to C#. Of course AFTER I had a working implementation, I ran across this project which does the exact thing I am looking for. As I was investigating your implementation of populating the version information struct (VersionResourceData.RecurseItem), I noticed that the VersionItem.Type is not used to determine if the version resource contains text or binary data, as described in the documentation for the VS_VERSIONINFO.wType:

The C++ code I started with did branch on this property, but I can't figure out if that is necessary or not. Does anyone know the answer to this? Thanks guys!