Steffen Winkler
Steffen Winkler

Reputation: 2864

How to get version of program in Vala?

I'm starting to learn Vala and after just a few lines of code, I just encountered my first problem. It should be kinda easy but somehow I can't find anything on Google ('vala version number' or 'vala get version number' or 'how to get version of program in vala' don't bring up anything useful).

The online documentation of Vala doesn't bring up anything useful, either. Throughout the web I find stuff on how to get Vala's version or GTK version or stuff like that.

edited stuff

What I want to get: The version of the program that is running. It should query itself to get it's own version number. I can set a version number for the project in the Anjuta IDE so I expect to be able to get that version information somehow. Since I can get the name of the application (via GLib.Environment) I should be able to get the version information, too.

edit end

May someone please be so kind and help me out here? It seems my GoogleFu isn't with me today.

Upvotes: 1

Views: 439

Answers (1)

elmarco
elmarco

Reputation: 33003

If you use the autotools, the generated config.h header will contain your package version. The symbols can then be used from Vala via a custom config.vapi binding. You could check out sampala, it shows the trick.

Upvotes: 1

Related Questions