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 ?
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 ?
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.
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