Read adef Version field


#1

Hiya,

Is it possible to read the adef version field ‘programatically’ from a component source file?

Ta, Dave


#2

Hi,

I wasn’t sure about this myself, so I asked someone else and there are currently two options (and neither of them is as easy as I think this should be).

  1. Parse the version field from the info.properties file inside the app install directory.
  2. Read “system:/apps/myAppName/version” using the ConfigTree API. The catch with this version is that you need to grant your app read access on the ssytem tree which is not very nice from a security standpoint.

#3

Hi,

Urk, that’s a little bit ugly! And I agree that neither of the options you found are as easy as it should be.

Looks like it’s time to lodge a request for enhancement ticket. And it’s probably a good idea to ad a version string to the component cdef file as well - so when people start distributing pre-compiled components there is a mechanism for programatically checking that the correct version is being used.

Thanks for finding out.

ciao, Dave