LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Build info from executable file

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!

0 Kudos
Message 1 of 7
(4,450 Views)

Good morning,

 

version information is available using the function GetCVIVersion (); ( or GetCVIVersionYear () )

Message 2 of 7
(4,441 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 7
(4,429 Views)

I have published an example program that shows how to retrieve informations embedded into executables: you can find it here



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 7
(4,415 Views)

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!

0 Kudos
Message 5 of 7
(4,413 Views)

@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 Smiley Wink

0 Kudos
Message 6 of 7
(4,365 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 7 of 7
(4,357 Views)