From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
This VI uses the ActiveX FileSystemObject that is part of the Microsoft scripting host to gather file version information for exe’s and dll’s. The VI returns the version information in a variety of forms for parsing in an application.
Function:
The VI takes a filespec (path + filename) to a file for which you want the version info. It returns the following:
Full version = the result from calling GetFileVersion. Usually of the form “1.2.3.4”
No build verion = “1.2.3”. I usually use a <major>.<minor>.<bugfix> nomenclature for my builds.
Version array = an array of 1, 2, 3, 4. Useful for custom parsing.
Steps to execute code:
Drop a copy of the VI on your block diagram.
Wire a path to a file into Filespec.
Inspect the returned version results and enjoy!
Screenshots:
VI Snippet:
VI attached below
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
I've been using the vi ..\National Instruments\LabVIEW 2009\vi.lib\Platform\fileVersionInfo.llb\FileVersionInfo.vi to accomplish the same thing. Take a look at it. I found it very useful!
Thanks for the pointer to that! Do you have a method to crowbar the lpData into the FileVersionInformation.ctl? I should spend some time and dig through those llb's...