﻿<?xml version="1.0" encoding="utf-8"?>
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.SqlServer.SqlLocalDB.11.1">
  <RelatedProducts>
    <!-- Depends on MSI4.5 or greater, which is included on all of the OS levels supported -->
     <IncludesProduct Code="Microsoft.SqlServer.SqlLocalDB.11.0" />
  </RelatedProducts>

  <InstallChecks>
    <FileCheck
      Property="sqllocaldbVersion"
      FileName="sqlservr.exe"
      SearchPath="Program Files\Microsoft SQL Server\110\LocalDB\Binn"
      SpecialFolder="WindowsVolume"
    />
  </InstallChecks>

  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile
      Name="x86\sqllocaldb.msi"
      HomeSite="sqllocaldb_32"
      PublicKey="0"
     />
    <PackageFile
      Name="x64\sqllocaldb.msi"
      HomeSite="sqllocaldb_64"
      PublicKey="0"
     />
  </PackageFiles>

  <Commands Reboot="Defer">
    <Command PackageFile="x86\sqllocaldb.msi" Arguments="IACCEPTSQLLOCALDBLICENSETERMS=YES" EstimatedInstallSeconds="90">
      <InstallConditions>
        <FailIf Property="VersionNT" Compare="ValueNotExists" String="InvalidPlatformOS"/>
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="6.0.0" String="InvalidPlatformOS"/>
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="6.0.2" String="InvalidPlatformOSServicePack"/>
        <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="6.1.0" String="InvalidPlatformOSServicePack"/>
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel"/>
        <BypassIf Property="sqllocaldbVersion" Compare="VersionGreaterThanOrEqualTo" Value="2011.110.3000.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>
    <Command PackageFile="x64\sqllocaldb.msi" Arguments="IACCEPTSQLLOCALDBLICENSETERMS=YES" EstimatedInstallSeconds="90">
      <InstallConditions>
        <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64"/>
        <BypassIf Property="sqllocaldbVersion" Compare="VersionGreaterThanOrEqualTo" Value="2011.110.3000.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>

