View Full Version : Dependent DLL Question
20th April 2004, 15:17
I had a big problem which I seem to have a work around for. Now I'm wondering if I've been doing something wrong. I have 2 DLLs. DLL A is dependent on DLL B. I wrote DLL A but I only downloaded and compiled DLL B. The problem is that if I call a SetOutPath anywhere in my NSI script before I use DLL A it won't work. I get this error in the install.log file: "Error registering DLL: Could not load C:\yada\yada\DLLA.dll". If I remove the SetOutPath or add a SetOutPath $PLUGINSDIR before my Call to DLL A I'm ok. Is there something else I can do so that I don't have to add the extra SetOutPath before every call to my DLL A?
Both files are always in the plugins directory like they should be. I also did some testing with other DLLS like advsplash.dll and it's fine. If I strip my DLL down so that it doesn't need the dependency it's ok. So, It must be that my DLL has a dependent.
20th April 2004, 17:45
Advsplash is an NSIS plug-in which does not have to be registered.
I assume you need the DLL only temporary, so why don't you create a NSIS plug-in or a DLL that doesn't have to registered?
RegDLL uses the path set by SetOutPath. If DLL B is in $PLUGINSDIR, the directory should be set to $PLUGINSDIR. You only have to add SetOutPath before registering the DLL.
20th April 2004, 18:20
I don't think either DLL needs to be registered. I've been using them for over a year and we never regsitered them before so I think that's ok. However, if there is something I can check to see if it needs to be registered I'll check it out.
DLL A is an NSIS plug-in but DLL B is not. DLL B is some of the boost library functions from boost.org.
I guess for now I'll just make sure I use "SetOutPath $PLUGINSDIR" before I call DLL A. Maybe later I'll try and merge the boost stuff in. Thanks,
20th April 2004, 18:23
Here is my test code if anybody sees anything stupid I'm doing wrong.
Section "Section" sec
SetOutPath "$INSTDIR" ; this breaks it.
;SetOutPath $PLUGINSDIR ; putting this in makes it work.
20th April 2004, 19:44
Right, I thought it was not a NSIS plug-in because you are registering it. This DLL does not have to be registered.
It is indeed true that you should set the current folder to $PLUGINSDIR if the DLL is linked to another DLL.
You can create a macro or load the the second DLL dynamically.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.