chasetoys
26th June 2006 06:45 UTC
Registering a DLL with RegServ32
I need to register a right click contextual menu extension when users install my applicaion. Questions:
1) How can I register upon installation?
2) How can I unregister upon un-installation?
To register the file, simply select the appropriate version of the DLL (remember that Unicode builds will not work correctly on Win95/98), copy it to an appropriate location (Windows System Directory recommended), and run "RegSvr32 CopyPathExt.dll" from the command line. The item "Copy Path to Clipboard" will now appear when you right-click on files or directories!
Thanks very much!
chasetoys
CancerFace
26th June 2006 07:07 UTC
You have several options... For installation:
ExecWait '$SYSDIR\regsvr32.exe /s "<your_path>\<your_dll>"'
and for uninstalling:
ExecWait '$SYSDIR\regsvr32.exe /u /s "<your_path>\<your_dll>"'
Or you can use
RegDLL:
SetOutPath <your_path>
RegDLL "<your_path>\<your_dll>"
and to uninstall:
SetOutPath <your_path>
UnRegDLL "<your_path>\<your_dll>"
CF
Afrow UK
26th June 2006 09:56 UTC
Make sure you use RegDLL and UnRegDLL because the regsvr32 executable is not on all Windows platforms.
-Stu
onad
27th June 2006 14:49 UTC
Better still use the InstallLib
...
!Include "Library.nsh"
...
!insertmacro InstallLib REGDLLTLB NOTSHARED REBOOT_NOTPROTECTED "c:\whereveryouroriginalfileis\yourfile.dll" "$INSTDIR\yourfile.dll" "$SYSDIR"
and do not forget to un-register at un-install...
..!insertmacro unInstallLib etc. etc.
See manual.
ChocJunkie
12th October 2009 16:24 UTC
Is it still better to use the InstallLib? If yes: Why?
Thanks :)
CJ
{_trueparuex^}
13th October 2009 11:25 UTC
InstallLib has more features and is more flexible. E.g. If you need to replace / register a dll that is on use while you install, InstallLib can do it automatically on reboot.
If you don't ever need to register files that may be on use and you only register your own files then RegDLL and UnRegDLL should work just fine.
PaR
ChocJunkie
13th October 2009 11:44 UTC
So far, I just need to (un)register my own files.
Thank you, PaR. :)
CJ
ChocJunkie
19th October 2009 14:35 UTC
I'm kind of confused right now, because I don't know why RegDLL fails.
Do I need admin rights do register a simple OCX file?
RegDLL "mydir\myOCX.ocx"
MSG
20th October 2009 12:22 UTC
Probably. You could of course find that out simply by trying it...