Archive: calling dll function from NSIS script


calling dll function from NSIS script
Hi I have probably simple problem. I am a beginer in NSIS scripting. In nead to run my function placed in dll. I have tried many combinations to do that but there is still an error. Here is the goal of dll function

from rulesdll.dll

__declspec(dllexport) int delAllRules()
{
//some code
return 1;
}

What I nead is to clear some register values while uninstalling. This function works properly (tasted many times) and its complicated a bit. I just do not want to rewrite it to nsis script because it will be much harder than runnig a sigle function from rulesdll.dll

Here is a part of nsis script:

SetPluginUnload alwaysoff
SetOutPath $TEMP\eInspect ; create temp directory
File .\rulesdll.dll ; copy dll there
System::Call "rulesdll::delAllRules() i.r1"
DetailPrint "Return value: $1"

; last plugin call must not have /NOUNLOAD so NSIS will be able to delete
; the temporary DLL

SetPluginUnload manual
; do nothing (but let the installer unload the System dll)
System::Free 0

What is wrong here??
Pls help me


Try to put the full path in the System call.

It you want it even easier, see Contrib\ExDLL, with a few simple changes you can create an NSIS plug-in.


I copied rulesdll.dll into plugins dir.
Now I'm calling this function in this way but there is a error compiling the script:(

rulesdll::delAllRules "" $R0


What's the error?