06-04-2015 05:29 AM
I've made my .vi which contains functionality to read/write settings and to write logfiles. All is going well until i want to create an executable to distribute to colleagues who may not have labview development. When running the .exe, it seems i cannot create or read .txt or .ini files. Any idea how i can import the text read/write/file open functions to my .exe?
Solved! Go to Solution.
06-04-2015 05:39 AM
In order to distribute your labVIEW application as a .exe file, your collegues must have a labVIEW runtime engine. Or you can create an installer of your application and distribute.
06-04-2015 05:46 AM
The real question here is: How are you making the paths for the files? If you are making paths based on the VI location, that is your problem. As always, being able to see the actual code would help a lot here.
06-04-2015 06:29 AM
Hello,
I'm well aware of this.
The real issue is that on my same laptop, the .exe does not work with the read/write as where the .vi is fully working.
06-04-2015 06:34 AM
The paths are made relatively to the current folder with "current VI's path', so maybe you are pointing me in the good direction by telling me that i need to use some other kind of method to have the current folder? An absolute path is less convenient while distributing the .exe, any suggestions to do it on another way?
06-04-2015 06:48 AM
You are actually trying to create or read a file INSIDE of the executable. Obviously, that will not work. Instead, use the Application Directory. It returns the folder that contains your project file (when in the LabVIEW environment) or the folder of the executable (when in the RunTime Engine).
So in your given example, you would just need the Application Directory and Build Path to get the location of your settings.ini file.
06-04-2015 06:55 AM
This is a followup to Crossrulz's suggestion. I needed to access a DLL that was stored in the Data folder that the Build process creates, but that, during Development, was stored in a folder within my Project. This VI detects whether it has been called from the Run-Time or Development System and returns the appropriate path.
Bob Schor
06-04-2015 07:07 AM
@crossrulz,
thanks, this works fine in the .exe when compiled
@Bob_Schor,
this seems a interesting solution to catch differences you want between development mode and distributable, thanks for the tip!
Joachim
06-04-2015 07:27 AM - edited 06-04-2015 07:28 AM
Bob,
You should really look into Conditional Diagram Disable Structures. They are a little more efficient and you would not need that property node.