views:

264

answers:

2

My project uses several dll files with activex controls.

Now I am making a deployment project (windows installer).

I need to register dlls via windows installer using regsvr32. How should I do it ? And can I detect if regsvr32 failed or not ?

+2  A: 

I assume when you say you're creating a deployment project, you're talking about the nasty piece of work that's available in Visual Studio?

If so, for each DLL, you can look at their properties, and set the "Register" property to COM.

If you're using some other deployment technology (e.g. Wix, InstallShield, etc), then the answer will vary, but most of these have a simple setting to say "this is an COM dll that needs to be registered", rather than you having to kick off regsvr32.

As to detecting failure - by using the built in facilities, the COM registration takes place during the normal install process, and failures cause the install to rollback - there's no need to check this yourself; in much the same way that you don't have to check that your files made it to the install location, and don't have to worry that the disk was full.

Damien_The_Unbeliever
thanks for an answer. I didn't noticed "Register" property earlier ...
Alexander Stalt
by the way, why do your avatar look simular to Charles Gargent one ?
Alexander Stalt
@Alexander - http://meta.stackoverflow.com/questions/17443/how-is-the-default-user-avatar-generated
Damien_The_Unbeliever
Sorry for bothering you again, seems like you know the theme.When I uninstall my program, is uninstaller unregister COM dlls automatically ? Or should I additionally check some option or make some setting ?
Alexander Stalt
@Alexander - It should all just work when you install/uninstall. There shouldn't be any other options to set (why would you ever set it to register but not unregister, or vice versa?)
Damien_The_Unbeliever
(Why would my boss set :D ...)They can ask me about this option => so I should know an answer ...
Alexander Stalt
A: 

You should investigate WiX It is an open source project by MS that creates windows installers (.msi) There is a tool with that called heat that generates code on different inputs, one of which is dll registers etc. The installer framework will take care of whether proper registration has occurred

Charles Gargent
Thank you, but my current employer want to use windows installer. I can't argue with them.
Alexander Stalt
If by windows installer you mean the setup project that VS creates then no this is different, however there is project called votive that is a plugin to VS that allows you to create WiX setups with VS. Take a look, WiX is by far a much more configurable approach to authoring .msi setups.
Charles Gargent

related questions