Archive: Plugin not registering


Plugin not registering
  I have a plugin that I pass a serial number to and it returns on the stack 1 for valid, 0 for invalid, or -1 for failure. It doesn't seem to be calling into the DLL, as it leaves the parameter being passed in on the stack. Below is my code, the log output that seems to indicate the problem, and a skeleton of my C code attached that is a modification of exdll.c. I had commented some things out, that I'm not sure whether they are necessary. I had a hard time getting that exdll.c to complete under Visual Studio. I remember having to recreate the whole project and solution.

 Var /GLOBAL _TBaseline_TFLSerialNumberVerifier_Result

TFlSerialNumberVerifier
::IsValidSerialNumber /NOUNLOAD "$TBaseline_SerialNumber"
Pop $_TBaseline_TFLSerialNumberVerifier_Result

${If} $_TBaseline_TFLSerialNumberVerifier_Result = 0
MessageBox MB_ICONEXCLAMATION|MB_OK "The serial number does not appear to be valid."

Goto cancelLeave
${ElseIf} $_TBaseline_TFLSerialNumberVerifier_Result = -1
Goto cancelLeave
${EndIf}

Pop $0 ; restore 0
Goto done;always skip the Abort statement, only some type of "GOTO cancelleave" can get here
cancelLeave:
Pop $0 ; restore 0
;TODO: Log error if silent
Abort ;stay on this page
done:
File: overwriteflag=1, allowskipfilesflag=2, name="C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nsd3A.tmp\TFlSerialNumberVerifier.dll"
File: wrote 13824 to "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nsd3A.tmp\TFlSerialNumberVerifier.dll"
Error registering DLL: Could not load C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nsd3A.tmp\TFlSerialNumberVerifier.dll

Eh, it lost my attachment when I previewed.


If you've recreated the solution and project, your DLL probably depends on DLL files that do not exist on clean systems. You should build your DLL as a static DLL so it won't depend on MSVCR??.DLL.


Thanks.


I've got same problem and i resolve it when i changed DLL MULTITHREAD (/MD) compiler option to MULTITHREAD (/MT)


Yeah, that has something to do with whether the c libraries are included in the exe or not. Microsoft's documentation could elaborate a little more on that kind of stuff and what those settings mean.

I was able to successfully convert the exedll project from the most recent version of NSIS and then just renamed the project and pasted my code into it, and it is working fine now.


Yes the easiest way is to copy the exdll.dsp and exdll.dsw files and just do a simple text replace. I spose it would be useful if I were to write an app to create a new NSIS plug-in project (to create the relevant dsp/dsw or vcproj files).

Stu