tags:

views:

38

answers:

3

Hi,

What is the COM interface that need to be implemented in order to deploy COM dll in a vista/win7 machine. I heard that there is something to deal with UAC accounts with COM, but I could not find MSDN page for this, Please help.

Thank you

+1  A: 

All you have to do to register a COM object is write the appropriate keys to the registry. There is no special interface to implement on Vista; however you need to make sure your installer has Administrative rights so it can actually write to the registry. By default programs will run as medium integrity level applications, which can't write to HKLM and HKCR (in general). If you install using MSI (look into the WiX toolkit; it makes registering COM objects easy) then the OS will automatically prompt the user for elevation at install time.

jeffamaphone
If you do decide to go with WiX, check out "Replicating COM Registration with a WiX installer" :http://stackoverflow.com/questions/543995/replicating-visual-studio-com-registration-with-a-wix-installer for my painful but enlightening journey down this road.
Robert P
Thank you for the information, I also found http://msdn.microsoft.com/en-us/library/ms679687(VS.85).aspx (COM Elevation Moniker), I need to whether there is something to handle in my COM with regard to above link, if I use WiX.
Nimo
A: 

There is no special COM interface, but you have to have elevated rights in order to run regsvr32.exe to register your COM dll. If you use an MSI to install, then Vista should automatically prompt for UAC elevation when your installer tries to register your COM dll.

There's some more information here about the UAC issue on Vista http://blogs.msdn.com/vcblog/archive/2006/09/06/742187.aspx

John Knoeller
+1  A: 

If you are deploying a COM control, it is probably as part of an application install.

In which case it is possible to use an application manifest to achieve Registration free COM. (The linked article is in the .NET section not the Windows section of MSDN, but applies to Win32 development and deployment).

Chris Becke