View Single Post
Old 15th August 2008, 17:29   #8
claesabrandt's Avatar
Join Date: Aug 2008
Location: Denmark
Posts: 54
I have work in progress This time it is a real NSIS plug-in, that can load a .NET DLL. I guess it will be called CLR.dll or CLRLoader.dll or something. What I have working so far:

1) It is placed in the plugins dir in NSIS.
2) It is called with (in one line):
PHP Code:
CLRLoader::Invoke "SomeAssembly.dll" "SomeNamespace.SomeClass" "SomeMethod" "param1,param2,param3"
pop $
3) It can handle string parameters and string return value at the moment.

Todo: Dynamic number of parameters.
Todo: Object type return value.
Todo: Fix a bug where that causes the DLL to remain in the tmp directory. NSIS can't delete it.

I also have it in a version, where you call it with System::Call, and this version does not remain in the tmp directory. This version has to be included manually in the installer and placed in for instance $PLUGINSDIR.

It is called with (one line):
PHP Code:
System::Call 'CLRLoader::Invoke(t "SomeAssembly.dll", t "SomeNamespace.SomeClass", t "SomeMethod", t "param1,param2,param3") t .r0' 
Both versions are attached.

If you want to try it, remember to rename the desired DLL to CLRLoader.dll. If it is the "native" NSIS version, put it in the pluginsdir.
claesabrandt is offline   Reply With Quote