How to deploy SQL Server 2008 Express as a prerequisite with ClickOnce

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 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.

  1. 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 : 

  2. Using VS 2008 Development Environment, create a small .Net 3.5 Windows application that connects to SQL Server 2008 Express Edition.
  3. Add a Setup Project to this Visual Studio 2008 Solution.
  4. Add the project output of the Windows Application to the setup project.
  5. In the setup project you would not be able to locate Windows Installer 4.5, .Net 3.5 SP1 and SQL Server 2008.
  6. Now download all the files from  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.
  7. Download SQLEXPR_x64_ENU.exe , SQLEXPR_x86_ENU.exe, SQLEXPR32_x86_ENU.exe from and place them in the SQLExpress2008/en folder within the Bootstrapper/packages folder. This makes sure that the SQL Server 2008 Express is present.
  8. Now to download the .Net 3.5 SP1 framework please navigate to and download the 231 MB file.
  9. 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.
  10. 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:

      DotNetFx35SP1 (folder)
      dotNetFX20 (folder
      dotNetFX30 (folder)
      dotNetFX35 (folder)
      dotNetMSP (folder)
      TOOLS folder)
      en (or some other localized folder)
      dotNetFx35setup.exe (file)

  11. 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.
  1. 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
  2. Edit the Product.xml file in Notepad.
  3. Paste the following into the <PackageFiles> element:
    <PackageFile Name="TOOLS\clwireg.exe" />
    <PackageFile Name="TOOLS\clwireg_x64.exe" />
    <PackageFile Name="TOOLS\clwireg_ia64.exe" />
  4. Find the element for <PackageFile Name="dotNetFX30\XPSEPSC-x86-en-US.exe" and change the PublicKey value to: 3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6
  5. 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
  6. Save the product.xml file
NOTE : If the table above is not properly displayed then you can refer Section in readme file. In the section 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.

Comments (0)