LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Distribution kit via command line!

I'm using the CVI sample program "build.exe" to perform my nightly software build via a batchfile script. I would also like to build my distribution kit via this script, but the build.exe doesn't have this feature. I researched this problem last year on NIDZ and remember one of the links saying something about "just add function XYZ to the build.exe and you can create distribution kits." I've never been able to find this link again, and I was wondering if anyone out there is building distribution kit via automated script? I know it sounds archaic, but the DOS "ugh" script is short, sweet and easy to manage instead of writing a whole new ActiveX component just to build my kit. Of course, if anyone has pointers on how to do this via ActiveX that would be great too.
0 Kudos
Message 1 of 7
(3,910 Views)
You can control the CVI enviornment via Activex, which is what the build.exe application uses. One of the functions exposed is called CVI_AppCreateDistributionKit(). So you modify build.exe and add another swtich that would run this for you.

Hope this helps
Bilal Durrani
NI
0 Kudos
Message 2 of 7
(3,893 Views)
That looks like what I need...I'll check it out. Thanks
0 Kudos
Message 3 of 7
(3,889 Views)
b..

One slight problem...I'm using CVI 5.5 (I know..time for an upgrade) and CVI_AppCreateDistributionKit is not supported. I was able to see that CVI_AppFakeKeystrokes can be used as an alternative (looking at the 5.5 version of samples\activex\cvi\cvidemo.prj)...but when I call that in build.exe I get a "This parameter is incorrect" error message. I've played around with my keystrokes array and nothing seems to get into this function to strike even one key. The error just comes back. For CVI 5.5 I used -> SAFEARRAY distKitKSArray = {VK_MENU | 'B', 'D', VK_MENU | 'B'}; ... but somehow I don't think that is the issue. Do you now what could be my problem?
0 Kudos
Message 4 of 7
(3,880 Views)
The function expects a SAFEARRAY. Try the following

SAFEARRAY *keySafeArray;
//Alt-B, D, Alt-B
int strokes[] = {VAL_UNDERLINE_MODIFIER | 'B','D',VAL_UNDERLINE_MODIFIER | 'B'};

CA_Array1DToSafeArray (strokes, CAVT_INT, 3, &keySafeArray);
CVI_AppFakeKeystrokes (newCVI, NULL, keySafeArray, &returnVal);

This will build the distribution kit correctly provided you
- have already built a release EXE/DLL. Otherwise, CVI will prompt you to do it and you would need to have addtional keystrokes for that. Use the CVI_AppSetActiveConfiguration() to set the configuration and build the exe before you attempt to build the dist kit.
- have already set the CDK options previously. The dist kit will build with whatever options the CDK dialog was saved with previously. This is something you will need to do manually before you automate the process.

If you run into timing issues, you can use the CVI_AppSetKeystrokeInterval function.

Hope this helps
Bilal Durrani
NI
Message 5 of 7
(3,853 Views)
Bilal...

That did it...thanks.

I did add a zero to my keystroke sequence {key1, key2, key3, 0} just so the fake keystroke method knows I'm done. Also, as you said, I had to add some delay to allow for the build to complete. I guess you can do virtually anything now, if you wanted to fake out the key strokes. But now I'll save about ?....120+ hours a year now that I don't need to do this manually.
0 Kudos
Message 6 of 7
(3,841 Views)
With CVI 7.1, we have added events to the CVI activex interface, like OnBuildBegin, OnBuildEnd. These might be useful for you, since the build times might vary for different projects and different systems. Another good reason to upgrade 🙂

Good luck with your project.
Bilal Durrani
NI
0 Kudos
Message 7 of 7
(3,829 Views)