LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

INSTALLDIR doesn't get passed properly to exe if install directory is a mapped drive

I have a .vi I build into and application and create an installer for using LabVIEW 7.1 and Application Builder.  In the "Advanced..." settings for "Installer Settings" I have configured a .bat file to run (run executable after installation) after the install of my app is complete.  This works fine and dandy if the install location is a simple path to a local disk.  In the batch I register some Active X ocx's, create some folders, etc.  If the install location is changed to a mapped drive I run into issues.  For example, I have another disk on my local PC that is mapped to the Z drive.  If I select the Z drive as the install location, the App installs properly and the .bat file runs correctly HOWEVER the directory I pass to the .bat file (Install Directory) is not passed properly in this scenario.  Is this a bug in Application Builder? 
 
Here is what I pass to the .bat (which is configured in the "Command Line Arguments" of Installer Settings>Advanced):
"[INSTALLDIR]" "[SOURCEDIR]" "qm.lic" "[INSTALLDIR]\Support Files\qm.lic"
 
Here is the relevent part of the .bat file:
 
cd %1
mkdir Test1
mkdir Test2
cd Test1
mkdir Configurations
cd %2
COPY %3 %4
 
As you can see, %1 is the "[INSTALLDIR]".  When I install normally to a local disk (i.e. Program Files) this gets passed properly to the batch.  I know this because the directories "Test1" and "Test2" are created properly in the installed location.  However, if I install to a mapped drive, the  "[INSTALLDIR]" is not passed properly.  The "Test1" and "Test2" folders are created in the system32 folder.  It is like it cannot associate the INSTALLDIR with a mapped location so it defaults to the system32 folder.  Any insight as to what is going on here would be much appreciated.
 
Steffan Benamou 
0 Kudos
Message 1 of 5
(3,290 Views)
Try to put "echo %1" in your batch file to see what is passed as argument. That would give some hints.


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 5
(3,282 Views)

Thanks for the reply.  Good point...

Here is what I get (%1 echoed) when installed into a local directory for INSTALLDIR:

"C:\Program Files\Program1\"

Here is what I get if I choose a mapped drive.  I have mapped drive Y: on my PC to a particular shared folder on my local machine:

"Y:\"
The system cannot find the path specified.

It looks like it just can't find the location, however all the files that I have linked in the Installer in "Installer Settings>Files" specified as "Install Directory" get added to the proper location in Y!  I would think that the Install Directory path should just get passed to INSTALLDIR path or they should be one in the same.  It seems they are not.  Any ideas?

Steffan

0 Kudos
Message 3 of 5
(3,280 Views)
The cd command doesn't change the drive unless you explicitely include the /D switch.
The command
cd /D %1
should work in all cases, changing drive or using the same.



LabVIEW, C'est LabVIEW

Message 4 of 5
(3,273 Views)
Ahh.  I see whats goin on.  Stupid mistake.  The returned error is from the cd.  Thanks for the help!
0 Kudos
Message 5 of 5
(3,270 Views)