Link to home
Start Free TrialLog in
Avatar of ericvb
ericvb

asked on

Visual studio .NET integrated windows installer : self registering of a dll (vsdrfCOMSelfReg)

In my application I use SQLDMO to have acces to the same possibilities as in the SQL Enterprise Manager (sqldmo.dll)
My application must run on PC's with already MSDE/SQL Server installed or PC's without MSDE/SQL Server installed (even no installed SQL Client software).
Microsoft has a knowledge paper with the steps to follow what to install for being able to run SQLDMO on a client machine without SQL client software.
You must install several dlls and one dll (sqldmo.dll) must be registered.
In a windows installer project (Visual Studio .NET) you can set the proporty REGISTER of this dll to vsdrfCOMSelfReg.
After running my installer my application was running on all machines (it worked  :-) )
But there is a 'BUT' :
The installer is not detecting that the dll is already installed and registered on machines with SQL Server. It will overwrite the existing settings and if my application is removed, the Enterprise Manager for example will not work anymore because the sqldmo.dll is not registered anymore (the deinstaller removed the registering...)

How do I tell the installer to not register the dll if this dll is already registered. It must only register the dll on 'clean' machines.
I'v searched already the net for an answer, but no luck for the moment...
Avatar of roverm
roverm
Flag of Netherlands image

What about installing all DLL's WITHOUT registrating them using a ProjectInstaller, then write some code in the 'AfterInstall' event to check whether that 1 dll is already registrated. If not: run regsvr32.exe to register it.

D'Mzz!
RoverM
Avatar of ericvb
ericvb

ASKER

Yes, I thought about it also, but how do I test if a dll is already registered?
Till now I didn't find a line of code in C# to test this.
I could also look manually in the registry, but is there no other way, using the .NET environment, for example?
I didn't find anything in the MSDN library, but I'm overlooking it maybe
I think (*know*) it can be done using some API's. But I don't have my api collection here.
I can take a look for you this evening it you want.
Avatar of ericvb

ASKER

I should be gratefully if you want to do this.
I know also that it must be possible, but I do not find it for the moment :-((
It drives me crazy, it looks so simple...
Ok, I looked for the api and I guess I was wrong. At least, I can't find it ;-)
However, I got another idea.

I am building a 'registry scanner' which scans for the dll.
Got it all working except for the last stage...the reading of the value.

Still working on it ;-)
Avatar of Bob Learned
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
Woah, forgot on this one. Do you still need a scanner?
Avatar of ericvb

ASKER

Yes, of course  :-)
The problem is still there, I didn't find a solution.
I must admit, that I putted this problem aside, didn't have the time to put more time in it.
Ok, I've build it for a great part, I only need to finish it...
PAQed, with points refunded (200)

Computer101
E-E Admin
Computer101, please read the last 2 comments. I was still working on this one!

ericvb, do you agree to open the question?
Avatar of ericvb

ASKER

I agree to let this question open
ericvb, it seems that C101 has forgotten about us.
I can reopen this question as well. Do you remember how many points you set on it? Then I can set it again.
ASKER CERTIFIED SOLUTION
Avatar of roverm
roverm
Flag of Netherlands 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
Avatar of ericvb

ASKER

Hello RoverM,

Computer101 said : 'PAQed, with points refunded (200)', so I suppose that I setted it to 200 points? I don't know it anymore....

Thanks for your function, I will test it and let you know if it helps me.
(It will take me, maybe, some time, because I'v never worked with VB : must translate to C# or include this VB code in C# (I know it is possible, but did never do this before...))

Thanks,
Eric
Else add a VB module or class to your project.
Then you can copy/paste it into that and call it from C#.
Eric, any progress?
Avatar of ericvb

ASKER

Sorry Roverm,

I did not have the time yet to test your solution and I don't know if I shall have the time in the weeks to come.
The company who I work for is taken over by another company, so I must know spend my time to coordinate this takeover.

I know that you have administrator rights, so I propose that you take already 50% of the points on your count.
I thank you very match for your help, and I hope to test your solution soon.

Regards,
Eric
Hi Eric,
No need to apologize.

I'm sorry to say that I don't longer have admin rights (I am no longer the PE of .NET) but even if I had then I wouldn't have done that.
Let's wait and see when you have time again.

Good luck with the take over.

D'Mzz!
RoverM
Avatar of ericvb

ASKER

Hi Roverm,

I didn't have the time yet to test your solution, but as thank for answering my question, I will give you the points.

Thanks,
Eric