Installing .NET framework and SQL Server on deployment

UncleRonin

Well-known member
Joined
Feb 28, 2006
Messages
230
Location
South Africa
Programming Experience
5-10
I have an app which installs on a client PC. It needs .NET Framework 2.0 and SQL Server Express installed to run.

I know you can list the framework as a dependency but if it is not found will it be automatically installed? If not then how can you make the installer install it?

How can I add SQL Server Express as a dependency and have it install with default options if it is not found?

I really want to encapsulate everything into a single executable and not have to have a form for installing the components separately.

If anyone could help me with this I would really appreciate it.

Also, if an executable listed in an installer is changed, does the installer still deploy the previous version or the new exe.
 

vis781

Well-known member
Joined
Aug 30, 2005
Messages
2,015
Location
Cambridge, UK
Programming Experience
5-10
In 2003 we needed to download the 'BootStrapper Plugin' to package the framework in the .msi i'm not sure about 2005. As for SQL server, you could certainly package it with the installer but i'm not sure about running it directly from the installation package. One way to go would be to create a console project that does a check for the existance of SQL server on the client machine and then runs the SQL server installer if necessary. Like i say i don't know about 2005 there may well be some fancy new thing to do all this for you.
 

TechGnome

Well-known member
Joined
May 23, 2005
Messages
896
Programming Experience
10+
You will always need the bootstrapper. You can't run a .NET app if the proper FW isn't installed, and the only way to check for it is through a non-.NET app.

As for installing SQL Express....
I've ofund these two links to be the most beneful so far. I haven't gotten to the point of trying any of it out, as I'm not qoute to that point, but they should be able to give you some clues as to what you need to do.
http://msdn2.microsoft.com/en-us/library/ms165740.aspx
http://msdn.microsoft.com/sql/express/default.aspx?pull=/library/en-us/dnsse/html/emsqlexcustapp.asp

-tg
 

vis781

Well-known member
Joined
Aug 30, 2005
Messages
2,015
Location
Cambridge, UK
Programming Experience
5-10
Just incase you decide to go a different way and check to see if SQLserver is installed on the client machine on the first startup of your app you can use this....

VB.NET:
Imports System.ServiceProcess
 
Private Function CheckForSQLServer() as boolean
Dim services() As ServiceController
Dim Found as boolean = false
services = ServiceController.GetServices()
Dim i As Integer
For i = 0 To services.Length - 1
   If services(i).ServiceName.toUpper() = "MSSQLSERVER " Then
      found = true
      Exit For
   End If
Next i
Return found
end function
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,609
Location
Norway
Programming Experience
10+
If you use ClickOnce just click "Prerequisites.." (in application setting publish tab) and choose the option to include SQL Server 2005 Express.
 
Top Bottom