01-26-2015 08:24 AM
some path or file is wrong I guess... mmhhh... strange why it is working in development env.
01-26-2015 08:28 AM - edited 01-26-2015 08:30 AM
When you have an executable, most of the VIs are located inside the .exe file - so their path is different when they are in an .exe to when they run from the project. I normally use the 'Application Directory' VI which returns the path to the project in the development environment and the folder containing the exe in the runtime environment to build my path.
You can also use a Static VI reference and the 'VI Path' property node to the get the path to the VI. This will not only mean that the path is always correct, but the VI will also be automatically included in the .exe. Obviously if you are dynamically loading plugins or such then you might not want to do this.
01-26-2015 08:36 AM
so you mean I should take another path? When I use the source path I get this error during building: Cannot build the application because the following source files are in the destination directory. You must build the application to a different directory from the source files.
C:\Tests\PI\L-Dens\Source\src\data\AdjustmentDataStore.dll
What path should I take for building?
01-26-2015 08:43 AM
No, I am talking about paths IN the code - not the build specification. I can't look at your VI because I don't have LV2014 but from the sounds of it you have hardcoded/relative paths in your VI that break when it's running as an executable.
The build specification output directory should be an empty directory.
01-26-2015 08:49 AM - edited 01-26-2015 09:05 AM
so I found the problem, thanks. There is a sub folder and when I put this folder after building the .exe in builds folder the .exe is working fine. My question is now: how can I get these dependencies in the .exe (so the client won't see the dependencies). They should be included in the .exe.
01-26-2015 08:52 AM
As I said before - use Static VI references on the block diagram of the code (+ the VI Path property node) and these VIs will be automatically included in the .exe.
I think you can also put the files in a library and include the library.
01-26-2015 09:02 AM
do I need to change the main.vi or all VIs? What kind of Labview Version do you have? I can convert the main.vi and attach.
01-26-2015 09:11 AM
All VIs, anywhere you have a path to a VI in your application, replace that path with a Static VI reference and the 'VI Path' property node.
01-26-2015 09:14 AM
I don't want to change all VIs because this means more work and I have less time. Isn't there not another solution? How did my former colleague make a working fine .exe with the existing code? There must be another solution...
01-26-2015 09:27 AM
My misunderstanding - I thought you said you wanted all of the dependencies to be inside the .exe which is where you would need to use something like Static VI references and change the code.
If you just want to include the subfolder of VIs in the output of the build specification, just add them to the 'always included' list in the build specification source files page and then set the right destination folder in the destinations page create/add those files to that directory.