none
SQL Server 2016 Express LocalDB Bootstrapper Package Download Fails

    Question

  • I was not able to find a SQL Server 2016 Express LocalDB prerequisite bootstrapper package for my setup program so I created my own. It worked great for awhile, but then the download would occasionally fail for some reason. Now it always fails. The download address I'm using in my package is https://download.microsoft.com/download/E/1/2/E12B3655-D817-49BA-B934-CEB9DAC0BAF3/SqlLocalDB.msi. If this URL is entered directly into the browser address, the download will fail just as it does with the bootstrapper package - even though it used to work fine. Does any have a new LocalDB 2016 download URL?

    pmBrewer


    • Edited by PaulBrewer Friday, January 13, 2017 6:18 PM
    Friday, January 13, 2017 3:12 PM

Answers

  • Klhnikov - Yes, you can include the sqlLocalDB.msi with your installer package and then run a silent install as part of your setup. I use the Visual Studio Setup & Deployment project add-in. You can specify prerequisites by selecting the setup project properties. It will list all the bootstrapper packages that it finds in "C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages" (for VS 2015). A bootstrapper consists of two files: the product.xml file and a package.xml file in a subfolder for the locale of interest, e.g. \en\.

    Here's my product.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.SqlServer.SqlLocalDB.13.0">
      <RelatedProducts>
        <IncludesProduct Code="Microsoft.SqlServer.SqlLocalDB.13.0" />
      </RelatedProducts>
    
      <PackageFiles CopyAllPackageFiles="false">
       
        <PackageFile
          Name="sqllocaldb.msi"
          HomeSite="sqllocaldb"
          PublicKey="3082010a0282010100932edad8e63e98d91b0f645f4da8584d143bf77a84fc3c11313aef89c24a2d41a5485ddd129eefab662834d57d2a557b4c4d8af2c0f1b2d352158bb6b308b88b500bdd7ffb6a09a0dc6704c4f1dfbc75182040be782c9956ddeef52edd3e42f95a1f30ae01148ab082b551a0e26d65fef7180a8d306d4d3aa7c5f3362dee5f2ca09200b11c4ce2cbf7ff24257fd78fc0dd976eceb217b6c71c44a724ca7e81e6e631b916d95d3ed168eebecd48d0862caedc0e21c1c08ac3ee1b935913f6c63b8072188853fbabbf303ea077bd5288bf7ad8e8b093ada11b8cd47ea6105010bee1c81c64fa872efbc4476616c0847b36af5fba85446c020f2de0b00e1ba23e250203010001"
        />
      </PackageFiles>
    
      <InstallChecks>
        <!-- Check if already installed -->
        <FileCheck
          Property="sqllocaldbVersion"
          FileName="sqlservr.exe"
          SearchPath="Microsoft SQL Server\130\LocalDB\Binn"
          SpecialFolder="ProgramFilesFolder"
        />
        <!-- Check for x64 install from x86 installer -->
        <FileCheck
          Property="sqllocaldbVersion_x64"
          FileName="sqlservr.exe"
          SearchPath="Program Files\Microsoft SQL Server\130\LocalDB\Binn"
          SpecialFolder="WindowsVolume"
        />
      </InstallChecks>
    
      <Commands Reboot="Defer">
       <Command PackageFile="sqllocaldb.msi" Arguments="IACCEPTSQLLOCALDBLICENSETERMS=YES" EstimatedInstallSeconds="90">
          <InstallConditions>
            <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64" />
            <BypassIf Property="sqllocaldbVersion" Compare="VersionGreaterThanOrEqualTo" Value="13.0.2151.0" />
            <BypassIf Property="sqllocaldbVersion_x64" Compare="VersionGreaterThanOrEqualTo" Value="13.0.2151.0" />
          </InstallConditions>
          <ExitCodes>
            <ExitCode Value="0" Result="Success" />
            <ExitCode Value="1641" Result="SuccessReboot" />
            <ExitCode Value="3010" Result="SuccessReboot" />
            <DefaultExitCode Result="Fail" String="GeneralFailure" FormatMessageFromSystem="true" />
          </ExitCodes>
        </Command>
      </Commands>
    </Product>

    Here's the corresponding package.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <Package Name="DisplayName" LicenseAgreement="Eula.rtf" Culture="Culture" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
      <PackageFiles>
        <PackageFile Name="Eula.rtf" />
      </PackageFiles>
      <Strings>
        <String Name="Culture">en</String>
        <String Name="DisplayName">SQL Server 2016 Express LocalDB</String>
        <String Name="sqllocaldb_32">http://download.microsoft.com/download/1/5/6/156992E6-F7C7-4E55-833D-249BD2348138/ENU/x86/SqlLocalDB.msi</String>
        <String Name="sqllocaldb">https://download.microsoft.com/download/E/1/2/E12B3655-D817-49BA-B934-CEB9DAC0BAF3/SqlLocalDB.msi</String>
        <String Name="AdminRequired">You do not have the permissions required to install SQL Server 2016 Express LocalDB. Please contact your administrator.</String>
        <String Name="GeneralFailure">An error occurred attempting to install SQL Server 2016 Express LocalDB.</String>
        <String Name="InvalidPlatformOS">The current operating system version does not support SQL Server 2016 Express LocalDB.</String>
        <String Name="InvalidPlatformOSServicePack">The current operating system does not meet Service Pack level requirements for SQL Server 2016 Express LocalDB. Install the most recent Service Pack from the Windows Service Pack and Update Center at http://windows.microsoft.com/en-us/windows/service-packs-download before continuing setup.</String>
      </Strings>
    </Package>
    Of course, this won't work until someone fixes the link or provides another. Whoever is responsible for this must be pretty busy; seems like it would not be hard to fix.


    pmBrewer

    EDIT (8/23/17) - The real problem is that you can only install LocalDB by running the SQL Server Express install and then at some point select LocalDB. That does not work very well for deployment of apps that need to auto-install LocalDB, so I had to put the SqlLocalDB.msi installer on my own website and modify the package.xml file to point to that location.


    • Proposed as answer by Igormacielf Monday, August 21, 2017 6:47 PM
    • Marked as answer by PaulBrewer Wednesday, August 23, 2017 12:11 PM
    • Edited by PaulBrewer Wednesday, August 23, 2017 12:24 PM Completeness
    Wednesday, February 01, 2017 11:45 PM
  • Hello Paul,

    Yes, seems the link is broken, also the download link at https://msdn.microsoft.com/en-us/library/hh510202.aspx

    You can report such issues at https://connect.microsoft.com/SQLServer


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Marked as answer by PaulBrewer Sunday, January 15, 2017 2:47 PM
    Sunday, January 15, 2017 12:44 PM

All replies

  • So I guest the answer is that no one knows where to get the SQL Server 2016 Express LocalDB redistributable - sqllocaldb.msi. Heck, maybe it doesn't even exist anymore. I thought the whole point was that it was a freely distributable lightweight database.

    pmBrewer

    Sunday, January 15, 2017 2:49 AM
  • Hello Paul,

    Yes, seems the link is broken, also the download link at https://msdn.microsoft.com/en-us/library/hh510202.aspx

    You can report such issues at https://connect.microsoft.com/SQLServer


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Marked as answer by PaulBrewer Sunday, January 15, 2017 2:47 PM
    Sunday, January 15, 2017 12:44 PM
  • Thanks, Olaf. I'll report it on Connect.


    pmBrewer

    EDIT: Problem is now posted on SQL Server Connect at https://connect.microsoft.com/SQLServer/feedback/details/3118806.

    • Edited by PaulBrewer Sunday, January 15, 2017 3:58 PM
    Sunday, January 15, 2017 2:48 PM
  • Thanks, I have a similar problem ...

    You said you built a Bootstrapper for sqlLocalDB.msi 2016 ? Can I ask you to share it ?

    Since I have the file SqlLocalDB.msi 2016, isn't it possible to embed it with the Solution/Setup instead of download it from source ?

    Wednesday, February 01, 2017 5:46 PM
  • Klhnikov - Yes, you can include the sqlLocalDB.msi with your installer package and then run a silent install as part of your setup. I use the Visual Studio Setup & Deployment project add-in. You can specify prerequisites by selecting the setup project properties. It will list all the bootstrapper packages that it finds in "C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages" (for VS 2015). A bootstrapper consists of two files: the product.xml file and a package.xml file in a subfolder for the locale of interest, e.g. \en\.

    Here's my product.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.SqlServer.SqlLocalDB.13.0">
      <RelatedProducts>
        <IncludesProduct Code="Microsoft.SqlServer.SqlLocalDB.13.0" />
      </RelatedProducts>
    
      <PackageFiles CopyAllPackageFiles="false">
       
        <PackageFile
          Name="sqllocaldb.msi"
          HomeSite="sqllocaldb"
          PublicKey="3082010a0282010100932edad8e63e98d91b0f645f4da8584d143bf77a84fc3c11313aef89c24a2d41a5485ddd129eefab662834d57d2a557b4c4d8af2c0f1b2d352158bb6b308b88b500bdd7ffb6a09a0dc6704c4f1dfbc75182040be782c9956ddeef52edd3e42f95a1f30ae01148ab082b551a0e26d65fef7180a8d306d4d3aa7c5f3362dee5f2ca09200b11c4ce2cbf7ff24257fd78fc0dd976eceb217b6c71c44a724ca7e81e6e631b916d95d3ed168eebecd48d0862caedc0e21c1c08ac3ee1b935913f6c63b8072188853fbabbf303ea077bd5288bf7ad8e8b093ada11b8cd47ea6105010bee1c81c64fa872efbc4476616c0847b36af5fba85446c020f2de0b00e1ba23e250203010001"
        />
      </PackageFiles>
    
      <InstallChecks>
        <!-- Check if already installed -->
        <FileCheck
          Property="sqllocaldbVersion"
          FileName="sqlservr.exe"
          SearchPath="Microsoft SQL Server\130\LocalDB\Binn"
          SpecialFolder="ProgramFilesFolder"
        />
        <!-- Check for x64 install from x86 installer -->
        <FileCheck
          Property="sqllocaldbVersion_x64"
          FileName="sqlservr.exe"
          SearchPath="Program Files\Microsoft SQL Server\130\LocalDB\Binn"
          SpecialFolder="WindowsVolume"
        />
      </InstallChecks>
    
      <Commands Reboot="Defer">
       <Command PackageFile="sqllocaldb.msi" Arguments="IACCEPTSQLLOCALDBLICENSETERMS=YES" EstimatedInstallSeconds="90">
          <InstallConditions>
            <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64" />
            <BypassIf Property="sqllocaldbVersion" Compare="VersionGreaterThanOrEqualTo" Value="13.0.2151.0" />
            <BypassIf Property="sqllocaldbVersion_x64" Compare="VersionGreaterThanOrEqualTo" Value="13.0.2151.0" />
          </InstallConditions>
          <ExitCodes>
            <ExitCode Value="0" Result="Success" />
            <ExitCode Value="1641" Result="SuccessReboot" />
            <ExitCode Value="3010" Result="SuccessReboot" />
            <DefaultExitCode Result="Fail" String="GeneralFailure" FormatMessageFromSystem="true" />
          </ExitCodes>
        </Command>
      </Commands>
    </Product>

    Here's the corresponding package.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <Package Name="DisplayName" LicenseAgreement="Eula.rtf" Culture="Culture" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
      <PackageFiles>
        <PackageFile Name="Eula.rtf" />
      </PackageFiles>
      <Strings>
        <String Name="Culture">en</String>
        <String Name="DisplayName">SQL Server 2016 Express LocalDB</String>
        <String Name="sqllocaldb_32">http://download.microsoft.com/download/1/5/6/156992E6-F7C7-4E55-833D-249BD2348138/ENU/x86/SqlLocalDB.msi</String>
        <String Name="sqllocaldb">https://download.microsoft.com/download/E/1/2/E12B3655-D817-49BA-B934-CEB9DAC0BAF3/SqlLocalDB.msi</String>
        <String Name="AdminRequired">You do not have the permissions required to install SQL Server 2016 Express LocalDB. Please contact your administrator.</String>
        <String Name="GeneralFailure">An error occurred attempting to install SQL Server 2016 Express LocalDB.</String>
        <String Name="InvalidPlatformOS">The current operating system version does not support SQL Server 2016 Express LocalDB.</String>
        <String Name="InvalidPlatformOSServicePack">The current operating system does not meet Service Pack level requirements for SQL Server 2016 Express LocalDB. Install the most recent Service Pack from the Windows Service Pack and Update Center at http://windows.microsoft.com/en-us/windows/service-packs-download before continuing setup.</String>
      </Strings>
    </Package>
    Of course, this won't work until someone fixes the link or provides another. Whoever is responsible for this must be pretty busy; seems like it would not be hard to fix.


    pmBrewer

    EDIT (8/23/17) - The real problem is that you can only install LocalDB by running the SQL Server Express install and then at some point select LocalDB. That does not work very well for deployment of apps that need to auto-install LocalDB, so I had to put the SqlLocalDB.msi installer on my own website and modify the package.xml file to point to that location.


    • Proposed as answer by Igormacielf Monday, August 21, 2017 6:47 PM
    • Marked as answer by PaulBrewer Wednesday, August 23, 2017 12:11 PM
    • Edited by PaulBrewer Wednesday, August 23, 2017 12:24 PM Completeness
    Wednesday, February 01, 2017 11:45 PM
  • Good morning Paul and a BIG HUGE thank you !!

    EDIT : I think you pasted the same content in both files ... maybe a mistake ? not a big issue, I figured it out by myself...

    I assume you are the first who made the sqllocalDB 2016 bootstrapper ever ... I searched in Google all night unsuccessfully, only a man did the 2014 ... where did you found the usefull stuff (public key and broken link ) ?

    I made a WPF that uses a Local DB .mdf and tried to deploy it with the Visual Studio Setup & Deployment project add-in too ... So I misses the right bootstrapper... What a shame they stopped in 2012 ...

    Seeing your post was a big releaf, and, in the same time, it looks that Microsoft dont want us to deploy ours apps ...

    So I decided to build my own ConsoleApplication Installer instead of windows installer... It works but looks pretty prehistoric ... Can be a temporary fix for you too !

    EDIT2 : I've fixed all of my issues by hosting myself (on my website) the x32msi file, replaced the right path in the string and go for it ! It work fine, and will forever !, not dependent from MS...

    Couldnt have fixed it without your help... so read next line two times !

    Thank you !




    • Edited by Klhnikov Friday, February 03, 2017 6:07 PM
    Thursday, February 02, 2017 10:12 AM
  • Whoops. I inadvertently pasted the product.xml code twice. I've edited my response above to show the package.xml file. Thanks for noticing, Klhnikov.

    pmBrewer

    Tuesday, February 07, 2017 2:55 PM
  • Great answer, almost the only one in whole internet O_o

    I've used your post to update my github page for anyone also needing to provide auto installation for localDB 2016: https://github.com/igormf/SqlLocalDB2016-Bootstrapper

    Monday, August 21, 2017 6:49 PM
  • Hello, where can I get the PublicKey/ProductCode values for 2016 SP1?

    Thursday, September 14, 2017 4:56 AM
  • Hello Paul,

    My thanks for your solution. I wasted 1.5 days trying to find a solution. Only just upgraded to VS2017 from 2012 and had to replace my CE solution with 2016 LocalDB. I am without words how MS can sell me a product that uses a technology that I then cannot publish using ClickOnce.

    And yes, I also serve the sqllocaldb.msi now over our own servers instead of trying to use a dead MS link.

    Again my thanks!

    Marc

    Thursday, September 14, 2017 1:00 PM
  • luecano - you can find the PublicKey from the using File Explorer and looking at the file properties of the SqlLocalDB.msi. Select Digital Signatures->select sha256 entry under Digest algorithm and click Details->General tab->View Certificate->Details tab->scroll down and select Public Key and copy from the value window. I think MS uses the same one for other products. It is "3082010a0282010100932edad8e63e98d91b0f645f4da8584d143bf77a84fc3c11313aef89c24a2d41a5485ddd129eefab662834d57d2a557b4c4d8af2c0f1b2d352158bb6b308b88b500bdd7ffb6a09a0dc6704c4f1dfbc75182040be782c9956ddeef52edd3e42f95a1f30ae01148ab082b551a0e26d65fef7180a8d306d4d3aa7c5f3362dee5f2ca09200b11c4ce2cbf7ff24257fd78fc0dd976eceb217b6c71c44a724ca7e81e6e631b916d95d3ed168eebecd48d0862caedc0e21c1c08ac3ee1b935913f6c63b8072188853fbabbf303ea077bd5288bf7ad8e8b093ada11b8cd47ea6105010bee1c81c64fa872efbc4476616c0847b36af5fba85446c020f2de0b00e1ba23e250203010001"

    As far as locating the Product Code, you would have to search the registry on a machine where it is installed. At least that's the only way I know to find it. It's a GUID and will look something like {4EC2BEB1-0333-4384-B824-5755B837A49E}


    pmBrewer


    • Edited by PaulBrewer Thursday, September 14, 2017 7:31 PM clarification
    Thursday, September 14, 2017 7:29 PM