LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Distribution Kit - problem with "Run After Setup" option

At installation time, my CVI7.0 application needs to switch to one of two sets of files, depending on the configuration of the PC it is being installed into. To accomplish this, a simple batch file detects the PC configuration and is run using the "Run After Setup" option of the distribution kit. One of the tasks of this batch file is to copy another file to replace the target of the shortcut that has been installed as the main application.
 
It all works as expected, with one exception. The final file replace operation fails. If I manually run the batch file after the distribution kit finishes, this final file replace also works. It is as though the distribution kit has not released (closed) the file handles of the files it has written, at the point that the run option occurs, thus preventing another application from modifying the files at that time. Is this likely, or is there some other explanation that I have missed?
 
JR
0 Kudos
Message 1 of 3
(3,201 Views)
JR,

It seems plausible that the files are still locked.  You could try forcing your batch file to wait by calling PING on a non-existant IP address, like this:

PING 1.1.1.1 -n 1 -w 5000

where 5000 is the number of millisecs to wait for a response.  If this still doesn't work, you can force the batch file to be run asynchronously and let the installer exit by using a second batch file.  Create a new batch file that just calls START on your existing batch file, and have the installer launch this new batch file instead.  This way, you can launch your copy batch file without having the installer wait for its completion, and you can put a sufficiently large wait in the beginning to let the installer exit before actually copying the files.

Hope this helps.

Mert A.
National Instruments
0 Kudos
Message 2 of 3
(3,189 Views)
Thanks, Mert - I'll try your suggestions tomorrow.
 
JR
0 Kudos
Message 3 of 3
(3,184 Views)