LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to find out where the exe file was installed?

Hi there,

I have the following problem: In my VI, I'm reading a .txt file through the vi "Open Config Data" in which I specify the path of the txt. file and it returns me a refnum that is used to read the file. When I made the installer to this application, I included this txt, thus, the txt is kept together in the directory where the application is installed. The problem is that the path that is specified to the vi "Open Config Data" is not valid anymore, since the instalation directory is different. I'd like to know if there's a way to know where the application was installed. Maybe through a registry? If you have a suggestion, I'd be glad to hear it.

Kind Regards,

Bruno Ponne
0 Kudos
Message 1 of 4
(2,985 Views)
Use the Current VI's Path function. Please note that the relative path to the file will be different in the EXE than in the development environement. See the first documents on this link for more details. The VIs in this document will allow you to solve your task very quickly.

Message Edité par JB le 06-22-2007 02:55 PM

Message 2 of 4
(2,979 Views)
In addition to the information that JB provided, you can also do something like what is shown in the attached VI that I use. It takes the approach of stripping the current VI's path till it gets to something that doesn't end in .exe, .llb or .vi. This will give the OS path regardless of where the VI is located. I find this useful because I sometimes build applications utilizing a library of plugins and, depending upon where the plugin library is located, the path to it may not be the same things as the path to the executable.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 4
(2,967 Views)
Thank you,

I guess this function will solve my problem.
0 Kudos
Message 4 of 4
(2,953 Views)