How does Windows interpret multiple VersionInfo Resources?
embedded-resource, version, versioning, winapi, windows
Solution
- You have to make a difference between the textual infos, and the bare VS_FIXEDFILEINFO block. The first block exist only once. The text Information is language dependent.
- "Windows" does not prefers a specific one ;) What the explorer does is a different thing. It just shows the resource information. But in fact this is just the string information and not the information from the fixed version info.
- When you call GetFileVersionInfo you get all language blocks! VerQueryValue is used to access he separate blocks.
- The installer and other routines inside windows only use the VS_FIXEDFILEINFO block. They don't care about any text blocks. And this block only exists once.
I assume that the explorer just shows the first text block and also doesn't prefer a specific one. Just use a text editor and exchange the blocks in the resource file. But maybe the resource compiler reorders them.
To access the separate parts: - VerQueryValue with "\" gives you the fixed version info block VS_FIXEDFILEINFO - VerQueryValue with "\VarFileInfo\Translation" gives you a list of translations - with "\StringFileInfo\langId_charset\keyname" you get the specific string parts
You find this information in the MSDN
Problem
I am currently studying the VersionInfo Resource(s) for Windows. It is kind of confusing that you can have multiple `VS_VERSIONINFO/VS_FIXEDFILEINFO` structures within a `VS_VERSION_INFO` Resource. As far as I get it, you can have multiple `RT_VERSION->VS_VERSION_INFO` Resources with different language ids. (Just as shown as in the picture) These 2 language ids (`0 and 1031`) have actually 2 different `VS_VERSIONINFO/VS_FIXEDFILEINFO` in each. `0` is a neutral language and seems to be prioritized than your actual local language id (which is `1031`). To me this seems to be kind of a mess and confusing. How is it possible to have multiple `VS_VERSIONINFO` structures within a `VS_VERSION_INFO` resource and what is the point? How does Windows interpret multiple Resources,Structures? And how is it possible to get only one piece of buffer when you call `GetFileVersionInfo`? It all makes little sense to me and I can't find much documentation about it.