01-09-2015 09:12 AM - edited 01-09-2015 09:13 AM
So how am i supposed to obtain the base path of my installed EXE? My main.exe returns a vi path of
C:\Program Files (x86)\tester\main.exe\Z\Labview Programs\tester\main.vi
My support files (ini, mdb, images, etc) are located in:
C:\Program Files (x86)\tester
I've never experience this before with my compiled EXEs.
01-09-2015 09:17 AM
Nevermind. I'm using the VI path when i should be using application path.
01-21-2015 12:27 PM
I am able to properly run my application and splash screen now. I was getting the "funky" paths because of a VI that I had downloaded to my desktop and added in my application. After removing that, the long paths disappeared (not sure why I left it on my desktop ).
But another issue has popped up. Is it best practice to include dynamic VIs in the EXE or keep them in a support directory? These aren't plugins so I won't need to change them for any reason or add additional ones. They are part of the Options Dialog Framework in this application. This library requires an array of paths to the individual pages that make up the options screen. I have "always included" these VIs in the EXE and selected their paths relative to the main VI but no matter what I try, the EXE won't find them. When I build these VIs into a support directory outside of the EXE, there is no problem. I don't prefer that method if possible the other way.
01-21-2015 03:35 PM
Keep in in a supprt directory- Trust me- some darned user is going to find out it can be changed and demand you change it!
01-21-2015 05:30 PM
Well, I am the only user that accesses the options screen. It's a locked down section of the program.
I would still like to know how to include them in the EXE. I am 90% certain that they are there but for some reason, the Options Dialog Framework doesn't see them. I use the following code to call the ODF and pass the paths of the VIs. When built as an EXE, this should be the path to one of them inside the EXE:
C:\Program Files (x86)\TestSTAND\TestSTAND.exe\Panels\Fan Tester_Options_Capabilities.vi
Can a VI be called that way within an EXE?
Could it have something to do with the dependencies of the VI being called?
01-21-2015 06:05 PM
If the calling VI in your image isn't at the top level of the EXE, you won't get the right path.
What error do you get when you try to load the VIs this way?
When you run the executable, with the dynamically-loaded VIs outside the EXE, are you running on your development machine? Does it still work if you move it to a machine that does not have the development environment installed? That would indicate a dependency issue. It's certainly possible that you're not including all the needed dependencies for those dynamically-loaded VIs, and that when they're outside the EXE those dependencies can still be found elsewhere because the relative path hasn't changed, but that when you put them in the EXE they're looking for those VIs inside the EXE and not finding them.
01-21-2015 08:47 PM
@aputman wrote:
Well, I am the only user that accesses the options screen. It's a locked down section...
Good luck on keeping it "locked down"
IMHO. Use the architecture you provided to the best you intended! If they need more, make them pay!
01-22-2015 08:52 AM
Jeff,
Your comments don't apply to my situation. This app is used at the company that I work for full time. It is something that i do in my spare time as an improvement to our processes. My current issue is with an options dialog to write to my config file (which can just as easily be opened in a text editor)...Big whoop but i still want to know how to do this. I have designed it to use logins from our ERP software which I also have control over who has access to what. The security of the screen is not the issue. Moving on....
Nathand,
I have not tried running it on another system as you mentioned. The VI in the previous picture is my main vi which is called dynamically from a splash screen. The error I get is below. I have tried including the ODF.lvlib into my project so that my project has the dependencies available. I dropped in a static reference to one of the options pages in the main vi and requested the path to it. I get the exact path listed in the error screen below but for some reason, the file can't be found.
01-22-2015 09:10 AM
I just realized that you may be referring to the VI that says "Custom" on the icon. That VI is part of the ODF framework and is located in user.lib.
01-22-2015 11:53 AM
I guess that what i am trying to do is not possible. I found this post where someone is using the same toolkit and received the same error.
http://forums.ni.com/t5/LabVIEW/No-properly-formatted-VI-title/td-p/2137768