Archive: Problems using UnRegDLL


Problems using UnRegDLL
I've searched the forum without any luck...

I want to register/unregister some dll's with my setup program (apart from installing the rest of the application) and the first section works just fine.

During install, I unreg the dll in two locations (to awoid duplicates) and the one that unregisters from the installation folder (marked: >>) works just fine during setup, but when using the exact same command during uninstall it fails...
(could not load: c:\program files\TEST\TEST.dll)

running a "regsvr32 /U TEST.dll" from the commandprompt works just fine too, so the option would be using ExecWait, or ?

Anyone have a solution for this problem ?

Section "Test" TST
SetOutPath $INSTDIR\TEST
File TEST\TEST.dll
UnRegDLL $SYSDIR\TEST.dll
>> UnRegDLL $INSTDIR\TEST\TEST.dll
RegDLL $INSTDIR\TEST\TEST.dll
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd


Section "Uninstall"
UnRegDLL $INSTDIR\TEST\TEST.dll
RMDir /r "$INSTDIR\TEST"
SectionEnd





Many thanks,

Magnus


Make sure the DLL has all its dependencies where it can find them. Using the following before UnregDLL should probably do it:

SetOutPath $INSTDIR\Test

SetOutPath sets the working directory which is one of the directories where Windows looks for DLL dependencies. Don't forget to set it to something else before you want to delete the directory because the working directory cannot be deleted.


Brilliant, it works like a charm...

Thanks a lot!


/Magnus


Sorry for revive so old thread, but this is the only entry about this topic that Google shows me ;)

I have exactly the same problem; my uninstaler can't unregister a dll. It sais "could not load: C:\program files\MediaTab\MediaTab64.dll"

I tried what T595 said, adding SetOutPath $INSTDIR\MediaTab before UnRegDll but it doesn't solve the problem. Also, I tried with different values for SetOutPath without any change.

Any help? Thanks


I guess it's a x64 Dll?
http://forums.winamp.com/showthread.php?t=318803
This post is about installation, but the same applies for uninstallation:
http://nsis.sourceforge.net/Docs/AppendixB.html#B.3


Thanks for your help.
I tried what you said, but I's still failling. This is my uninstall code:

... stuff ...
${If} ${RunningX64}
;SetRegView 64 --- Commented because I used it before
Delete "$INSTDIR\Uninstall.exe"
;UnRegDLL "$INSTDIR\MediaTab64.dll" --- Commented because I used it before
define LIBRARY_X64
!insertmacro UnInstallLib REGDLL NOTSHARED NOREBOOT_NOTPROTECTED "$INSTDIR\MediaTab64.dll"
!undef LIBRARY_X64
... more stuff ...

The error still is "Could not load: C:\program files\MediaTab\MediaTab64.dll"

Thanks again; any other idea?

P.D: manual unregistering with regsvr32 works perfect

EDIT ------------------------
I defined LIBRARY_X64 at the begining of the script and I didn't remember it; I have commented the define at unistall part and now it's working.
Thank you so much!