LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to enforce absolute path for a file in project?

Is there a way to specify an absolute path in an *.lvproj file?

 

I have a DLL that is used as an input to a Call Library Function node.  

The DLL file is located in the same folder location on different computers.  Yet, on those different computers some are setup with the lvproj file in a different folder path.  Thus, when LV tries to find the DLL file it cannot find it easily and reports that it is missing.

 

 

Mark | CLA
0 Kudos
Message 1 of 10
(920 Views)

I have this workaround:

 

store the proper  path in a sub.vi (or a global variabel, which is a glorified .vi with a frontpanel but no blockdiagram),

apply "specify path on diagram" in the CLF node,

read the path from the sub.vi as input for path-CLF

 

repeat for each CLF node...

 

0 Kudos
Message 2 of 10
(896 Views)

I understand your work-around but it is not quite solving my issue.  

Reason I have the dll in the project is so that it can be included in the Installer.

Mark | CLA
0 Kudos
Message 3 of 10
(853 Views)

Hi Mark,

 

2 Solutions:

 

1. Put all your projects at the same path relatively to your dll folder, on every computer. Simple and easy.

 

2. Add your absolute dll folder at the top of your LabVIEW search paths (needs to be done for each LabVIEW installation):

raphschru_1-1719005251567.png

 

The dll will be found automatically, however you may still have a warning dialog when opening your caller VIs, because the relative path of the dll has changed:

raphschru_2-1719005981388.png

 

Spoiler
There's a programmatic way to prevent warning dialogs from showing:
raphschru_0-1719015902399.png

This code could be executed when LabVIEW starts through a project provider.
However, this is a private (unsupported) feature, so it is at your own risks.

Regards,

Raphaël.

Message 4 of 10
(836 Views)

@Mark_L wrote:

I understand your work-around but it is not quite solving my issue.  

Reason I have the dll in the project is so that it can be included in the Installer.


oh, sorry, I didn't get that

 


@Mark_L wrote:
The DLL file is located in the same folder location on different computers.  Yet, on those different computers some are setup with the lvproj file in a different folder path. 

do you put  put all your projects at the same path relatively to your dll folder, on every computer, as was suggested?

0 Kudos
Message 5 of 10
(823 Views)

Looks like there is not a way to enforce an absolute path.  I understand the idea of changing the Search Paths in Options.  But posting a warning is not acceptable.  

 

Thanks for your help.

Mark | CLA
0 Kudos
Message 6 of 10
(775 Views)

I am not able to put all projects at the same path relatively to the dll folder.  Thus, the reason for the original post.

Thanks for your help.

 

Mark | CLA
0 Kudos
Message 7 of 10
(774 Views)

Specify a post-build VI in the build properties.  Have that VI move the just-installed .dll to the desired location.

0 Kudos
Message 8 of 10
(763 Views)

@paul_a_cardinale wrote:

Specify a post-build VI in the build properties.  Have that VI move the just-installed .dll to the desired location.


You can do that for an executable, but not for an installer of an executable.

To be included in the installer, the files must belong to the project tree or to the statically known built files of an executable.

0 Kudos
Message 9 of 10
(757 Views)

Define a Destination pointing to [System]\dll-folder

Set your DLL to land in that folder. 

It should work.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 10
(719 Views)