PDA

View Full Version : Installing a dll and registering it


trixom
6th November 2007, 11:40
Hi,

I am trying to register a dll and have tried using the following commands:

ExecWait 'regsvr32.exe /s "$SYSDIR\my.dll"

RegDLL $SYSDIR\my.dll

!insertmacro InstallLib REGDLL SHARED REBOOT_NOTPROTECTED "..\..\..\bin\Windows\my.dll" $SYSDIR\my.dll $SYSDIR

And none have worked.

It will work (all three of them) if I run the installation again (when I guess the dll is already present in the sysdir).

Please help.

Tom

PS. I am using NSIS 2.31

Afrow UK
6th November 2007, 11:59
InstallLib will extract the dll for you. The first two would require you to extract the dll first with the File instruction.

Stu

trixom
6th November 2007, 12:01
Thanks,

But I can't even get InstallLib to work.

T.

trixom
6th November 2007, 18:56
Hi,

Allthough I appreciate the quick response, can you point me in the right direction?

T.

kichik
6th November 2007, 19:02
Your question seems awfully similar to another recent question (http://forums.winamp.com/showthread.php?s=&threadid=280772). The answer is the same, your DLL is at fault.

trixom
6th November 2007, 21:16
Hi,

The first time it fails, the second time it works (dll already present).

regsvr32.exe works.

is there any tracing I can enable to see what is going wrong (I am not too familiar with the error handling of NSIS)?

Regards,

T.

kichik
6th November 2007, 21:36
How does regsvr32 suddenly work?

There's not much to trace here. If the DLL is called (which you can verify with anything from Dependency Walker to windbg), there's nothing else to it.

trixom
7th November 2007, 07:52
Hi,

Slight mis-communication here.

These three don't work (unless called for the second time):

ExecWait 'regsvr32.exe /s "$SYSDIR\my.dll"

RegDLL $SYSDIR\my.dll

!insertmacro InstallLib REGDLL SHARED REBOOT_NOTPROTECTED "..\..\..\bin\Windows\my.dll" $SYSDIR\my.dll $SYSDIR

But calling regsvr32.exe from the command line does work.

Is there a way to get the error code back from the NSIS calls (is there an Error var that is set?)?

Thanks,

T.

Afrow UK
7th November 2007, 09:27
Use ExecWait with a 3rd parameter to get the exit code.
ExecWait 'regsvr32.exe /s "$SYSDIR\my.dll" $R0
; $R0 == 0 or ?

Stu

trixom
7th November 2007, 11:14
Found the error, there was a dll dependency, but after so many copy pastes I must have tried regsvr32.exe when everything was copied over.

Thanks again.

T.

Anders
7th November 2007, 11:24
edit: ignore me, issue fixed