How can I register a DLL?

asked 14 Sep '11, 03:26

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%


We have two actions that deal specifically with registering Windows DLLs: <addSharedDLL> and <removeSharedDLL>. <addSharedDLL> increases the count reference for the DLL in the registry, and automatically configures the installer so it does not automatically uninstall the library. That way, you have to manually invoke <removeSharedDLL> during uninstallation, which decreases the count reference for the library, and in case the counter reaches zero, eliminates the dll file. Using this approach, you don't need to care about overwriting the DLL files (unless you are dealing with different library versions). The code would be something like the following:

<componentList>
 <component>
   <name>componentname</name>
   <description>Component Description</description>
   <folderList>
     <folder>
       <description>Windows DLL files</description>
       <destination>${windows_folder_systemroot}\system32</destination>
       <name>dllfileswindows</name>
       <platforms>windows</platforms>
       <distributionFileList>
         <distributionFile>
           <origin>${windows_folder_systemroot}/system32/yourlibrary.dll</origin>
         </distributionFile>
     </distributionFileList>
    </folder>
   </folderList>
 </component>
</componentList>

<postInstallationActionList>
 <addSharedDLL path="${windows_folder_systemroot}/system32/yourlibrary.dll" />
</postInstallationActionList>

<postUninstallationActionList>
 <removeSharedDLL path="${windows_folder_systemroot}/system32/yourlibrary.dll" />
</postUninstallationActionList>
link

answered 14 Sep '11, 03:33

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×176
×28
×5

Asked: 14 Sep '11, 03:26

Seen: 4,401 times

Last updated: 15 Sep '11, 07:21