cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Dean_H
Level 7

How to register a COM Object in InstallScritpt MSI?

I have an InstallScript MSI project and I need to register a .Net COM object, does anyone know how to do this?
Labels (1)
0 Kudos
(6) Replies
coJeff
Level 6

Have you tried the com extraction option on the component? Or if this doesn't work you can extract the info to a registry file and then import that into the component. I like the com extraction at build time that way if the developer changes anything you will pick up the changes.
0 Kudos
Dean_H
Level 7

I have tried several things, but none of them work. I have the file set as a key file, and the options Extract at Build and .NET COM Interop set to YES, but when I build I'm getting build errors 6210 and 4354 (build unable to extract COM info from file). I have also tried changing the setting Extract at Build to NO, but I get the same build errors.
If I register the dll using regasm from a command line it works correctly. I have also tried to use the program RegSpyUI, but when I try to extract the COM infomation, nothing is displayed. Can anyone please help
0 Kudos
Christopher_Pai
Level 16

Turn COM Extract at Build Off. That's for unmanaged libraries that expose a DllRegisterServer() function. .NET assemblies do not do this.

Try this thread: ( near the end )

http://community.acresso.com/showthread.php?t=180135&highlight=regasm

BTW you can always take the regfile generated by RegAsm and import it into the component.
0 Kudos
Dean_H
Level 7

Christopher,

I created a separate component for this Com object and its dependant .Net dll, I set Extract COM at build to No and have .Net COM Interop set to Yes, and have manually created the registry and have the reg file set to Merge at Build, but when I build I'm now getting ~18 6204 errors indicating that the imported registry conflist with existing registry. How to I get rid of these errors?
0 Kudos
Christopher_Pai
Level 16

Unless you expect the COM Interop to be changing from build to build and you'll be calling RegAsm /regfile and reimporting the reg file for each build ( which if you are, I repeat none of this should be needed .... .NET COM Interop = Yes is meant to solve this problem ) there is no reson to select the REG File To Merge At Build attribute.

Instead just expand the component, Right Click On Registry Data, click on any ROOT HIVE and select import registry hive and step through the wizard.
0 Kudos
Dean_H
Level 7

Christopher,

Yes, the file changes daily. I tried this yesterday, but for whatever reason, I was getting a host of build errors, so I thought I would try merging the reg file. I have removed that reference to the reg file, and the component is now successfully registering. Thank you very much for your help, I just wish some of this stuff was better documented. Thanks again.
0 Kudos