Register For COM - 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!

Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Register For COM

Hi,

We have to register a .Net assembly so it is recognised by COM. It is a non signed assembly so it is registered with its code base.

Our software is split into versions that are installed as features (Standalone, Client or Server) as it is perfectly legitimate to have more than on version on a computer at any one time.

The file that has to be COM registered is present in both the Standalone and Client. The file is installed to a different location in each feature. I've set both file to COM register on the files and folders page but only one of the files gets the registry actions.

I know that both files cannot be COM registered but if the user installs only one of the features I want that file to be COM registered. Is there a way to do this?

Cheers,
Steve Hipwell
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Register For COM

Hi Steve,

When extracting the registration info from the file, the registry entries are added automatically in the "Registry" page. Also, these registry entries are added in the component of the file. Unfortunately, what you need is not supported directly by Advanced Installer. However, you can try one of these workarounds:

1) Use duplicate registry entries:
- register only one copy of the file
- for the registry keys created in the "Registry" page use an approach similar to the one explained in the Install 32-bit/64-bit registry entries how-to
- instead of the "VersionNT64" property you can use a custom property to condition the component of the DLL; this custom property can be set through control events scheduled for your custom buttons
- after the registry entries of the first DLL are set, you can register the second DLL and condition its component with the custom property

This way you would have two sets of registry entries: one for the first DLL and the other for the second DLL. When one of the features is installed, its corespondent DLL and registry entries will also be installed.

2) Another approach is to use the same registry entries, but duplicate the values which use a reference to the file:
- register both DLLs
- duplicate the registry entries which use reference to the file by using the approach from the first method
- make sure that each duplicate file has two copies: one should reference the first DLL and the other should reference the second DLL
- in the "Organization" page move the common registry entries into a new component
- share this component between features (use drag and drop while the SHIFT key is pressed)
- make sure that the components of the duplicate registry entries are placed in the correct features and condition them with a custom property (set like in the first method)

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Re: Register For COM

Hi Cosmin,

I acheived the correct registration by manually adding the registry values as a shared component and using a property for the code base value. I set the code base property in the InstallInitialize using two custom actions; one action if feature A is installed and one action if feature B is installed. This means that if one of the features is installed (or both) then there is a valid code base.

The problem now is that if the feature who's file is referenced in the code base is removed the registry is not updated as the component is shared. Is there a way to force a shared component to be reinstalled when a modify happens?

Cheers,
Steve Hipwell
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Register For COM

Hi Steve,

When a shared component is removed Windows Installer will decrease its reference count. Therefore, the component is not uninstalled completely. Since you need to perform registry changes based on this reference count, a solution is to use a custom action. This custom action can be conditioned with the component action and its feature action.

For example, if the component in the second feature is uninstalled then the registry should be modified according to the first file.

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

Return to “Common Problems”