Solved

How to register a COM dll for current user

Posted on 2012-03-23
10
336 Views
Last Modified: 2012-04-11
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.
0
Comment
Question by:HPFE455
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 7

Expert Comment

by:tipsybroom
ID: 37758862
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.
0
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 37758864
Registering the DLL seperately for each user isn't really a good idea, simply because there's only one HKCR per machine, not per user. So I'd rather opt for installing your applicaiton for all users and place that COM DLL in a shared location.
0
 
LVL 22

Assisted Solution

by:ambience
ambience earned 250 total points
ID: 37762473
What you are trying to do is better handled at the Installer level. Windows based installers have capabilities of keeping a reference count with shared components and if there are three different users who have installed the same package then

- shared components are installed only once
- reference count is bumped for each installation

Almost every installer builder has support for shared components so check and use that instead and put your shared dlls in a location appropriate for all users.
0
 

Author Comment

by:HPFE455
ID: 37765874
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.
0
 
LVL 22

Expert Comment

by:ambience
ID: 37765902
did you read my comment regarding installer support for reference counting?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 86

Expert Comment

by:jkr
ID: 37766837
>>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.
0
 

Author Comment

by:HPFE455
ID: 37766891
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
0
 
LVL 22

Expert Comment

by:ambience
ID: 37766909
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.
0
 
LVL 86

Expert Comment

by:jkr
ID: 37766974
>>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.
0
 
LVL 22

Expert Comment

by:ambience
ID: 37767017
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"
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now