Link to home
Start Free TrialLog in
Avatar of HPFE455
HPFE455Flag for United States of America

asked on

How to register a COM dll for current user

How can I register a COM dll in the same system for multiple users.  The DLL location is under  C:\users<User> folder.

I want to register same dll separately for each user in the same computer.   Currently If one user uninstalled the application, the dll will be unregistered, so the applictaion will not work for another user.
Avatar of tipsybroom
tipsybroom
Flag of Germany image

1. dont let the user uninstall the application.

2. register a 2nd copy of the dll elsewhere in the system.

3. let the application register the dll. if the user can unregister, then the application can too.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HPFE455

ASKER

ambience, jkr, tipsybroom

My application  supports user level installation. ie, different user accounts can be installed my application in the same system. Since the COM dll registration at the system level, if any of one of the user uninstall their product, the COM dll will be  unregistered from the system and application will not work for other users

The COM  dll location will be different for each user
ex: c:\users\admin\App
ex: c:\users\guest\App
ex: c:\users\hpfe\App
 App is the installed application path. Each App folder will contain a copy of the COM DLL


 If  the installer place the dll in the shared  location, ( I need to understand  this), how    un-installation process maintains, ie, if one user uninstalled, the dll, it should not be unregistered dll, similarway if the last user unintsalled the product, the dll should be unregistered from the system.
did you read my comment regarding installer support for reference counting?
>>The COM  dll location will be different for each user

No, it won't - the location will always be the one of the latest installation, since that one will overwrite the registration of the previous ones.
Avatar of HPFE455

ASKER

ambience,
 I  have updated your suggestion to the Install team, I am waiting for the feedback.

jkr,
 I agree,  "HKCR per machine, not per user -  so we can't regsiter the same dll for different users separately.

So let me try other options
An installer component (dont confuse with COM component) that is shared must be installed to say a Common Folder like C:\Program Files\Common Files\App

User specific components and data must be installed to c:\Users\.....

With support for references or reference counting the Windows Installer components will keep track of how many times a component (installer component identified by a GUID)  got installed. It will remove only when the last reference to it is removed.

Also, you can set policies like if shared components are already installed then whether you overwrite or skip or overwrite if newer.
>>must be installed to say a Common Folder

Is there an echo? I mentioned that last week already, please take the time to read the entire thread.
Theres no echo as far I can see, I said "Installer Components" but I dont find any trace of you referring to but COM dlls, which I never referred to.

Also, "installing your application for all users" is different from saying have shared "installer components" and not so shared ones.

Please take time to understand and not just "read"