Registering COM with cmdline - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

BackDream
Posts: 2
Joined: Tue Dec 11, 2007 9:21 am

Registering COM with cmdline

Hello, I have a COM object I must register like this:

regsvr32 /i:my_command_line_arg my_com_obj.dll

How can I make the installer register that COM object by passing it a commandline (/I flag of regsvr32) during the registration phase?

Maybe a silly question but looking at the docs I couldn't understand very well...
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

This can be done by using a custom action that launches regsvr32.exe with a specific command line. Here are the steps:
- in the "Search" page you create a file search which looks for "regsvr32.exe" file in the [SystemFolder] (this property is resolved at runtime C:\Windows\System32)
- in the "Custom Actions" page you create a "Property Source" custom action which looks like this:

Code: Select all

Property Name: RESULT_PROPERTY (the property used for the search)
Source Type: Executable (*.exe)
Command Line: "[#MyCom.dll]" /parameter (where "MyCom.dll" is the COM file and "parameter" is your custom parameter)
Expression: NOT Installed (this field is in the "Execution Condition" field)
- you will make a similar custom action for the uninstall process that will unregister the COM

You can read more about the "Search" page here:
http://www.advancedinstaller.com/user-guide/search.html
Also, you can find information about custom actions here:
http://www.advancedinstaller.com/user-g ... -page.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”