Archive: issue with uninstall of a shared dll


issue with uninstall of a shared dll
I'm using the InstallLib to register a shared DLL and use the UnInstallLib to unregister it.

After the product is installed, the DLL gets registered. However, when I goto SharedDLL path in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDlls

The DLL name is not marked as Shared (it’s not there at all in the SharedDLL reg path).
I further tested it by installing two different products. Product A installed the shared dll, and then i installed product B (they both share the same custom function from a header file to register the dll). Everything works fine. However, if I uninstall product A or product B. The shared DLL gets removed and unregistered. From that point on, for obvious reasons, i cannot use the other product.

I've tried both combinations of:

!insertmacro UnInstallLib REGDLL SHARED NOREBOOT_PROTECTED "FullPath\myDLL.dll"

!insertmacro UnInstallLib REGDLL NOTSHARED NOREBOOT_PROTECTED "FullPath\myDLL.dll"

Without any success. Is this the problem with uninstall or install? How can I find out if the Nullsoft installer has marked the DLL as a shared DLL? Is there any other place other than the Microsoft registry path above?
Any sort of hints or help will be really appreciated.


It seems as if it's a problem with how you're installing the shared dll. Can you show us the InstallLib line that installs the dll?


Check the value of the 'SHARED' parameter you provide to the macro.


Here's a function i wrote to register the shared DLL, i basically used the example from the documentation:

Function MySharedDLL

IfFileExists "$COMMONFILES\xyzDLL\xyzDLL.dll" 0 new_installation ;Replace MyApp.exe with your application filename
StrCpy $ALREADY_INSTALLED 1

new_installation:
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED ${SOURCE_DIR}\xyzDLL.dll $SYSDIR\xyzDLL.dll $SYSDIR

FunctionEnd


Am I setting the $ALREADY_INSTALLED var correctly? It would really help if you could show me an example. Thanks!


any help?