To download NI software, including the products shown below, visit ni.com/downloads.
The version can be determined using the FileVersionInfo VI which, in LabVIEW 8.6 and later is found in the fileVersionInfo.llb found in the <LabVIEW 8.6>\vi.lib\Platform directory. We recommend using this VI rather than the VI included with this document.
Description-Separate-2For LabVIEW versions prior to 8.6, you can determine the version of an executable using Windows API calls located in the System.Diagnostics.FileVersionInfo class of the Windows System .NET assembly. An invoke node linked to the GetVersionInfo method of this class accepts an input for the path to an executable. The invoke node outputs a reference to this file's version information, which you can wire into a property node.
You can then select various properties from this property node such as FileVersion for the entire version information, as well as FileMajorPart, FileMinorPart, FileBuildPart, and FilePrivatePart for the respective version parts. This property node also contains properties such as ProductName, InternalProductName, LegalCopyright, and all the attributes that you can set for an executable in the LabVIEW Application Builder. The example code for this is picture can be found below in GetFileVersion_DotNet.vi.
To obtain this information for a particular executable built with LabVIEW, include a VI in the executable build that uses the Application property node properties Application»Directory Path andApplication»Name to build a path to the executable that is calling this VI.
The System.Diagnostics.FileVersionInfo class installs with the .NET Framework version 1.0 and higher. LabVIEW 8.0 requires the .NET Framework version 1.1 or higher to act as a .NET client. The .NET Framework is a free download from the Microsoft Developer Network, linked below. Refer to the attached example, GetFileVersion_DotNet.vi, for more information.
If you want to determine the version of an executable, and your system doesn't meet the minimum requirements to use the .NET Framework with LabVIEW, then you can use traditional Windows API calls with the Call Library Function Node. Refer to the attached example GetFileVersionInfo_DLL.llb for more information on this method.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.