NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Help copying a file during TestStand deployment installation, or how to programmatically identify deployment version?

Hello,

 

     I'm attempting to set up a step in my TestStand sequence that compares the deployment version that's running to a released software configuration, so when the configuration is updated, TestStand sequences exit out and request to be updated. To do this, I need to programmatically identify the version number of the installed TestStand sequence.

 

     What I've come up with is that I can use a custom command in the deployment utility to copy the nidist.id file from <InstallerDir> to "<InstallationDir>\ProjectName\LabVIEW". Like another person who's had an issue here, I can run my command in a CMD window without issue, but the installer yields:

 

"Error code:2 occurred on command <InstallerDir>\copy nidist.id "<InstallationDir>\ProjectName\LabVIEW"

The system cannot find the file specified."

 

Similar to the other poster, I find that putting all commands into a batch file is a little ham-fisted, but I also suspect the batch file will not resolve <InstallationDir>, reducing its dynamic functionality.

0 Kudos
Message 1 of 5
(4,779 Views)

Hello,

 

A sequence file is an object in TestStand and has properties, like the version, that you should be able to access through the API. 

Have you tried following the steps outlined in the following KowledgeBase article: How Can I Programmatically Query the Sequence File Version of My TestStand Sequence?

Mena S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 5
(4,738 Views)

Thank you for getting back to me on this, Mena.

 

     I have seen this article, and I'm trying to do something a little different, or think I am, at least. The version number I'm trying to determine is the deployment version, not the version of the sequence file. This is located in plaintext in the nidist.id file created when using the TestStand Deployment Tool. Does the TestStand Deployment Tool project the deployment version number onto the sequence file version while building a deployment?

 

     The reason I think I want to use the deployment version is: What if I modify a VI but not the TestStand sequence, then re-deploy? The two sequences would be indistinguishable at first glance, it seems. One can potentially solve this by manually up-revving the sequence file any change is made, but this requires fallible memory and discipline, whereas the deployment tool is automatic.

0 Kudos
Message 3 of 5
(4,720 Views)

Are you running the installer as an administrator?

 

Also, try the syntax copy "<InstallerDir>\nidist.id" "<InstallationDir>"

 

The general windows command syntax for the copy command is copy "source" "destination", so while your current syntax works in the command prompt, there may be something preventing it from working through the deployment utility. I will keep looking into this issue to see if there are any other suggestions I can give if changing the syntax doesn't resolve it.

Mena S.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 5
(4,685 Views)

Hi Archon,

 

I was able to copy the nidist file successfully in a simple installer using the configuration below:

 

2016-01-20_161910.png

 

A couple things to note:

 

  • I am not sure if you are expecting the "ProjectName\LabVIEW" subdirectory to exist before the custom command is executed.  I used xcopy to ensure that the directory would be created if needed.  The copy command will produce the error you mentioned if the directories are not present, so that may be the issue you are hitting
  • I added "\*" at the end of the destination to prevent a prompt from the xcopy command

I also investigated the possibility of using batch files as you mentioned. You can use batch parameters to pass NI directories into a batch file using the process below:

 

  1. Create a batch file with the following contents called test.bat:

    xcopy %1\nidist.id %2\*

    in this case the batch file expects two parameters, the source and destination directories.

  2. Include this batch file in the deployment, and set its destination to the installation directory (or any other desired location).   
  3. Create a custom command to call this file, and specify the macros as parameters to the batch file.  Set the command directory to match the location you selected above (in this case, the installation directory):

 

2016-01-20_163635.png

 

Please let me know if you have any problems with either of these two approaches.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 5 of 5
(4,650 Views)