Code Monkey home page Code Monkey logo

mileversion's Introduction

mileversion

A multi-platform C++ library for executable file version reading .

#include <mileversion/mileversion.h>

int main(int argc, char* argv[])
{
	mileversion::mileversion version(argv[0]);

	if (version.haveInfo())
	{
		std::cout << "File version: " << version.fileVersion() << std::endl;
	}
	else
		std::cout << "No version info detected" << std::endl;


	return 0;
}

Windows

On Windows, the library reads the VS_FIXEDFILEINFO from the target file.

You must ensure that the file contains it, for example using an .rc file in your source project.

Linux

Linux binaries don't have embedded version info like Windows, so a workaround needed to be found.

mileversion reads the binary file using 'libelf' and tries to find a variable with a name in this format:

mileversion_versioninfo_XX_XX_XX_XX

the version info will be the 4 numbers embedded in the variable name.

The macro "MILEVERSION_DECLARE_VERSION(MH, ML, NH, NL)" can be used to declare a variable with the correct name.

Note that the binary file will depend on libelf to run.

Author

Rangel Reale

mileversion's People

Contributors

rangelreale avatar

Stargazers

xiaodao avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

inviron

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.