installing dll file from within .net

tphillips

Member
Joined
Jan 11, 2003
Messages
13
Does anyone know how to install a dll file from within a .net application? I need to do this but dont have a clue at how to go about doing it.
 
Can you explain what you mean by "install a dll file"? .NET DLLs do not need any kind of installing or registering.
 
I am going to be using Scarms Registration to generate registration IDs and the documentation for Scarms says I need to register their dll file on the clients machine before I can use the registration feature in my .net app. I know I can add it as a reference in my app but will that be enough if the documentation says I need to register it? Is adding a dll file as a reference going to be enough?

Thanks for any advice :)
 
They must be ActiveX DLLs if they need registering. In which case, in the installer you deploy your application with, you will have to inform it that they are self-registering COM DLLs and to handle them accordingly.

When you add a reference to a project to a COM DLL the IDE will generate an interop assembly for you, which the deployment project wizard will pick up, but I dont think it will pick up the other dependancy, that is the DLL you generated it for. So you will have to add both your interop assembly and the original COM DLL to your setup project if either of them isnt there.
 
Thank you! Now, if I add it as an extra dependency will it realize all by itself that it is an active X or will I need to specifiy for it to register it? I am not sure if adding it as a dependecy will just take it with the deployment or actually register any dependencies.

I was looking around some more and found the post about starting an external app interesting. I did a search on the process.start and modified it so it will use regsvr32.exe to register the dll file from within the app. Worse case scenerio I can use this. I would just prefer to add it as a dependecy if I can.

Here is the code I got to work --

Dim myProcess As Process = New Process()
myProcess.StartInfo.FileName = "Regsvr32.exe"
myProcess.StartInfo.Arguments = "C:\WINNT\system\AppSentinelTrial.dll"

start the process in a hidden window
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess.StartInfo.CreateNoWindow = True
myProcess.Start()

if the process doesnt complete within 1 second, kill it
myProcess.WaitForExit(1000)
If Not myProcess.HasExited Then
myProcess.Kill()
End If
 
but of course the myProcess.StartInfo.Arguments will point to my app.path and not to any literal place on the hard drive.. That was just for testing purposes. I know I shouldnt tie anything to a literal path like that.
 
I am not sure yet. I need the user to be able to "Accept the Terms" and I dont think .NETs installer has the option to add that form into the install.. I was looking at Install Shield but it is pretty pricey, although it looks pretty darn cool. Do you have any suggestions?

Ugh, I hate being so new to all this. There is just so much to learn :)
 
I think the .NET installer does support having a license agreement. You have to add it to the "User Interface" section of the project. It also supports registring COM DLLs.
 
Divil - thank you so very much! You have proven to be very informative. You are right, vb.net does have a license agreement area. I dont think I would have found it if you hadnt clued me into it.

For anyone else who might have the same problem, you get to ADD USER INTERFACE by right clicking on your SETUP project name (in the solution explorer) and then go to ADD/USER INTERFACE) a dialog box with a selection of items will appear.

THANK YOU AGAIN DIVIL -- YOU ROCK!:) :) :) :)
 

Similar threads

S
Replies
0
Views
57
sva0008
S
J
Replies
0
Views
59
Jalil Sear [MCPD SharePoint]
J
E
Replies
0
Views
242
Eldeeb92
E
C
Replies
0
Views
331
CDMcDaniel
C
Back
Top