Search code examples
comactivexwindows-installeridlrgs

windows installer for COM component


I have a C++ activex control that I need to make an installer for. It needs to drop the dll and make some registry keys.

I have about 6 .RGS files which I made for self-registration via regsvr32, which work.

To do an installer I am manually porting the RGS scripts into the visual studio 2008 windows installer registry GUI. I feel like its not possible to do an exact port (e.g. RGS keywords like ForceRemove).

Isn't there a way to generate these files from the IDL file? Am I doing this wrong?


Solution

  • SelfReg is not a best practice in an MSI install because it's out of process and fragile. Visual Studio 2008 Installers are limited but you should be able to set the Register property to vsdrfCOM instead of vsdrfCOMSelfReg. This will cause the COM meta data to be harvested from your DLL and authored natively in MSI.

    After you build your MSI, you should notice the SelfReg table is empty and a serious of automatically authored rows in the Registry table for you COM data.

    Note: VDPROJ is kind of flakey at extracting this COM so it may not work. You might have to consider a stronger tool such as InstallShield or Windows Installer XML.