Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting application version from within application

Is there a simple way of obtaining the application version information from the resource file at runtime?

Effectively what I'd like to do is be able to have a "Version X.Y.Z" displayed at runtime without having a separate variable somewhere that I'd have to keep in sync with my ProductVersion and FileVersion.

To clarify: yes this is a standard C++ Windows project. I am aware of the GetFileVersionInfo method but it seems silly to have to open the binary from within the version in memory just to query the version information - I'm sure I'm missing something obvious here :-)

like image 542
Konrad Avatar asked Sep 13 '12 11:09

Konrad


1 Answers

If the OS is Windows, use the GetFileVersionInfo and VerQueryValue functions.

like image 111
Superman Avatar answered Oct 03 '22 05:10

Superman