Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Register and unregister a DLL in a Windows Setup Project

I have couple of dll files that need to be registered/unregistered when a Windows installer is installed/uninstalled respectively.

I tried the following - Created a .bat file to register the dll. The issue is I am not able to add a .bat file using 'Custom Actions' in Setup Project.

Also, how to run unregister dll while uninstalling ? Please advice. Thanks.

like image 528
user591410 Avatar asked Feb 28 '12 22:02

user591410


People also ask

What does it mean to register a DLL?

By registering a DLL, you are adding information to a central directory (the Registry) for use by Windows. The information typically includes a "friendly name" for the component, which makes it easier to use from within another program, and the full path to the . dll or .

How do you register a .DLL file?

Step 1: First click on Start, then Run. Step 2: Now all you have to do to register a DLL file is to type in the regsvr32 command, followed by the path of the DLL file. Step 3: Now click OK and you should get a confirmation message that the DLL has been registered successfully.

How do I register unregister DLLs using the regsvr32 utility?

Click Start > All Programs > Accessories and right-click on "Command Prompt" and select "Run as Administrator" OR in the Search box, type CMD and when cmd.exe appears in your results, right-click on cmd.exe and select "Run as administrator" At the command prompt, enter: REGSVR32 "PATH TO THE DLL FILE"


1 Answers

Below info is my registering DLL steps:

  1. Add "Common Files" folder.
  2. Add your DLL-files into this folder.
  3. Modify DLL file's property "Register" to "`vsdrfCOMSelfReg"

Now settings done.

After you install your project, you can find Common Files folder exists with DLL (like my path "C:\Program Files (x86)\Common Files")

You can find DLL key has been registered in your RegEdit too.

If you uninstall your project, those info will be removed.

like image 182
Frank Li Avatar answered Oct 05 '22 18:10

Frank Li