Comments

1 comment

  • Avatar
    Jake

    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>
    

Please sign in to leave a comment.