Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 20th April 2004, 15:17   #1
scully13
Senior Member
 
Join Date: Apr 2004
Posts: 130
Dependent DLL Question

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.
scully13 is offline   Reply With Quote
Old 20th April 2004, 17:45   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
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.
Joost Verburg is offline   Reply With Quote
Old 20th April 2004, 18:20   #3
scully13
Senior Member
 
Join Date: Apr 2004
Posts: 130
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,
scully13 is offline   Reply With Quote
Old 20th April 2004, 18:23   #4
scully13
Senior Member
 
Join Date: Apr 2004
Posts: 130
Here is my test code if anybody sees anything stupid I'm doing wrong.

Name "Example1"
OutFile "setup.exe"

InstallDir "$PROGRAMFILES\Example1"

ReserveFile "${NSISDIR}\Plugins\boost.dll"

Function .onInit

InitPluginsDir
SetOutPath $PLUGINSDIR
File "${NSISDIR}\Plugins\boost.dll"

FunctionEnd

Section "Section" sec

SetOutPath "$INSTDIR" ; this breaks it.
;SetOutPath $PLUGINSDIR ; putting this in makes it work.

File "${NSISDIR}\makensis.exe"

util::test
;exdll::myFunction

SectionEnd
scully13 is offline   Reply With Quote
Old 20th April 2004, 19:44   #5
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
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.
Joost Verburg is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump