Search code examples
cversionexecutable

How to get .exe file properties details in c?


I am writing a c application in Visual Studio 2008, and need to grab some information from the executable to send to another application.

The info I need is what you get when you right click on an executable->Properties->Details

How can you get the "Product version" and "File version" information from .exe file in c?

and also can you set such values from Visual Studio 2008? if so how?

Specifically interested in Product version and File Version, though other version info (Product Name, etc) would be helpful as well.


Solution

  • GetFileVersionInfoSize, GetFileVersionInfo, and VerQueryValue should at least give you a good start.