LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to edit Windows System Path Environment Variable with build installer?

Solved!
Go to solution

My vi uses call library function to link to a dll, the dll calls several other dll's.  If I build an install package, and install it and put all the called dll's in Windows\System32 directory on a target machine the program works fine .  I would rather keep all the program dlls in a subdirectory to the executable.  How do I update the registry path variable during install so that windows will use this path? Target OS is XP and Windows7. 

0 Kudos
Message 1 of 7
(5,309 Views)

Hi,

 

in the configuration of Call Library Function, you can check the "specify path on diagram" : this will create an entry on the BD, and you will be able to give the path of your DLL.
Maybe is it the solution...

 

Best Regards,

V-F
Message 2 of 7
(5,299 Views)

If you place the dlls into the same folder where the executable is or into a subdirectory it should actually find it. We have several dlls in the 'data' subfolder of the directory where the exe is installed. That works fine.

 

Message 3 of 7
(5,296 Views)

Thanks for reply.  I found that control, and it got me part way to solution.  Using that control allows me to point to dll in any path I want.  This helped with first level call, but for some reason, the called dll didn't find the dll's that it was calling. It appears that windows does not look in dll path location for subsequent calls to other dll's. If subsequent dll's were put in known good path (like windows\system32), the calls worked.

 

0 Kudos
Message 4 of 7
(5,289 Views)

Thanks for reply.  This seems to work if the dll is being called by a vi directly.  I am having trouble with the called dll calling other dll's.  I get it to work if the path is edited to include the data path under the executable, or if I put the second level dll's in a known windows path.  Unfortunately I have no control over the multiple dll's used (4 different dll's required for this device), that was a 3rd party supplier choice.  I'd rather keep these dll's local to the executable (in an executable path subdirectory) to make uninstall easy.  I found a utility to allow me to watch dll's being invoked.  It appears that when the second dll, calls the third, then a winapi call is made and the trace shows a failure to find the dll.

0 Kudos
Message 5 of 7
(5,286 Views)
Solution
Accepted by topic author ScouterDude

Hi,


and why don't you copy your dll (and other levels) to the Wondiws\System32 directory at the installation ?
there are options in the installer to do such a thing.

 

Best Regards,

 

V-F
Message 6 of 7
(5,281 Views)

Most likely this is the solution I will use.  It does work, but only reason I don't like it is that I now put four more dll's in a system directory, that are only applicable to one app.  I am pretty certain that upon uninstall these will get left behind on the machine.  I was hoping for an "easy" way to update system path to point to local directory.  Of course, this leads to a need to modify the path variable on uninstall, so no solution is without some concerns.  I was reading that the program, during execution, could modify registry entries in khey_current_user and then no install/uninstall is required.  Searching MS did not yield any positive results on this approach, so I guess loading the dll's to system32 path is the best.

thanks for the advise.

0 Kudos
Message 7 of 7
(5,259 Views)