Old 26th June 2006, 05:45   #1
chasetoys
Junior Member
 
Join Date: May 2006
Posts: 17
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
chasetoys is offline   Reply With Quote
Old 26th June 2006, 06:07   #2
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
You have several options... For installation:
code:
ExecWait '$SYSDIR\regsvr32.exe /s "<your_path>\<your_dll>"'
and for uninstalling:
code:
ExecWait '$SYSDIR\regsvr32.exe /u /s "<your_path>\<your_dll>"'
Or you can use RegDLL:
code:
SetOutPath <your_path>
RegDLL "<your_path>\<your_dll>"

and to uninstall:
code:
SetOutPath <your_path>
UnRegDLL "<your_path>\<your_dll>"


CF
CancerFace is offline   Reply With Quote
Old 26th June 2006, 08:56   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Make sure you use RegDLL and UnRegDLL because the regsvr32 executable is not on all Windows platforms.

-Stu
Afrow UK is offline   Reply With Quote
Old 27th June 2006, 13:49   #4
onad
Senior Member
 
onad's Avatar
 
Join Date: Dec 2004
Location: Turkey
Posts: 447
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.

"Just do it"
onad is offline   Reply With Quote
Old 12th October 2009, 15:24   #5
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
Is it still better to use the InstallLib? If yes: Why?

Thanks

CJ
ChocJunkie is offline   Reply With Quote
Old 13th October 2009, 10:25   #6
{_trueparuex^}
Senior Member
 
{_trueparuex^}'s Avatar
 
Join Date: Dec 2005
Location: Glow
Posts: 285
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

The guy with the ridiculous username. Thou shall call him PaR instead.
Visit My Website
{_trueparuex^} is offline   Reply With Quote
Old 13th October 2009, 10:44   #7
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
So far, I just need to (un)register my own files.

Thank you, PaR.

CJ
ChocJunkie is offline   Reply With Quote
Old 19th October 2009, 13:35   #8
ChocJunkie
Senior Member
 
Join Date: Oct 2009
Location: Germany
Posts: 120
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?

code:

RegDLL "mydir\myOCX.ocx"

ChocJunkie is offline   Reply With Quote
Old 20th October 2009, 11:22   #9
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Probably. You could of course find that out simply by trying it...
MSG is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump