- NSIS Discussion
- Installing a dll and registering it
Archive: Installing a dll and registering it
trixom
6th November 2007 12:40 UTC
Installing a dll and registering it
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 12:59 UTC
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 13:01 UTC
Thanks,
But I can't even get InstallLib to work.
T.
trixom
6th November 2007 19:56 UTC
Hi,
Allthough I appreciate the quick response, can you point me in the right direction?
T.
kichik
6th November 2007 20:02 UTC
Your question seems awfully similar to another recent question. The answer is the same, your DLL is at fault.
trixom
6th November 2007 22:16 UTC
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 22:36 UTC
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 08:52 UTC
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 10:27 UTC
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 12:14 UTC
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 12:24 UTC
edit: ignore me, issue fixed