views:

25

answers:

2

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?

+1  A: 

You are doing it wrong. The .rgs files are there so that the component can install itself. Any installer supports letting a component install itself. A Visual Studio Setup project for example, set the Register property.

Hans Passant
well, i saw that, but MSDN seems to advise against it: http://msdn.microsoft.com/en-us/library/bb204770(VS.85).aspx#no_selfreg http://msdn.microsoft.com/en-us/library/aa371608(v=VS.85).aspx am i misreading these?
Dustin Getz
Okay. In that case, my answer is "no".
Hans Passant
+1. Looks like .rgs files can only be parsed by ATL functions and their only purpose is to be included into the library resources for later use from `DllRegisterServer()`.
sharptooth
+1  A: 

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.

Christopher Painter
ok, yeah, vsdrfCOM is "unable to extract registration information" or some such. I'll check out WIX. is there ever a reason to manually enter the registration keys?
Dustin Getz
Yes. COM extraction can be a spooky process and sometimes it fails. In those cases I snapshot/profile/diff a VM to find out what it missed and then manually author those entries into the installer to compensate.
Christopher Painter