tphillips Posted January 27, 2003 Posted January 27, 2003 Does anyone know how to install a dll file from within a .net application? I need to do this but don't have a clue at how to go about doing it. Quote
*Gurus* divil Posted January 27, 2003 *Gurus* Posted January 27, 2003 Can you explain what you mean by "install a dll file"? .NET DLLs do not need any kind of installing or registering. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
tphillips Posted January 27, 2003 Author Posted January 27, 2003 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 client's 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 :) Quote
*Gurus* divil Posted January 27, 2003 *Gurus* Posted January 27, 2003 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 don't 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 isn't there. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
tphillips Posted January 27, 2003 Author Posted January 27, 2003 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 doesn't complete within 1 second, kill it myProcess.WaitForExit(1000) If Not myProcess.HasExited Then myProcess.Kill() End If Quote
tphillips Posted January 27, 2003 Author Posted January 27, 2003 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 shouldn't tie anything to a literal path like that. Quote
*Gurus* divil Posted January 28, 2003 *Gurus* Posted January 28, 2003 What installer are you using to deploy your app? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
tphillips Posted January 28, 2003 Author Posted January 28, 2003 I am not sure yet. I need the user to be able to "Accept the Terms" and I don't think .NET's 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 :) Quote
*Gurus* divil Posted January 28, 2003 *Gurus* Posted January 28, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
tphillips Posted January 29, 2003 Author Posted January 29, 2003 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 don't think I would have found it if you hadn't 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!:) :) :) :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.