How about a bootstrapper package for SQLServer Express 2008 R2?

When publishing a ClickOnce application, you can open the Prerequisites dialog and select any of the packages to be installed prior to the ClickOnce application. You would probably select the .NET Framework that your application targets and Windows Installer 3.1. You would also select the SQLServer Express 2008 database software if you are using a SQLExpress database in your application.

Last summer, Microsoft released SP-1 for SQLServer 2008 and several people posted to the MSDN ClickOnce Forum and Stack Overflow asking where they could get a new, updated bootstrapper package. I decided to pursue it and see if I could track it down.

I’ll just ask Microsoft.

Saurabh Bhatia, who’s kind enough to help me answer the most difficult ClickOnce questions, routed me to the SQLServer Express program manager, Krzysztof Kozielczyk. Krzysztof said he totally agreed that Microsoft should release a new version of the bootstrapper package every time they updated SQLExpress, but they were busy working on the upcoming releases and he did not have the resources to work on it. It’s hard to know what to say when you tell someone “You should have this” and they say “You’re right, we should, I’m sorry we don’t.” (I’m going to have to remember to use that on my boss in the future.)

According to Krzysztof, the problem is that they can’t just create the package and release it. They have to create the boostrapper package and test it in a bunch of combinations or different variables, such as operating system version, SQLServer Express version (to test that the upgrade works), .NET version, number of olives in a jar, and kinds of mayonnaise available on the west coast, among others. Then if it passes mustard (haha), they have to find somewhere to post it, make it available, and then keep it updated. So more people are involved than just his team, and at that time, everyone in DevDiv at Microsoft was working on the upcoming release of VS2010.

Persistence is one of my best qualiities, so I continued over the following months to badger try to convince Krzysztof to at least help me create the package and provide it to the community, especially after R2 came out. Every time someone posted the request to one of the forums, I would take a screenshot and send it to him. He was unfailingly kind, but stuck to his guns. There’s even been a bug filed in Connect for this issue. (On the bright side, Krzysztof did answer the occasional SQLExpress question from the forums for me.)

Success! (and disclaimers)

Well, we’ve had quite a bit of back and forth lately, and I’m happy to report that I now have a bootstrapper package that I can use to install SQLServer Express 2008 R2 as a prerequisite to a ClickOnce application. (I skipped 2008 SP-1). Krzysztof did not provide the solution, but by peppering the guy with questions, I have finally created a working package. So big thanks to Krzysztof for continuing to answer my questions and put up with the badgering over the past few months. Now he doesn’t need to avoid me when I go to the MVP Summit at the end of this month!

Disclaimer: This did not come from Microsoft, I figured it out and am posting it for the benefit of the community. Microsoft has no responsibility or liability for this information. I tested it (more on that below), but you must try it out and make sure it works for you rather than assuming. Legally, I have to say this: Caveat emptor. There is no warranty expressed or implied. Habeas corpus. E pluribus unum. Quid pro quo. Vene vidi vici. Ad infinitum. Cogito ergo sum. That is all of the Latin-ish legalese I can come up with to cover my you-know-what. (I have more sympathy for Krzysztof now.)

I tested the package as the prerequisite for a ClickOnce application with both 32-bit and 64-bit Windows 7. I tested it with no SQLExpress installed (i.e. new installation) and with SQLExpress 2008 installed (to test that it updates it to R2). I did not test it with a setup & deployment package, but I’m certain it will work. Maybe one of you will try it out and let me know. I did not try it all of the combinations listed above for Microsoft testing, although I did eat some olives out of a jar while I was testing it.

Enough talk, show me the goods

Here are the instructions on creating your own SQLServer 2008 R2 prerequisite package. You must have a SQLServer 2008 Prerequisite package in order to do this. If you don’t have one, and you don’t have VS2010, install the Express version (it’s free). I think you can also install the Windows 7 SDK and it ill provide those prerequisite packages (I’m guessing, since they show up under the Windows folder under SDKs).

I didn’t post the whole package because there is a program included in the bootstrapper package called SqlExpressChk.exe that you need, and it is not legal for me to distribute it. (I don’t think my Latin would withstand the scrutiny of a Microsoft lawyer.)

First, locate your current bootstrapper packages. On my 64-bit Windows 7 machine, they are under C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages. If you don’t have the \en\ folder, presumably you have one for a differeng language; just wing it and substitute that folder in the following instructions.

  1. Copy the folder called “SQLExpress2008” to a new folder called “SQLExpress2008R2”.
  2. Download the zip file with the product.xml and package.xml you need from here and unzip it.
  3. In the new \SQLExpress2008R2\ folder, replace the product.xml file with my version.
  4. In the \SQLExpress2008R2\en\ folder, replace the package.xml file with my version.
  5. Delete the two SQLExpr*.exe files in the \SQLExpress2008R2\en\ folder.
  6. Download the 32-bit install package from here and put it in the \SQLExpress2008R2\en\ folder.
  7. Download the 64-bit install package from here and put it in the \SQLExpress2008R2\en\ folder.
  8. Close and re-open Visual Studio. You should be able to go to the Publish tab of your application and click on the Prerequisites button and see “SQLExpress2008R2” in the list.

Do NOT remove the SqlExpressChk.exe file from the \SQLExpress2008R2\ folder, or the eula.rtf from the \SQLExpress2008R2\en\ folder.

If you’re using ClickOnce deployment, don’t forget that it does not install updates to the prerequisites automatically – it only updates the ClickOnce application. You will either have to have your customers install the prerequisite before they upgrade the ClickOnce application (just ask them to run the setup.exe again), or programmatically uninstall and reinstall the application for them, including the new prerequisite. (The code for that is in this MSDN article.)


78 Responses to “How about a bootstrapper package for SQLServer Express 2008 R2?”

  1. How to Prepare your Failed Hard Drive for Shipping Says:

    […] How about a bootstrapper package for SQLServer Express 2008 R2 … […]

  2. Workout Bench: Malibu Pilates Chair – Accelerated Results Package Says:

    […] How about a bootstrapper package for SQLServer Express 2008 R2 … […]

  3. Traffic Jams Are Stressful, Right? Think Again! | Driving Anxiety Says:

    […] How about a bootstrapper package for SQLServer Express 2008 R2 … […]

  4. Windows Client Developer Roundup 058 for 2/7/2011 - Pete Brown's Says:

    […] Bootstrapper Package for SQL Server Expression 2008 R2 (Robin Dot Net) […]

  5. Tweets that mention How about a bootstrapper package for SQLServer Express 2008 R2? « RobinDotNet's Blog -- Says:

    […] This post was mentioned on Twitter by RobinDotNet, RobinDotNet. RobinDotNet said: Bootstrapper package for SQLServer Express 2008 R2 for ClickOnce deployment is here: […]

  6. How do I check my Android OS version on LG POP phone? | Android Phone Review Says:

    […] How about a bootstrapper package for SQLServe&#114&#32&#69xpress 2008 R2 … […]

  7. Bootstrapper Package for SQL Server Express 2008 R2 - MSDN Blogs Says:

    […] Read it on her blog: How about a bootstrapper package for SQLServer Express 2008 R2? […]

  8. JDS Says:

    Well done Robin for pursuing this. I can’t believe how difficult it has been to get the necessary information. I note the resistance from MS because they have to test it in the various permutations that exist – but surely that is the job of MS; to do it once for the benefit of developers and not have 1000’s of developers having to duplicate that effort over and over. That and the fact that they have access to the necessary information to create the bootstrapper packages in the first place.

    • robindotnet Says:

      You’re welcome. I did it because I totally agree with you; you’re not saying anything I haven’t said (repeatedly) to the SqlServer Express program manager. I gave the guy a pretty hard time about how MSFT always wants you to use the most current versions, but for SSE they won’t give you the bootstrapper you need to do that. He just keeps agreeing with me. It’s hard to argue with someone who agrees with you!

      • Gordon Freeman Says:

        I completely understand Microsoft. Why would THEY develop a Windows boostrapper for SQLServer 2008R2 so people can ship a ClickOnce installation for a project developped under Visual Studio 2010? After all, it should be done by the developpers of Windows, SQLServer, ClickOnce and Visual Studio, not them! Oh wait…

  9. JustNod Says:

    Looks very useful, thank you. It’s disappointing but entirely predictable that Microsoft do not yet offer a bootstrapper. It’s only the fact that I anticipated such problems in the first place that I came across your blog. If it were not for prior experience I would have soldiered on assuming that I would eventually uncover such a beast lurking behind a door marked “Beware of the Leopard” (phrase credit: Douglas Adams).

    I have located the SQLExpress2008 folder on my Windows 7 box which also has Visual Studio 2010 installed. Can I just transfer the contents of THIS folder to a SQLExpress2008R2 folder on my other PC (Windows XP with Visual Studio 2005 plus and SQL 2005 Express) before following the rest of your instructions or do I need to install SQL 2008 Express first?

    • robindotnet Says:

      You can just copy it. I don’t have SQLServer Express installed on my machine, I use the SQLServer Developers Edition. I was able to make the modifications and actually deploy a small Windows Forms app with SQLServer express 2008 R2 as a prerequisite and test it in a VM without ever installing it on my machine!
      Good luck!

  10. JustNod Says:

    Thank you.

  11. smith Says:

    can the SqlExpressChk.exe check if sqlserver express R2 is installed?

    • robindotnet Says:

      Yes, with the right parameters. That’s why the instructions say to copy the current Packages folder for SQLExpress2008 and then replace the xml and redistributables. If you look at package.xml under the \en folder, you’ll see that it references and uses sqlexpresschk.exe.

  12. smith Says:

    thanks for response. i am stuck trying to install sqlserver optionally.
    I need to install sql server only if a user choose “server” radiobutton in a custom user interface i created.
    can i install download from internet and possible show progress of the sql server installation?


  13. Debbie Says:

    This is was so helpful – Thank you. One note – to use this you need to copy the correct version of SqlExpressChk into your new folder – The one in the v6.0A folder(vs2008) is different than the one in v7.0A folder (vs2010) – and returns different results. Once I figured out that i had a different SqlExpressChk.exe, it worked perfectly! Thank you Robin.

    • robindotnet Says:

      I am glad it was helpful. I actually copied the SQLExpress 2008 prerequisite folder and then modified the XML, and that version of the sqlexpresschk.exe worked fine as well.

  14. Marius Says:

    You are a life saver. You did a great job with this post!

  15. How about a bootstrapper package for SQLServer Express 2008 R2? « RobinDotNet’s Blog | Rod's space Says:

    […] How about a bootstrapper package for SQLServer Express 2008 R2? « RobinDotNet’s Blog This entry was posted in Computers and Internet. Bookmark the permalink. ← Get Local Application Data Directory — Gist LikeBe the first to like this post. […]

  16. Rob Says:

    Thank you so much for all your effort with this. After reading much of the frustration with Microsoft’s avoidance of this issue, it was a relief to find your solution, which works wonderfully.

    Now, if you give a mouse a cookie… he might ask if there is a way to use the SQLServer Express 2008 R2 with Management Tools executable with your bootstrapper solution.

    Thanks again.

    • robindotnet Says:

      Hi Rob,
      I tell you what. If you try my instructions with the SQLServer Express 2008 R2 w/Management Tools executable and it doesn’t work, post back and I’ll take the results to the SQL Server express product manager and ask for additional help.

      • Greg Says:

        Hi, I have another question, how to add SQL2008R2 WITH TOOLS (mgmt studio etc.) to be downloaded from vendor website? This in not only a matter of proper executables… I suppose different PRODUCT_ID / vendor site links. Could You help us with this?

  17. Bob M Says:

    Wow! This saved me a lot of work. I was about to uninstall SQL 2008 R2 Express and install the 2008 version, recreate my databases for the older version, update models, change connections, etc., etc…

    I did have a couple of minor problems when I first tried to publish:

    1. error – “no public key for Sql 2008 R2”. Solution – copy public key in package.xml in folder en\SQLExpress2008 to package.xml in en\SQLExpress2008R2.
    2. warning – key for 32 bit version does not match. Solution – I removed this public key from package.xml en\SQLExpress2008R2 since I’m only using the 64 bit version. Although I did not receive ths warning when publishing prior to the installation of this new bootstrapper package.

    Thanks much.

    • robindotnet Says:

      I removed the public key, and it wasn’t required. I was using VS2010 SP-1, and started with a copy of the xml from SQLServer Express 2008. Glad you figured out a way to make it work for you!

  18. Bill Says:

    Thanks for your helpful posting. Is there a way to install it along with my other regular installation created using VS2010 install wizard? I have to create installation in such a way that sql server only get install on server machine, so I would like to give user option to choose if they want to install sql server or not. Any advise would be helpful.


  19. Paul T. Says:

    Thanks for posting this. Yes, even in June 2011 we’re still using it!

  20. Terry Rogers Says:

    Hi… Thanks for your efforts

    Just thought you might be interested in my experience with a Setup & Deployment (not ClickOnce)package in VS2008 SP1

    Followed you instructions twice an re-created/copied all directories/files twice

    Trial VB deployment with trivial form (2 warnings in setup package :
    Warning 1 Xml validation did not pass for item ‘SQL Server 2008 R2 Express’ located at ‘…\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\SQLExpress2008R2\product.xml’.

    Warning 2 Xml Validation error in file ‘…\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\SQLExpress2008R2\product.xml’: The element ‘RelatedProducts’ in namespace ‘’ has invalid child element ‘EitherProducts’ in namespace ‘’. List of possible elements expected: ‘

    Builds OK, but install of this package (which does include directory SQLExpress2008R2 and files) simply proceeds with the base install; ignoring the configured pre-req..
    i.e. it does not install anything for SQL server in a clean VM box, just goes straight to the base trivial form install.

    Checked my pre-reqs and rebuilt a few times…. no go.
    Interestingly, as I said, the build for the setup does create directory SQLExpress2008R2 and files.

    I know you said you had only tried this with ClickOnce, but was wondering if you think I have missed something really simple.

    Thanks in advance

    • robindotnet Says:

      Hi, This bootstrapper package worked perfectly for me as a prerequisite. I would recommend you be sure you are following the directions exactly, including starting from the folder for SQLServer Express 2008, and not a prior version. Are you doing that? Also, what did you edit the XML with — did you use Visual Studio or (better yet) Notepad? From the error messages above, it sounds like your XML is messed up.

      • András Nagy Says:

        Hi Robin!
        I have the same problem like Terry sad.
        The installation started, when I moved the InstallChecks/ExternalCheck element from package.xml to product.xml and replaced the Property property from “SQLExpressChk” to “SQLExpressInstalled” like in the 2008 product.xml file.
        But my hacking wasn’t successful because of error -2068643838.
        Did you try your bootstrapper package on Setup and Deplyoment project too or only on ClickOnce?
        Do I have to add SQL Server 2008 Express and 2008 R2 Express to prerequisities too?
        As far as I can think, R2 is enough.

  21. paulains Says:

    Thanks for the post. Any idea how to use the /ConfigurationFile=ConfigurationFile.ini argument and supply the file ConfigurationFile.ini? From my tests, the Sql Server self-extracting EXE creates a temporary directory to extract its contents, and from there it runs the arguments, so it doesn’t see the ConfigurationFile.ini file even if it was included in the bootstrapper package. Perhaps there’s a way to use an alias for the path where the setup is initially run, and supply that in package.xml as in ‘Arguments=’$SetupPath\Configuration.ini’.

  22. Ayrin Says:

    I have a problem… I tried your instructions, but I can’t get the installation to work. When I click on setup.exe, the installation starts, and the computer downloads the required file. the problem is just that when the download has finished, I get an error message that “Setup has detected that the file has changed since it was initially published. Click OK to retry…”

    Pasting the last rows from install.log:
    (2011-11-01 04:18:43) Downloading ‘SqlExpress2008R2\SQLEXPR32_x86_ENU.EXE’ from ‘’ to ‘C:\DOCUME~1\Michel\LOCALS~1\Temp\VSD79F.tmp\’
    Download completed at 2011-11-01 04:18:44
    Verifying file integrity of C:\DOCUME~1\Michel\LOCALS~1\Temp\VSD79F.tmp\SqlExpress2008R2\SQLEXPR32_x86_ENU.EXE
    WinVerifyTrust returned -2146762496
    File not signed
    Error: Setup has detected that the file ‘C:\DOCUME~1\Michel\LOCALS~1\Temp\VSD79F.tmp\SqlExpress2008R2\SQLEXPR32_x86_ENU.EXE’ has changed since it was initially published.

    Thanks in advance!

  23. Steven Reed Says:


    This worked great! However, as soon as my app started it failed due to SQL Express not having Full-Text search capabilities and I realized I needed Sql Express Advanced Services.

    I figured I would just modify your code to do so, but have a problem with the address of the file to download. I modified the SqlExpr32Exe variable as follows but it does not work, giving a 404 error.

    Any idea what this should be? Do you suppose your helpful contacts at Microsoft can provide the info?

    Of course at this point in time I would prefer to install SP1, but really just want to get something working! I’m going to try changing the address to my own website to see if I can get that working.

    I appreciate any input you can provide!


  24. fedos Says:

    Thanks a lot for your information, it helped me a lot.
    Actually it is working quite well for me, I just have a problem.
    Each time I execute the setup it trys to install again SQL Server express.
    I didn’t remove SqlExpressChk.exe.

    Thanks in advance for your help.

    • fedos Says:

      I think I understood why it doesn’t work, I changed the instance name to MSSQLSERVER.
      Is there a possibility to tell SqlExpressChk that the instance to check is MSSQLSERVER and not SQLEXPRESS ?

      • robindotnet Says:

        I find that it’s quite dangerous to change the instance name of SQLExpress. There are just too many cases where Microsoft is looking for it by the SQLExpress name. I don’t know how to get SqlExpressChk to check for a different named instance, sorry.

  25. Marcel Says:

    Got some problems with the Bootstrapper.

    First Installation works fine. No problems. But, when I try install my setup (with the SQL Express 2008R2 as a prequisite) a second time, it try to Install the SQL Server again! Is it a problem with the SQLExpressChk.exe? Any suggestions?

    Setup developed with VS2010. Installing on a WinXP.

    Did some changes to the command-line arguments in package.xml

    What does the Setup do, if it recognizes, that the version is allready installed? Trying the Update part?

    Thanks, in advance.

    • Marcel Says:


      Arguments=’/q /hideconsole /action=Install /SECURITYMODE=SQL /features=SQL,Tools /SAPWD=”SqlServer2008″ /instancename=SQLEXPRESSR2 /enableranu=1 /BROWSERSVCSTARTUPTYPE=”Automatic” /AGTSVCSTARTUPTYPE=”Automatic” /AGTSVCACCOUNT=”.\SQLUser” /AGTSVCPASSWORD=”xxxx” /sqlsvcaccount=”.\SQLUser” /SQLSVCPASSWORD=”xxxx” /skiprules=RebootRequiredCheck /IAcceptSQLServerLicenseTerms’

    • robindotnet Says:

      My experience with the package I created was that it only installed it the first time, and on subsequent calls would recognize that it was already installed. You are using VS2010 — do you have SP-1 installed? If installing on XP, is SP-3 installed for that? Why did you change the command-line arguments in the package xml?

  26. codingmonk Says:

    Robin! This worked great for me. Thanks so much!

  27. mahmoudkoura Says:

    Hello Robin,

    Thank you very much for this i was trying to do this for alot of time now .. i did all your steps and deployed great but when installing the application it doesn`t load the SQL express installation as if it is installed where it is not installed… is there a problem with the sqlexpresschk.exe??


    • robindotnet Says:

      Just to clarify, you’re saying it’s not installing SQLExpress, and it’s not already installed? Did you check the processes on the computer and make sure it’s not installed and running? Does the user have administrative privileges (required to install SQL Express) ?

  28. Nalan Says:

    Hi Robin,
    Thanks, Its working fine. But Management studio is not getting installed. Any way to enable management tools along with this boots rapper package?

    • robindotnet Says:

      I don’t have info about that. You could try setting the link in the XML to point to that install package instead of the one I have provided to just SQLExpress, but I don’t know if it will work. Only one way to find out…

  29. SUSZI Says:

    I’ve created working SQL2008R2 bootstrapper (with tools). You can read simple instruction at


  30. m dev Says:

    Hello Robin,
    Thanks, you have done a great job. If possible can you kindly add the command line arguments you use in package.xml for dummies like me.

    • robindotnet Says:

      The package.xml in the download is exactly the package.xml I used, with everything included. So if there are command line arguments in there, those are the ones that worked for me.

  31. JSon Says:

    Hello Robin,
    Thank you for coming up with this useful blog!
    I created the “sql server 2008 express r2 with tools” bootstrap and clickonce installs my instance correctly on a clean environment(without sql 2008 r2) installed.
    However, if I install my app on a machine which has a sql instance already(“MSSqlExpress”), sqlexpresschk.exe returns value “-2” and the pre-req check did not pass. Do you know what does the returned value “-2” means and what should I do to fix the pre-req failing issue?

  32. Evil-I Productions Says:

    Forgive my newb-ishness, but I’m having trouble understanding how your project is different from
    where the installation is an embedded piece of a larger app. (and through config files, controllable/customizable). Is the difference that you used Click Once to make a stand-alone or combinable deployment tool, rather than embedding SQL in the applications Installer? What is the advantage/trade off of using your technique? Thanks for your time.

    • robindotnet Says:

      The point of the bootstrapper package is to be able to use it automatically with ClckOnce deployment or a Setup & Deployment package. If you are just doing a scripted SQLServer installation, you wouldn’t use a bootstrapper package.

  33. Chris Thunell Says:

    I love this post… very helpful!
    I did receive an error on my click once setup.exe package that maybe someone has some insight on? The sql express install started but then stopped due to error (Windows xp sp3):
    ….. File trusted
    Installing using command ‘C:\DOCUME~1\ADMINI~1.LAS\LOCALS~1\Temp\VSDC.tmp\SqlExpress2008R2\SQLEXPR32_x86_ENU.EXE’ and parameters ‘/q /hideconsole /action=Install /features=SQL /instancename=SQLEXPRESS /enableranu=1 /sqlsvcaccount=”NT Authority\Network Service” /AddCurrentUserAsSqlAdmin /skiprules=RebootRequiredCheck /IAcceptSQLServerLicenseTerms’
    Process exited with code -2067529712
    Status of package ‘SQL Server 2008 R2 Express’ after install is ‘InstallFailed’

    • robindotnet Says:

      Sorry, this isn’t a ClickOnce issue, it’s a SQLServer setup issue. I would try installing it separately and see if it will even install. If not, then there’s an MSDN forum for SQL Express here. They are more capable of helping you with this issue than I am!

  34. Creating a SQL Server Express 2008 R2 SP2 bootstrapper | This is what I did… Says:

    […] I searched the web and the link below got me started on what I needed to do:… […]

  35. eliz Says:

    Thank you so much! This is so great!

  36. Freddie Frydkjaer Says:

    A note to this brilliant article:

    If the windows username and name of the Pc is the same, the installation of SQL Express 2008 R2 will fail!

    Was having this problem at a customer, it was not easy to figure out 😦
    Once the machine name was changed, it worked like a charm!


  37. John Debono Says:

    Hi, Can this be applied to Visual Studio 2008?

    • robindotnet Says:

      In what sense? Do you mean can you create a bootstrapper package for SQLServer Express 2008 R2? If that’s what you’re asking, then yes, it should. If you mean can you create a bootstrapper package for Visual Studio 2008, not so much. 😉

    • SUMIT Says:

      Yes, I have used it on Visual Studio 2008

  38. SUMIT Says:

    Thank You, This article is really helpfull

  39. Wouter Dingemanse (@WouterWodka) Says:

    I came here after a fairly extensive search of the internet for the redistributable components for sql 2012. There is no bootstrapper for that as well..

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: