Get my app version in c/c++ code

Actually, there are 2 slightly different cases:

  • Sandboxed application
  • Non-sandboxed application

If your application is non-sandboxed, then your original procedure should work, afaik.
In case of sandboxed application, for each application there is its own config tree and you should grant your application access to to those trees. version information is located in system tree, so you should grant access to the system tree.

requires:
{
	configTree:
	{
		[w] .       // I need write access to my configuration data.
		[r] system    // I need read access to system configuration data.
	}
}

But that’s not all. If you’re accessing another tree, you should specify the name of this tree in path argument. So, it should look something like:

char version[256] = "unknown";
le_cfg_QuickGetString("system:/apps/helloWorld/version", version, sizeof(version), version);
1 Like