NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Test stand version selector

Solved!
Go to solution

I want Test stand version selector code. Any one has any idea how to get that? 

0 Kudos
Message 1 of 12
(1,848 Views)

Why would you need that piece of code?

(BTW, anything that NI did not provide source code through the installer or on their webpage is considered IP and general users do not have access to them - I would consider TS Version Selector to be the same)

 

Or do you just need a way to invoke the version selector programmatically?

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 12
(1,828 Views)

Perhaps version selector CLI would be enough?

 

https://www.ni.com/docs/en-US/bundle/teststand/page/tsref/infotopics/versionselector.htm

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 3 of 12
(1,804 Views)

I am able to call programmatically used ShellCommand that is solved but I have one new issue, I have to read installed TestStand versions in a PC(example TS 2017, 2019) how to get this info, not with vi, but with regedit or any command. Please suggest anyone.

0 Kudos
Message 4 of 12
(1,700 Views)

@Sanjubn wrote:

I am able to call programmatically used ShellCommand that is solved but I have one new issue, I have to read installed TestStand versions in a PC(example TS 2017, 2019) how to get this info, not with vi, but with regedit or any command. Please suggest anyone.


Instead of asking for bits and pieces, please explain your problem instead of sticking to your way of solving it, maybe others have a better and more elegant solution.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 5 of 12
(1,688 Views)

I just want to know the installed TS versions, please suggest how to get that?

0 Kudos
Message 6 of 12
(1,662 Views)

You can get that from NIPM CLI. See for example this https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019SRWSA2&l=pl-PL

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 12
(1,658 Views)

Thank you I was able to generate the report, but I has too much of information. Can you please help me simplify this, like what is that string that can tell that any specific TS version(here 2017/2019) is installed or not installed in the PC?

I have attached the reports with 2017 TS installed and 2017 TS uninstalled, please have a look. Thank you. 

Download All
0 Kudos
Message 8 of 12
(1,624 Views)
Solution
Accepted by Sanjubn

The main TS package name format is something like ni-teststand-<version number>-<bitness>, so you could use, e.g., the following command (with a pattern) to get all TS versions from 201x to 202x (both bitnesses).

 

nipkg list-installed ni-teststand-20[12]?-x[86][64]

 

Below you can find help. Read the pattern section to understand better the filtering I used.

 

nipkg help list-installed

list-installed - Show a list of installed packages

nipkg list-installed [OPTIONS]... [PATTERN]...

   Show a list of installed packages.

   PATTERN
      A Unix-like pattern used to match against the name of the package.
      Supported patterns include:
         *      - matches any number of any characters including none
         ?      - matches any single character
         [seq]  - matches any character in seq
         [!seq] - matches any character not in seq
      If not specified, PATTERN returns all possible matches.

OPTIONS
   --suppress-incompatibility-errors
      Suppress forward incompatibility errors.
      WARNING: Suppressing errors could leave your system in an unusable state.
   --install-root=<DIRECTORY>
      Override the default installation root directory when enumerating
      packages for this operation. Applies only to packages with the control
      file attribute "Plugin: relative-file".


GLOBAL OPTIONS
   --config=<PATH>, -c=<PATH>
      Allows the caller to specify an absolute path to a custom configuration
      file.

ALIASES
   list_installed

 

I'm leaving parsing for you 😉

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.
Message 9 of 12
(1,610 Views)

Thats great!!, thank you. It helped me a lot. One last query is, by any chance do you know how we can redirect this output to a file in Windows? I am using shellexecute but this just executes command but does not redirect the output of this command to a file. I need a mechanism to redirect the output of this command "

nipkg list-installed

to a file and then verify the strings in the file.

 

I am doing this in my cpp file:

sprintf_s(cmd, "%s", "info-installed");  
ShellExecuteA(NULL, "runas", "C:\\Program Files\\National Instruments\\NI Package Manager\\nipkg.exe", cmd, NULL, SW_SHOW);  //executes command

 

i am using below for redirection like,

 

char cmd[100];

const char* s = "C://report.txt";
FILE *stream;

errno_t err = fopen_s(&stream, s, "w+");

sprintf_s(cmd, "%s", "info-installed > s");  
ShellExecuteA(NULL, "runas", "C:\\Program Files\\National Instruments\\NI Package Manager\\nipkg.exe", cmd, NULL, SW_SHOW);  

 

This doesnot redirects the output to report.txt instead it creates files with no data. Please help.

0 Kudos
Message 10 of 12
(1,601 Views)