LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find DLL in installed app

LabVIEW 8.2, Windows

 

I have a development folder called CCT.

In it is my project file, 5-6 LLB files, and two DLLs.

The main DLL is written in FORTRAN, and I don't have access to the source.

It uses a 2nd DLL called DFORRT.dll, some kind of FORTRAN runtime library.

There is only one function I call in the main DLL, and only one VI I call it from.

That CALL LIBRARY  FUNCTION node is configured correctly as far as parameters go.

I configure the CLF's PATH parameter with a relative path, as well as I can.  But it always converts it into an absolute path.

 

I run the program, and it works.

 

I have two BUILD SPECS, one for the app, one for an installer.

The APP one creates a folder called APP, and it puts the EXE and the two DLLs in that folder. (I set the SUPPORT FILES folder to be the same as the EXE itself).

 

That app runs fine, as well.  Is it using the DLL from the CCT folder, or from CCT\APP?  Well, i deleted the DLL from CCT, and the APP version still ran, so I assume it's using the one in APP.

 

The 2nd build spec creates a folder called APP\INSTALLER and puts a SETUP program in there.   It uses the first build spec as a source.

 

When I run the installer, I get a folder that looks (to me) right: the DLLs are in the same folder as the EXE.

 

But it will not run - when I ask for the results produced by the DLL, crash!.  No message, no nothing, just windows disappear, the program is terminated.

 

I suspect it is because the installer has changed the path to the DLL.

 

I've tried a lot of combinations for paths for the support files.  If the path for the dev system isn't right, the crash takes LabVIEW down, as well. No message, no grace, LabVIEW just takes all the windows down and goes home.

 

I've tried specifying the path myself, using the SPECIFY PATH ON DIAGRAM feature (I already calculate my own path for other reasons), but I can't find a combination that works in all three situations: Dev system, App, and installed app.

 

How do you specify a relative path in the CLF?

 

Is there something else I'm missing? 

Message Edited by CoastalMaineBird on 08-19-2008 08:20 AM
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 5
(2,884 Views)

More Info:

 

In the folder created when I install the app, the two DLLs are right next to the EXE, as I expected.

 

If I move the DFORRT dll somewhere else, the program complains that it can't be found.  So that's not the issue.

 

If I move the main DLL somewhere else, the program asks me to find it.  So that's not the issue, either.

 

If I find it and then ask for results, it crashes the same old way. 

 

If the absolute path was an issue, then it still should work, since I am installing it on the same machine, and the original path is still valid.

 

Maybe I have some other problem lurking... 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 5
(2,868 Views)

More info:

 

In the VI that calls the DLL, I added a piece to log the parameters to the CLF call to a text file BEFORE calling the DLL.

I open/create, write, and close the file before the CLF.

 

All worked as expected in the devsys version, and in the built app.

 

But the installed version crashed again, leaving NO LOG FILE behind.

 

I tried again, same result.

 

I moved the installed folder (CCT, containing the EXE and DLLs) to the desktop, and it worked from there.

 

I moved it BACK into the PROGRAM FILES folder, and now it works there.

 

Puzzled... 

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 5
(2,862 Views)

Yet more info:

 

This is some sort of Windows permissions problem, apparently.

 

The FORTRAN piece (in the DLL) creates a file called "fort.33".  I don't know what it is.

 

If you throw it away, it appears the next time you run it.  At least it does in the devsys version, and the built-app version.

 

But in the installed version (in PROGRAM FILES folder), it apparently cannot create that file, and crashes. 

 

When I drag the folder to the desktop and run it, it creates that file, and all is well.

If I drag the folder back to PROGRAM FILES, the FORT.33 is already there, and all is well.

If I delete FORT.33 from the folder, I crash again.

 

If I install a fresh copy, and then drag in a FORT.33 file, it doesn't work

 

More puzzlement..... 

Message Edited by CoastalMaineBird on 08-19-2008 12:20 PM
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 5
(2,859 Views)

OK, this is getting a bit clearer.

 

If I wipe out everything and start over,  I get the same result in the PROGRAM FILES folder - crash-o-matic.

 

I made sure to write the log file before it called the DLL, thinking that would provide an insight.

 

But it cannot write the log file BECAUSE IT DOESN'T HAVE PERMISSION FOR THAT, either!

 

If I run the program AS ADMINISTRATOR, then all is well.

 

If I change the log function to show an error message, it complains about permissions and then crashes. 

 

If I change the log function to write the log file to my personal DOCS folder, it writes one log entry and THEN crashes. 

 

So it's definitely the inability of the FORTRAN piece to write to its own folder that is the problem.

 

Now, what to do about it... 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 5
(2,836 Views)