Archive: Single installer file(all files and dlls should go in a single installer file)


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,


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?


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.


*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?


What is the . in front of your method name for?

Stu


Hi Stu,

That was just a typo mistake. But it does not work even if we remove the dot(.).

Thanks,


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.