NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to find the active version of teststand

Hi
 
 
can any one guide me to programatically find the current active
version of a test stand in a system
 
regards
rags
 
 
 
0 Kudos
Message 1 of 7
(3,313 Views)
Open your version selector.  See the attachment.
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 7
(3,304 Views)
This requires registry programming. From the registry, get the value of

HKEY_CLASSES_ROOT\CLSID\{B2794EF6-C0B6-11D0-939C-0020AF68E893}\InprocServer32

This will be a value like C:\Program Files\National Instruments\TestStand 4.0\bin\teapi.dll

Now iterate through all the version keys under HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\TestStand\.

Under each version key, get the value of the Path key. This will be something like C:\Program Files\National Instruments\TestStand 4.0\

The active version is indicated by whichever version key contains the path that the registered teapi.dll resides under. So, strip bin\teapi.dll off the end of the path from InprocServer32 and compare it to the path under each version key until you find a match. Be sure to do a case insensitive comparison and it would probably be a good idea to strip off trailing backslashes in case one path has one and the other doesn't.

You might be tempted to parse the version from the InprocServer32 path, but that won't necessarily work if the user changes the default installation directory.

 

Note, if you don't mind instantiating the engine, you can instead just access properties such as Engine.MajorVersion, Engine.MinorVersion, Engine.RevisionVersion, or Engine.VersionString.

 

0 Kudos
Message 3 of 7
(3,302 Views)

There is one more possible solution. In the registry, we can see the following key name

"HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\TestStand"

 

Under this, depending on the number of installed versions of TestStand, we can find a number of sub keys with the version number.

 

The RegisteredInteropAssemblies and VSCodeGenRegistered key value (found in

"HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\TestStand\version\RegisteredInteropAssemblies" and 

"HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\TestStand\version\VSCodeGenRegistered" )

is set to true for the active version. else false.

 

By just iterating through these version sub keys and reading the values of RegisteredInteropAssemblies or VSCodeGenRegistered, we can identify the active version.

 

This has worked fine so far. In case you spot only potential pitfalls, please let me know.

0 Kudos
Message 4 of 7
(2,922 Views)

I have installed today and I don't know how to move forward, that {BC7...} folder is also not available in registry directory.

0 Kudos
Message 5 of 7
(568 Views)

It worked after a restart 🙂

0 Kudos
Message 6 of 7
(559 Views)

Wouldn't it be easier to use RunState.Engine.VersionString? See this.

 

To list all the versions installed you can use nipkg.exe CLI. In example you can filter all 32-bit versions like this: C:\Program Files\National Instruments\NI Package Manager>nipkg.exe list-installed ni-teststand-????-x* (note that nipkg help mentions regex but it is just simple pattern matching, so for 64-bit version you would need to use slightly different matching).

 

 

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 7 of 7
(526 Views)