04-05-2016 07:00 PM
Good evening,
is it somehow possible to retrieve build information from a .exe file generated by Labwindows/CVI? (E.g. which directory it was build from or which CVI version.)
Thanks!
04-05-2016 11:31 PM
Good morning,
version information is available using the function GetCVIVersion (); ( or GetCVIVersionYear () )
04-06-2016 04:48 AM - edited 04-06-2016 04:58 AM
Cvi version informations can also be added to the info on the executable in Target settings >> Version Info panel: you can embed some string like e.g. Built using CVI%cvi_year (%cvi_ver) in Comment field; the string will be translated to "Built using CVI2012 SP1 (12.0.1.127)" or whichever release you are using while creating the executable. See here.
Informations set in this panel can normally be displayed in Property window of the file, and can be retrieved using Win32 APIs; unfortunately Comment field is not displayed in Properties window of Windows Explorer.
I see no way to automatically store the directory the file was built from.
04-06-2016 07:17 AM - edited 04-06-2016 07:17 AM
I have published an example program that shows how to retrieve informations embedded into executables: you can find it here
04-06-2016 07:21 AM - edited 04-06-2016 07:22 AM
Thanks! That will be very helpful!
To get the directory I will probably either create a submenu in the .uir, a pop-up message of some kind and put the information there or create a text file with version information as it pleases. At least for now that should be sufficient for my application
Edit: Thanks for the example. Greatly appreciated!
04-08-2016 02:28 AM
@RobertoBozzolo wrote:Cvi version informations can also be added to the info on the executable in Target settings >> Version Info panel: you can embed some string like e.g. Built using CVI%cvi_year (%cvi_ver) in Comment field; the string will be translated to "Built using CVI2012 SP1 (12.0.1.127)" or whichever release you are using while creating the executable.
Just one comment: the two version informations mentioned are different: Target settings are populated at build time, whereas GetCVIVersion() reports the version of the current CVI run time engine. If your software lives longer this might make a difference since the RTE could have been updated.
For this reason I provide both informations
04-08-2016 04:37 AM - edited 04-08-2016 04:39 AM
That's a good hint: the IDE used to build an executable and the RTE are independent programs and can have a different release. Both informations can be useful and normally I give both too in Info panel.
IDE release can also be retrieved in the code with the macro _CVI_ (only major and minor release number, e.g. 1201), while target versions are stored in macros _TARGET_FILE_VERSION_ and _TARGET_PROGRAM_VERSION_ (all 4 fields). All these macros are listed in Predefined macros dialog in Build options.