Archive: How can i call a dll that import another dll using NSIS system plugin


How can i call a dll that import another dll using NSIS system plugin
Hey guys, I am newbie of NSIS installer. I gotta say NSIS deployment is awesome :up:. but lately I am encountered a problem.

I am using NSIS script to call let's say A.dll which compiled using Visual C++ and export some C functions. and A.dll import B.dll. So I extract them (A.dll and B.dll) to $PLUGINSDIR at the very beginning of installation.

After that I call System::call to call let's say "test()" of A.dll. but It alway return "error". I also did a test removing import of B.dll and "test()" works and return the value of what I expected.

here is the code:


;extract dll file
InitPluginsDir
SetOutPath $PLUGINSDIR
File "A.dll"
File "B.dll"


...........

;call it
System::Call "$PLUGINSDIR\A::test() i.r0"

$0 return "error"

after removing import of B.dll and re-compile A.dll. test() works fine.

Can anybody explain How can i call a dll that import another dll using NSIS system plugin. Thanks in advance. sorry for the poor English. hope you guys understand what I mean.

Make sure the current/working directory is set to $PLUGINSDIR before calling your DLL (i.e. use SetOutPath $PLUGINSDIR) otherwise it won't find the other DLL.

http://msdn.microsoft.com/en-us/libr...p_applications

Stu