Self-registering DLLs in Vista?

A

Adam Hilstad

Hi, I'm wondering how to allow a DLL to self-register when running Regsvr32
in Vista. I'd like to have an elevation prompt appear when Regsvr32 is run
for my DLL, but there seems to be a catch-22 invovled here: If I put the
self-registering behavior into a COM object, this would require that the COM
object first be registered before it can be created with
CoCreateInstanceAsAdmin. But registration is what I'm trying to accomplish
in the first place. The only other option I can think of is to have the DLL
run an executable as admin in order to indirectly perform its
self-registration. According to Microsoft's documentation, it looks to me
like the only way to request elevation within an executable is to either
launch another executable, or create a COM object. Is there a simpler option
that I'm missing here?

Thanks!
 
J

Josh

Well the obvious answer is to register the DLL's as part of your setup/MSI.
This would need to be elevated to facilitate the install anyway.

Is there a reason that won't work?
 
J

Josh

I tried replying once before, but it didn't seem to make it. so lets try
again. The obvious answer is to make this action part of your setup. Which
should prompt for elevation on install.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top