PDA

View Full Version : De-Register DLL



NewsArchive
11-12-2009, 02:48 AM
Hi Friedrich,

my setup installs a dll with "SELFREGISTER". If I uninstall my
application, the dll will be removed, but the regetry key under HKCR
remains. How can I perform "SELFUNREGISTER" with SB7?

Thanks in advance.

Markus

NewsArchive
11-12-2009, 02:48 AM
Hi Markus,

> my setup installs a dll with "SELFREGISTER". If I uninstall my
> application, the dll will be removed, but the regetry key under HKCR
> remains. How can I perform "SELFUNREGISTER" with SB7?

By default, if the installer application installed the file and executed the
self-registration process ("Register as OCX/DLL/EXE/TLB" option enabled),
then the uninstall will automatically execute self-unregister before the
file is removed.

To execute "self-unregister" programmatically from a custom uninstall
script, you can use the "Unregister File Operation..." script function.

Hope this helps.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
11-12-2009, 02:49 AM
So there is something wrong with my setup. I install the DLL this way:

Install File
"[_BASISORDNER_AIDAFILES][_AIDAFILES]\DLL\Crystal\Crystal\CRUFLAIDA.dll"
to "%_SB_INSTALLDIR%\Programm\CRUFLAIDA.dll" (Always Install) [SelfReg]


and uninstall this way:

Process Uninstall Queue

But after running uninstall, the DLL is removed, but the registry entry
remains.

Markus

NewsArchive
11-12-2009, 02:50 AM
Hi Markus,

> But after running uninstall, the DLL is removed, but the registry entry
> remains.

Perhaps a problem with the unregister procedure in your DLL?

The uninstall loads the DLL and calls DllUnregisterServer. The DLL will
then do the unregistration stuff.

Just tested this here with a self-reg DLL. It registered during the
installation process and automatically unregistered during the uninstall. I
tested both a 32-bit and a 64-bit DLL.

Friedrich

NewsArchive
11-13-2009, 01:46 AM
Hi Friedrich,

I've done a few tests and now, I'm more confused than before. If I
create a fresh empty project and add my DLL as selfregister: It will be
registered and unregistered. Everything is fine. The same thing in my
main project does register the dll, but it will never be unregistered.

Any ideas?

Markus

NewsArchive
11-13-2009, 01:46 AM
Hi Markus,

> I've done a few tests and now, I'm more confused than before. If I create
> a fresh empty project and add my DLL as selfregister: It will be
> registered and unregistered. Everything is fine. The same thing in my main
> project does register the dll, but it will never be unregistered.
>
> Any ideas?

Unfortunately, I don't have any idea.

Just for fun, add a "Unregister File Operation (immediately)" to your custom
uninstall script to unregister "%_SB_INSTALLDIR%\Programm\CRUFLAIDA.dll".
Add this before the "Process Uninstall Queue" function. Does this make any
difference?

Friedrich

NewsArchive
11-13-2009, 01:47 AM
By the way, please make sure that uninstall logging is not disabled if the
installer registers the DLL. If it is disabled, then the uninstall can't
unregister it.

You can send me the uninstall .log and I'll check if the registration
process is logged.

Friedrich

NewsArchive
11-13-2009, 03:21 AM
Hi Friedrich,

this is the relevant (and only) line in my uninstall.log:

|006|_0000_|C:\Programme\AIDA6\Programm\CRUFLAIDA. dll|1331|2009/10/19|08:03:00|6.0.0.9423|146112|931E3776|Interleaved 2of5C|0|


Does this suffice for uninstall and deregister the DLL?

The Options "Remove at Uninstall" and "Selfregister" are checked.

Markus

NewsArchive
11-14-2009, 02:37 AM
Hi Markus,

> this is the relevant (and only) line in my uninstall.log:
>
> |006|_0000_|C:\Programme\AIDA6\Programm\CRUFLAIDA. dll|1331|2009/10/19|08:03:00|6.0.0.9423|146112|931E3776|Interleaved 2of5C|0|

If the installer registers the DLL, it looks like this:

|006|_0000_|C:\Programme\AIDA6\Programm\CRUFLAIDA. dll|1331|2009/10/19|08:03:00|6.0.0.9423|146112|931E3776|Interleaved 2of5C|0|
|030|C:\Programme\AIDA6\Programm\CRUFLAIDA.dll

The action "030" is logged if the installer successfully registered the DLL.

>
> Does this suffice for uninstall and deregister the DLL?
>

Uninstall, yes. Unregister, no

Friedrich

NewsArchive
11-14-2009, 02:38 AM
Hi Friedrich,

I guess, that the reason is, that I stop the uninstall log later in my
script. Your help says: "Install File will register the DLL LATER". When
is later? Perhaps after I stopped the uninstall.log-recording?

Markus

NewsArchive
11-14-2009, 02:38 AM
Hi Markus,

> I guess, that the reason is, that I stop the uninstall log later in my
> script. Your help says: "Install File will register the DLL LATER". When
> is later? Perhaps after I stopped the uninstall.log-recording?

It depends on the function that you use to register the files. If you are
using the "Register as OCX/DLL/EXE/TLB" option in the "File Properties",
then the following line in your script registers "queued" files.

! Register all queued pending file operations
Register all pending file operations"

Does this help?

Friedrich

NewsArchive
11-14-2009, 02:38 AM
BINGO!

Could you add this information to your documentation please?

Thanks.

Markus

NewsArchive
11-16-2009, 01:35 AM
> BINGO!
>
> Could you add this information in your documentation? Thanks.

Done!

Friedrich