People often ask me how to deploy SQL Server 2008 Express with applications as a prerequisite with Visual Studio 2008. Most often this situation is encountered when people want to deploy applications using the ClickOnce or they want to build a MSI package with SQL Server 2008 using Visual Studio 2008 and include the SQL Server packages with the setup.
Now I am providing you with a set of steps to demonstrate deployment of SQL Server 2008 with your application as a prerequisite. You can try these steps on your test environment first. SQL Server 2008 Express needs Windows Installer 4.5 and .Net 3.5 SP1 Framework.
In case if you are not on the MSDN blogs then I would request you to please visit my blog at http://blogs.msdn.com/manisblog because at times I improve the existing articles after reading emails from people who enthusiastically provide their feedback. These improvements might not be reflected on the other blog sites who have indexed this article.
- Download and install Visual Studio 2008 Express edition because the SQL Server 2008 bootstrapper will be found with the VS2008 Express. Now the steps that I am suggesting would be done using your usual VS 2008 SP 1 development environment like VS 2008 Professional, Team Suite etc.
NOTE: If you are using any other language version other than English like German etc. then please download the appropriate language version of Visual Studio 2008 Express and SQL Server 2008 express.
Visual Studio 2008 Express and SQL Server 2008 Express could be downloaded from : http://www.microsoft.com/express/download/
- Using VS 2008 Development Environment, create a small .Net 3.5 Windows application that connects to SQL Server 2008 Express Edition.
- Add a Setup Project to this Visual Studio 2008 Solution.
- Add the project output of the Windows Application to the setup project.
- In the setup project you would not be able to locate Windows Installer 4.5, .Net 3.5 SP1 and SQL Server 2008.
- Now download all the files from http://www.microsoft.com/downloads/details.aspx?FamilyId=5A58B56F-60B6-4412-95B9-54D056D6F9F4&displaylang=en to the Bootstrapper/packages folder which looks like C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages. This will provide you with the Windows Installer 4.5 Bootstrapper.
- Download SQLEXPR_x64_ENU.exe , SQLEXPR_x86_ENU.exe, SQLEXPR32_x86_ENU.exe from http://www.microsoft.com/downloads/details.aspx?FamilyID=58ce885d-508b-45c8-9fd3-118edd8e6fff&DisplayLang=en and place them in the SQLExpress2008/en folder within the Bootstrapper/packages folder. This makes sure that the SQL Server 2008 Express is present.
- Now to download the .Net 3.5 SP1 framework please navigate to http://download.microsoft.com/download/2/0/e/20e90413-712f-438c-988e-fdaa79a8ac3d/dotnetfx35.exe and download the 231 MB file.
- At the command prompt navigate to the folder that contains the dotnetfx35.exe file and type : dotNetFx35.exe /x:. This will extract the Framework files to a folder named "WCU" in the current directory.
- Copy the contents of the WCU\dotNetFramework folder and paste them in the %Program Files%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder (%ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 on x64 operating systems). Note: Do not copy the WCU\dotNetFramework folder itself. There should be 5 folders under the WCU folder, and each of these should now appear in the DotNetFx35SP1 folder. The folder structure should resemble the following:
en (or some other localized folder)
Now for the successful installation of the .Net 3.5 SP1 Framework on the client computer you need to take further following actions so that the framework installs successfully. After these steps you would be able to add .Net 3.5 SP1 Framework, Windows Installer 4.5 and SQL Server 2008 Express with your application setup.
- Open the [Program Files]\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder or %ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 on x64 operating systems
- Edit the Product.xml file in Notepad.
- Paste the following into the <PackageFiles> element:
<PackageFile Name="TOOLS\clwireg.exe" />
<PackageFile Name="TOOLS\clwireg_x64.exe" />
<PackageFile Name="TOOLS\clwireg_ia64.exe" />
- Find the element for <PackageFile Name="dotNetFX30\XPSEPSC-x86-en-US.exe" and change the PublicKey value to: 3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6
- Find the element for <PackageFile Name="dotNetFX30\XPSEPSC-amd64-en-US.exe" and change the PublicKey value to the same as in step 4 above
- Save the product.xml file
NOTE : If the table above is not properly displayed then you can refer Section 188.8.131.52 in readme file. In the section 184.108.40.206 you would get the options to install additional language packs as well. You should copy the PUBLICKEY from the URL below. Please navigate to the following URL:
I referred the following documents / blogs to put these steps together :
Thank you very much for visiting my blog and this article. Please keep a watch on this blog for new posts.