mmsajid
15th December 2008 11:52 UTC
Single installer file(all files and dlls should go in a single installer file)
Hi,
I required to invoke a dll in my script and I can able to do that by using the below code.But it requires the dll to be in the same level as of the exe, i.e same folder should contain the dlls to be invoked and the .exe.
Which should not be the case, as normally we should have only single exe.
Can any body suggest how can I achieve this.
---------------------------------------------
InitPluginsDir
SetOutPath $PLUGINSDIR
File CLR.dll
File One.dll
File Two.dll
Section
CLR::Call /NOUNLOAD "One.dll" "OneNamespace.OneClass" ".OneMethod"
pop $0
messagebox mb_ok $0
CLR::Destroy
...
...
SectionEnd
-------------------------------------------
Regards,
Animaether
15th December 2008 12:10 UTC
There's no need for you to include / extract the plugin file yourself, NSIS will take care of that on the first call.
( You do for the .NET assembly dlls, of course )
After that, instead of "One.dll", try "$PLUGINSDIR\One.dll" as the parameter for CLR?
mmsajid
15th December 2008 12:29 UTC
Thanks Animaether,
I tried as suggested, but throws below error.
------------------------------
Error calling .NET DLL method
The given path's format is not supported.
------------------------------
But I tried setting the path to $ExeDir and it works fine.
But it copies the dlls to the place where the executable is present.
I can delete the dlls after the installation but I think it is not the good way of doing it.
Iam sure there should be a better way for acheiving this.
Any suggestions will be appreciated.
Animaether
15th December 2008 15:04 UTC
*eyes the CLR plugin*
quaint
I just tried with the code from:
http://forums.winamp.com/showthread....16#post2402816
( ignore the VB code - just download the attachment )
Does that sample code + the DLL work for you?
If it does - try substituting the "TestCLRDLL.dll" with your "One.dll", along with the actual .NET methods called. Does that still work?
Afrow UK
15th December 2008 16:12 UTC
What is the . in front of your method name for?
Stu
mmsajid
17th December 2008 09:41 UTC
Hi Stu,
That was just a typo mistake. But it does not work even if we remove the dot(.).
Thanks,
claesabrandt
13th January 2009 13:41 UTC
mmsajid, I guess you are having problems calling .NET methods in other .NET dlls from your first .NET dll. The only way to do this is to wrap your installer in another installer. The first installer places the .NET dlls besides the second setup exe. The second setup makes the .NET calls. Now the DLL files can be found from the second installer while you will only be distributing one setup file.