Thursday, August 27, 2009

VS.NET 2008 Bootstrapper for SQL Server 2008 Express Edition with Tools

I looked all over for this, and ended up just making my own custom prerequisite. There's an ugly hack to add a prerequisite for SQL Server 2008 Express, but I needed to have the edition that installs the tools as well. For whatever reason, adding the tools at a later date is not really a feasible approach with the installers that Microsoft has available.

However, the installer that includes tools also has Powershell as a prerequisite, so I was forced to make that one as well as my google mojo couldn't locate any.

To create the Powershell prerequisite:
  1. Create a new folder named 'Powershell1_0' under C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages
  2. In that new folder, create a file named 'product.xml'

    EDIT 2009-11-06: XML is case-sensitive, and the previous xml for product.xml had everything in lowercase. Please retry with proper casing as shown below.
    Save the following as the contents of that file:

    <!-- Windows Powershell 1.0 VS Bootstrapper : product.xml : Language neutral information -->
    <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.Windows.PowerShell.1.0">

    </Product>
  3. Create a new subfolder named 'en' under the 'Powershell1_0' folder
  4. In the 'en' folder, create a file named 'package.xml'
    Save the following as the contents of that file:

    <?xml version="1.0" encoding="utf-8" ?>

    <Package
    xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
    Name="DisplayName"
    Culture="Culture"
    LicenseAgreement="eula.rtf"
    >

    <!-- Defines list of files to be copied on build -->
    <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="eula.rtf"/>
    <PackageFile Name="Windows6.0-KB928439-x86.msu" HomeSite="ps10vistax86"
    PublicKey="3082010A0282010100D8DC95E9D1BA58324004219BF57E8C7581752EA5DD411D6AAD3D5E0DA7CEF775EBA20C1921B28669D291B3AE251B8060CA0B163CF8FEDF7A896A77D0F62BD8377AA7D3112E2DD7BE1895757B4239C28C27C258A031410EAEB94B44502450699167A9A1D56A5AA17E865B35C92A0314E16028515F45850075CC64D7ABB27C95A67A9E0C0A1353ADB2AF9ADBD231C572A1E5598A5F6BAA0C9FEF323755C9E92663F4B6B9C52B0633DCE4050D7AD7AF55627DDB446B18424254E6F50AD5A84F41D8831835992DC9A1934E22D62C4D28BB87852176C6347DA8C9088B43BA61E9D79DDB1AD4DE44E740F18C1F7FD570B721ED775E376CBBCD512F2E4DBB9317DD56310203010001"/>
    <PackageFile Name="Windows6.0-KB928439-x64.msu" HomeSite="ps10vistax64"
    PublicKey="3082010A0282010100D8DC95E9D1BA58324004219BF57E8C7581752EA5DD411D6AAD3D5E0DA7CEF775EBA20C1921B28669D291B3AE251B8060CA0B163CF8FEDF7A896A77D0F62BD8377AA7D3112E2DD7BE1895757B4239C28C27C258A031410EAEB94B44502450699167A9A1D56A5AA17E865B35C92A0314E16028515F45850075CC64D7ABB27C95A67A9E0C0A1353ADB2AF9ADBD231C572A1E5598A5F6BAA0C9FEF323755C9E92663F4B6B9C52B0633DCE4050D7AD7AF55627DDB446B18424254E6F50AD5A84F41D8831835992DC9A1934E22D62C4D28BB87852176C6347DA8C9088B43BA61E9D79DDB1AD4DE44E740F18C1F7FD570B721ED775E376CBBCD512F2E4DBB9317DD56310203010001"/>
    <PackageFile Name="WindowsXP-KB926139-v2-x86-ENU.exe" HomeSite="ps10xpx86"
    PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="WindowsServer2003.WindowsXP-KB926139-v2-x64-ENU.exe" HomeSite="ps10xpOrWin2003x64"
    PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="WindowsServer2003-KB926139-v2-x86-ENU.exe" HomeSite="ps10win2003x86"
    PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    </PackageFiles>

    <InstallChecks>
    <RegistryCheck Property="PowershellInstalled" Key="HKLM\Software\Microsoft\PowerShell\1" Value="Install" />
    </InstallChecks>


    <!-- Defines how to invoke the setup for the Windows Powershell 1.0 redist -->
    <Commands Reboot="Immediate">
    <!-- Defines installation command for:
    Vista RTM and later
    Windows Server 2008 RTM and later
    on x86 platform -->
    <Command PackageFile="Windows6.0-KB928439-x86.msu"
    Arguments= "/quiet /norestart"
    EstimatedInstalledBytes="1768448"
    EstimatedInstallSeconds="450" >
    <InstallConditions>
    <BypassIf Property="PowershellInstalled" Compare="ValueEqualTo" Value="1" />
    <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
    <BypassIf Property="VersionNT" Compare="VersionLessThan" Value="6.0" />
    <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
    <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
    </InstallConditions>
    <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
    <ExitCode Value="1641" Result="SuccessReboot"/>
    <ExitCode Value="3010" Result="SuccessReboot"/>
    <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
    </ExitCodes>
    </Command>

    <!-- Defines installation command for:
    Vista RTM and later
    Windows Server 2008 RTM and later
    on x64 platform -->
    <Command PackageFile="Windows6.0-KB928439-x64.msu"
    Arguments= "/quiet /norestart"
    EstimatedInstalledBytes="3087360"
    EstimatedInstallSeconds="450" >
    <InstallConditions>
    <BypassIf Property="PowershellInstalled" Compare="ValueEqualTo" Value="1" />
    <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64" />
    <BypassIf Property="VersionNT" Compare="VersionLessThan" Value="6.0" />
    <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
    <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
    </InstallConditions>
    <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
    <ExitCode Value="1641" Result="SuccessReboot"/>
    <ExitCode Value="3010" Result="SuccessReboot"/>
    <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
    </ExitCodes>
    </Command>


    <!-- Defines installation command for:
    Windows XP Service Pack 2 and later
    on x86 platform -->
    <Command PackageFile="WindowsXP-KB926139-v2-x86-ENU.exe"
    Arguments= "/quiet /norestart"
    EstimatedInstalledBytes="3326976"
    EstimatedInstallSeconds="450" >
    <InstallConditions>
    <BypassIf Property="PowershellInstalled" Compare="ValueEqualTo" Value="1" />
    <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
    <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="5.2.0" />
    <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
    <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatform"/>
    <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
    </InstallConditions>
    <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
    <ExitCode Value="1641" Result="SuccessReboot"/>
    <ExitCode Value="3010" Result="SuccessReboot"/>
    <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
    </ExitCodes>
    </Command>

    <!-- Defines installation command for:
    Windows XP Service Pack 2 and later
    Windows 2003 Service Pack 1 or later
    on x64 platform -->
    <Command PackageFile="WindowsServer2003.WindowsXP-KB926139-v2-x64-ENU.exe"
    Arguments= "/quiet /norestart"
    EstimatedInstalledBytes="4684800"
    EstimatedInstallSeconds="450" >
    <InstallConditions>
    <BypassIf Property="PowershellInstalled" Compare="ValueEqualTo" Value="1" />
    <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64" />
    <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.0"/>
    <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
    <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatform"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform"/>
    <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
    </InstallConditions>
    <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
    <ExitCode Value="1641" Result="SuccessReboot"/>
    <ExitCode Value="3010" Result="SuccessReboot"/>
    <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
    </ExitCodes>
    </Command>


    <!-- Defines installation command for:
    Windows 2003 Service Pack 1 or later
    on x86 platform -->
    <Command PackageFile="WindowsServer2003-KB926139-v2-x86-ENU.exe"
    Arguments= "/quiet /norestart"
    EstimatedInstalledBytes="3053568"
    EstimatedInstallSeconds="450" >
    <InstallConditions>
    <BypassIf Property="PowershellInstalled" Compare="ValueEqualTo" Value="1" />
    <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
    <BypassIf Property="VersionNT" Compare="VersionLessThan" Value="5.2.0"/>
    <BypassIf Property="VersionNT" Compare="VersionGreaterThanOrEqualTo" Value="6.0"/>
    <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatform"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform"/>
    <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
    </InstallConditions>
    <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
    <ExitCode Value="1641" Result="SuccessReboot"/>
    <ExitCode Value="3010" Result="SuccessReboot"/>
    <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
    </ExitCodes>
    </Command>


    </Commands>

    <Strings>

    <!-- Defines Homesite locations for each of the downloads -->
    <String Name="ps10vistax86">http://www.microsoft.com/downloads/details.aspx?FamilyID=c6ef4735-c7de-46a2-997a-ea58fdfcba63&displaylang=en&Hash=gFDYCnt0XHCZE8T4bgUP7awC7LOaLKHDhc6ARfmoFIDvb6Us%2fK7gcmW1kiq8adEqcY8gMdLa2LP4rYgftn0YEw%3d%3d</String>
    <String Name="ps10vistax64">http://www.microsoft.com/downloads/details.aspx?FamilyID=af37d87d-5de6-4af1-80f4-740f625cd084&displaylang=en&Hash=%2fRXyTFQ415GcjD7vRY1AnTFnsiEo2IfhO4XF5eCQ1wTWTGU8W9W%2fVD8qIfYSHJWyZX3YZo%2bN0xGHL5f6MwHfAQ%3d%3d</String>
    <String Name="ps10xpx86">http://download.microsoft.com/download/7/3/4/7345bb7d-0b07-40e8-9480-5b8c55b9c8b7/WindowsXP-KB926139-v2-x86-ENU.exe</String>
    <String Name="ps10xpWin2003x64">http://www.microsoft.com/downloads/thankyou.aspx?familyId=e9a90e13-c67c-42d7-b391-0e67dd67b83f&displayLang=en</String>
    <String Name="ps10win2003x86">http://download.microsoft.com/download/d/e/7/de7cb629-73a3-49cc-b796-50dfaaf1b833/WindowsServer2003-KB926139-v2-x86-ENU.exe</String>

    <!-- Defines a localizable string table for error messages-->
    <String Name="DisplayName">Windows Powershell 1.0</String>
    <String Name="Culture">en</String>
    <String Name="AdminRequired">Administrator permissions are required to install Windows Powershell 1.0. Contact your administrator.</String>
    <String Name="InvalidPlatform">Installation of Windows Powershell 1.0 requires Windows XP Service Pack 2 or later. Contact your application vendor.</String>
    <String Name="GeneralFailure">A failure occurred attempting to install Windows Powershell 1.0.</String>
    </Strings>

    </Package>


  5. Get the proper eula.rtf (I'm just a developer, you figure it out!) and save it to the en folder. The installer just needs the file to exist there to work.
  6. Download the necessary msu and exe files and save them into the 'Powershell1_0\en' folder.

To create the SQL Server 2008 Express Edition with Tools prerequisite:

  1. Create a new folder named 'SQLServer2008ExpressWithTools' under C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages
  2. In that new folder, create a file named 'product.xml'
    Save the following as the contents of that file:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- SQL Express 2008 VS Bootstrapper : package.xml : Language neutral information -->
    <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.Sql.Server.ExpressWithTools.10.0">
    <RelatedProducts>
    <DependsOnProduct Code="Microsoft.Net.Framework.3.5.SP1" />
    <DependsOnProduct Code="Microsoft.Windows.Installer.4.5" />
    <DependsOnProduct Code="Microsoft.Windows.PowerShell.1.0" />
    <IncludesProduct Code="Microsoft.Sql.Server.Express.1.0" />
    <IncludesProduct Code="Microsoft.Sql.Server.Express.9.2" />
    </RelatedProducts>
    <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="SqlExpressChk.exe" />
    </PackageFiles>
    <InstallChecks>
    <ExternalCheck Property="SQLExpressInstalled" PackageFile="SqlExpressChk.exe" />
    </InstallChecks>
    </Product>

  3. Create a new subfolder named 'en' under the 'SQLServer2008ExpressWithTools' folder
  4. In the 'en' folder, create a file named 'package.xml'
    Save the following as the contents of that file:

    <?xml version="1.0" encoding="utf-8" ?>
    <Package
    xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
    Name="DisplayName"
    Culture="Culture"
    LicenseAgreement="eula.rtf">

    <PackageFiles CopyAllPackageFiles="false">
    <!--
    for 32-bit sql server w/ tools:
    md5 hash: CB1A8878ECC39B2F098AA1508CC94FC302C14516
    public key: 3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001
    -->


    <PackageFile Name="SQLEXPRWT_x86_ENU.EXE" HomeSite="SqlExpr32WTExe" PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="SQLEXPRWT_x64_ENU.EXE" HomeSite="SqlExpr64WTExe" PublicKey="3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001"/>
    <PackageFile Name="eula.rtf"/>
    </PackageFiles>

    <Commands Reboot="Defer">

    <!-- Defines a new installation (x86) -->
    <Command PackageFile="SQLEXPRWT_x86_ENU.EXE"
    Arguments='/q /hideconsole /action=Install /features=SQLEngine,SSMS /instancename=SQLEXPRESS /enableranu=1 /sqlsvcaccount="NT Authority\Network Service" /AddCurrentUserAsSqlAdmin /skiprules=RebootRequiredCheck'
    EstimatedInstalledBytes="225000000"
    EstimatedInstallSeconds="420">
    <InstallConditions>
    <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel"/>
    <BypassIf Property="SQLExpressInstalled" Compare="ValueNotEqualTo" Value="0"/>
    <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatformXP"/>
    <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatformXP"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform2K3"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.1" String="InvalidPlatform2K3"/>
    <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
    </InstallConditions>
    <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
    <ExitCode Value="1641" Result="SuccessReboot"/>
    <ExitCode Value="3010" Result="SuccessReboot"/>
    <!-- 0x84BE0BC2 (1214,3010) -->
    <ExitCode Value="-2067919934" Result="FailReboot"/>
    <!-- 0x84C10BC2 (1217,3010) -->
    <ExitCode Value="-2067723326" Result="FailReboot"/>
    <!-- 0x84BE0007 (1214,7) -->
    <ExitCode Value="-2067922937" Result="Fail" String="AdminRequired"/>
    <!-- 0x84C4001F (1220,31) -->
    <ExitCode Value="-2067529697" Result="Fail" String="AdminRequired"/>
    <!-- 0x84BE0001 (1214,1)-->
    <ExitCode Value="-2067922943" Result="Fail" String="InvalidPlatformOSServicePacks"/>
    <!-- 0x84C4000B (1220,11) -->
    <ExitCode Value="-2067529717" Result="Fail" String="AnotherInstanceRunning"/>
    <!-- 0x84BE01F8 (1214,504) -->
    <ExitCode Value="-2067922440" Result="Fail" String="BetaComponentsFailure"/>
    <!-- 0x84BE01FA (1214,506) -->
    <ExitCode Value="-2067922438" Result="Fail" String="BetaComponentsFailure"/>
    <!-- 0x84BE0202 (1214,514) -->
    <ExitCode Value="-2067922430" Result="Fail" String="InvalidPlatformArchitecture"/>
    <!-- 0x84BE0203 (1214,515) -->
    <ExitCode Value="-2067922429" Result="Fail" String="InvalidPlatformArchitecture"/>
    <ExitCode Value="216" Result="Fail" String="InvalidPlatformArchitecture"/>
    <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
    </ExitCodes>
    </Command>

    <!-- Defines an upgrade installation (x86) -->
    <Command PackageFile="SQLEXPRWT_x86_ENU.EXE"
    Arguments="/q /hideconsole /action=Upgrade /instancename=SQLEXPRESS /skiprules=RebootRequiredCheck"
    EstimatedInstalledBytes="225000000"
    EstimatedInstallSeconds="420">
    <InstallConditions>
    <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel"/>
    <BypassIf Property="SQLExpressInstalled" Compare="ValueEqualTo" Value="0"/>
    <FailIf Property="SQLExpressInstalled" Compare="ValueLessThan" Value="0" String="GeneralFailure"/>
    <BypassIf Property="SQLExpressInstalled" Compare="ValueGreaterThanOrEqualTo" Value="10001600"/>
    <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatformXP"/>
    <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatformXP"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform2K3"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.1" String="InvalidPlatform2K3"/>
    <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
    </InstallConditions>
    <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
    <ExitCode Value="1641" Result="SuccessReboot"/>
    <ExitCode Value="3010" Result="SuccessReboot"/>
    <!-- 0x84BE0BC2 (1214,3010) -->
    <ExitCode Value="-2067919934" Result="FailReboot"/>
    <!-- 0x84C10BC2 (1217,3010) -->
    <ExitCode Value="-2067723326" Result="FailReboot"/>
    <!-- 0x84BE0007 (1214,7) -->
    <ExitCode Value="-2067922937" Result="Fail" String="AdminRequired"/>
    <!-- 0x84C4001F (1220,31) -->
    <ExitCode Value="-2067529697" Result="Fail" String="AdminRequired"/>
    <!-- 0x84BE0001 (1214,1)-->
    <ExitCode Value="-2067922943" Result="Fail" String="InvalidPlatformOSServicePacks"/>
    <!-- 0x84C4000B (1220,11) -->
    <ExitCode Value="-2067529717" Result="Fail" String="AnotherInstanceRunning"/>
    <!-- 0x84BE01F8 (1214,504) -->
    <ExitCode Value="-2067922440" Result="Fail" String="BetaComponentsFailure"/>
    <!-- 0x84BE01FA (1214,506) -->
    <ExitCode Value="-2067922438" Result="Fail" String="BetaComponentsFailure"/>
    <!-- 0x84BE0202 (1214,514) -->
    <ExitCode Value="-2067922430" Result="Fail" String="InvalidPlatformArchitecture"/>
    <!-- 0x84BE0203 (1214,515) -->
    <ExitCode Value="-2067922429" Result="Fail" String="InvalidPlatformArchitecture"/>
    <ExitCode Value="216" Result="Fail" String="InvalidPlatformArchitecture"/>
    <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
    </ExitCodes>
    </Command>

    <!-- Defines a new installation (amd64) -->
    <Command PackageFile="SQLEXPRWT_x64_ENU.EXE"
    Arguments='/q /hideconsole /action=Install /features=SQLEngine,SSMS /instancename=SQLEXPRESS /enableranu=1 /sqlsvcaccount="NT Authority\Network Service" /AddCurrentUserAsSqlAdmin /skiprules=RebootRequiredCheck'
    EstimatedInstalledBytes="225000000"
    EstimatedInstallSeconds="420">
    <InstallConditions>
    <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64"/>
    <BypassIf Property="SQLExpressInstalled" Compare="ValueNotEqualTo" Value="0"/>
    <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatformXP"/>
    <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatformXP"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform2K3"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.1" String="InvalidPlatform2K3"/>
    <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
    </InstallConditions>
    <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
    <ExitCode Value="1641" Result="SuccessReboot"/>
    <ExitCode Value="3010" Result="SuccessReboot"/>
    <!-- 0x84BE0BC2 (1214,3010) -->
    <ExitCode Value="-2067919934" Result="FailReboot"/>
    <!-- 0x84C10BC2 (1217,3010) -->
    <ExitCode Value="-2067723326" Result="FailReboot"/>
    <!-- 0x84BE0007 (1214,7) -->
    <ExitCode Value="-2067922937" Result="Fail" String="AdminRequired"/>
    <!-- 0x84C4001F (1220,31) -->
    <ExitCode Value="-2067529697" Result="Fail" String="AdminRequired"/>
    <!-- 0x84BE0001 (1214,1)-->
    <ExitCode Value="-2067922943" Result="Fail" String="InvalidPlatformOSServicePacks"/>
    <!-- 0x84C4000B (1220,11) -->
    <ExitCode Value="-2067529717" Result="Fail" String="AnotherInstanceRunning"/>
    <!-- 0x84BE01F8 (1214,504) -->
    <ExitCode Value="-2067922440" Result="Fail" String="BetaComponentsFailure"/>
    <!-- 0x84BE01FA (1214,506) -->
    <ExitCode Value="-2067922438" Result="Fail" String="BetaComponentsFailure"/>
    <!-- 0x84BE0202 (1214,514) -->
    <ExitCode Value="-2067922430" Result="Fail" String="InvalidPlatformArchitecture"/>
    <!-- 0x84BE0203 (1214,515) -->
    <ExitCode Value="-2067922429" Result="Fail" String="InvalidPlatformArchitecture"/>
    <ExitCode Value="216" Result="Fail" String="InvalidPlatformArchitecture"/>
    <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
    </ExitCodes>
    </Command>

    <!-- Defines an upgrade installation (amd64) -->
    <Command PackageFile="SQLEXPRWT_x64_ENU.EXE"
    Arguments="/q /hideconsole /action=Upgrade /instancename=SQLEXPRESS /skiprules=RebootRequiredCheck"
    EstimatedInstalledBytes="225000000"
    EstimatedInstallSeconds="420">
    <InstallConditions>
    <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64"/>
    <BypassIf Property="SQLExpressInstalled" Compare="ValueEqualTo" Value="0"/>
    <FailIf Property="SQLExpressInstalled" Compare="ValueLessThan" Value="0" String="GeneralFailure"/>
    <BypassIf Property="SQLExpressInstalled" Compare="ValueGreaterThanOrEqualTo" Value="10001600"/>
    <FailIf Property="Version9x" Compare="ValueExists" String="InvalidPlatformXP"/>
    <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.1.2" String="InvalidPlatformXP"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.0" String="InvalidPlatform2K3"/>
    <FailIf Property="VersionNT" Compare="VersionEqualTo" Value="5.2.1" String="InvalidPlatform2K3"/>
    <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
    </InstallConditions>
    <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
    <ExitCode Value="1641" Result="SuccessReboot"/>
    <ExitCode Value="3010" Result="SuccessReboot"/>
    <!-- 0x84BE0BC2 (1214,3010) -->
    <ExitCode Value="-2067919934" Result="FailReboot"/>
    <!-- 0x84C10BC2 (1217,3010) -->
    <ExitCode Value="-2067723326" Result="FailReboot"/>
    <!-- 0x84BE0007 (1214,7) -->
    <ExitCode Value="-2067922937" Result="Fail" String="AdminRequired"/>
    <!-- 0x84C4001F (1220,31) -->
    <ExitCode Value="-2067529697" Result="Fail" String="AdminRequired"/>
    <!-- 0x84BE0001 (1214,1)-->
    <ExitCode Value="-2067922943" Result="Fail" String="InvalidPlatformOSServicePacks"/>
    <!-- 0x84C4000B (1220,11) -->
    <ExitCode Value="-2067529717" Result="Fail" String="AnotherInstanceRunning"/>
    <!-- 0x84BE01F8 (1214,504) -->
    <ExitCode Value="-2067922440" Result="Fail" String="BetaComponentsFailure"/>
    <!-- 0x84BE01FA (1214,506) -->
    <ExitCode Value="-2067922438" Result="Fail" String="BetaComponentsFailure"/>
    <!-- 0x84BE0202 (1214,514) -->
    <ExitCode Value="-2067922430" Result="Fail" String="InvalidPlatformArchitecture"/>
    <!-- 0x84BE0203 (1214,515) -->
    <ExitCode Value="-2067922429" Result="Fail" String="InvalidPlatformArchitecture"/>
    <ExitCode Value="216" Result="Fail" String="InvalidPlatformArchitecture"/>
    <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
    </ExitCodes>
    </Command>

    </Commands>

    <Strings>
    <String Name="DisplayName">SQL Server 2008 Express Edition With Tools</String>
    <String Name="Culture">en</String>
    <String Name="SqlExpr32WTExe">http://download.microsoft.com/download/7/9/4/794bfafa-aea7-45d4-a6ea-4e92f09918e3/SQLEXPRWT_x86_ENU.exe</String>
    <String Name="SqlExpr64WTExe">http://download.microsoft.com/download/7/9/4/794bfafa-aea7-45d4-a6ea-4e92f09918e3/SQLEXPRWT_x64_ENU.exe</String>
    <String Name="AdminRequired">You do not have the permissions required to install SQL Server 2008 Express Edition. Please contact your administrator.</String>
    <String Name="GeneralFailure">An error occurred attempting to install SQL Server 2008 Express Edition.</String>
    <String Name="InvalidPlatformXP">Windows XP Service Pack 2 or later is required to install SQL Server 2008 Express Edition.</String>
    <String Name="InvalidPlatform2K3">Windows 2003 Service Pack 2 or later is required to install SQL Server 2008 Express Edition.</String>
    <String Name="MissingMSXml">SQL Server 2008 Express Edition requires MSXML. Please ensure MSXML is installed properly.</String>
    <String Name="InsufficientHardware">The current system does not meet the minimum hardware requirements for SQL Server 2008 Express Edition. Contact your application vendor.</String>
    <String Name="InvalidPlatformOSServicePacks">The current operating system does not meet Service Pack level requirements for SQL Server 2008 Express Edition. Install the most recent Service Pack from the Microsoft download center at http://www.microsoft.com/downloads before continuing setup.</String>
    <String Name="InvalidPlatformIE">This version of SQL Server 2008 Express Edition requires Internet Explorer version 6.0 with SP1 or later. To proceed, install or upgrade to a required version of Internet Explorer and then run setup again.</String>
    <String Name="AnotherInstanceRunning">Another instance of setup is already running. The running instance must complete before this setup can proceed.</String>
    <String Name="BetaComponentsFailure">A beta version of the .NET Framework 2.0 or SQL Server was detected on the computer. Uninstall any previous beta versions of SQL Server 2008 components, SQL Server Support Files, or .NET Framework 2.0 before continuing.</String>
    <String Name="InvalidPlatformArchitecture">This version of SQL Server 2008 Express Edition is not supported for the current processor architecture.</String>
    </Strings>
    </Package>

  5. Get the proper eula.rtf (I'm just a developer, you figure it out!) and save it to the en folder. The installer just needs the file to exist there to work.



When setting SQL Server 2008 Express Edition with Tools as a prerequisite, be sure to also add Powershell 1.0! Otherwise the prereq install will fail.

Please let me know if this has helped you -- I know I pulled my hair out for a good two days before I decided to just sit down and do it.

30 comments:

Alex G said...

Any idea why powershell doesn't come up in the prereq list (sql 2008 does) ?

Anonymous said...

Same problem here too !
Powershell Bootstrapper doesn't show no matter what i try.

brock weaver said...

As long as you have ALL of the following, it should be showing up. Even if you don't target x64 or ia64, I think those files still have to be there to work properly.

Under the folder:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Powershell1_0

--product.xml
--en
----eula.rtf
----package.xml
----Windows6.0-KB928439-x64.msu
----Windows6.0-KB928439-x86.msu
----WindowsServer2003.WindowsXP-KB926139-v2-x64-ENU.exe
----WindowsServer2003-KB926139-v2-ia64-ENU.exe
----WindowsServer2003-KB926139-v2-x86-ENU.exe
----WindowsXP-KB926139-v2-x86-ENU.exe

Divine Charon said...

I, also can't see PowerShell despite I added one line < ?xml version="1.0" encoding="utf-8" ? > in product.xml. And I've already downloaded every files as you suggested.

brock weaver said...

I apologize -- I finally looked at everything very closely and the original product.xml had casing incorrect for some elements. Please see the edit note in the post for more info.

salaires-informatique.info said...

Hello,

Very good job (Microsoft, can you make that easier, because it's very very hard I think)

I had some problem to display Powershell item in the list while I use the good text case.
I found the solution, replace each "&" by this equivalent in HTML : "&"

Now, the big job, setup a new database during deployement...

Anonymous said...

Could you make a package for the sql express files found at http://www.microsoft.com/downloads/details.aspx?FamilyID=01af61e6-2f63-4291-bcad-fd500f6027ff&displaylang=en

This one has SP1 incorporated into it and I need it use on Vista, Windows 7 and Server 2008.

I didn't get what the guy was saying about replacing the ampersands with ampersands to make Powershell show up.

Hakan Aktan said...

Thanx for this helpful article.It is working well if you do what "salaires-informatique.info" says.

Kumar said...

Hi:

I was able to make Powershell show up by changing "&" in package.xml file under C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Powershell1_0\en to "&". However I don't know how to create the Windows Installer 4.5 under the Bootstrapper\Packages folder. This is a prerequisite and it does not show up.

Thanks,
Kumar

Hakan Aktan said...

In powershell folder, open package.xml file and replace "&" with "a m p ; " without any space between letters.

Srepfler Srgjan said...

It would seem that one needs to add the .Net Framework 3.5SP1 bootstrap for this to work as well ( http://download.microsoft.com/download/A/2/8/A2807F78-C861-4B66-9B31-9205C3F22252/VS2008SP1Readme.htm )?
Could you make a follow up using the latest SQLServer 2008 R2 November CTP?

Luca Simone said...

I think that
SqlExpressChk.exe
is missing from your great article....

In my opinion also the Windows Installer 4.5 dependency is missing

Thank you for your help..

Anonymous said...

please is there any topic for how to make bootstraper package for IIS windows components

michael said...

please is there any topic for how to create VS.NET 2008 Bootstrapper for IIS windows component?

please reply to me ASAP

Anonymous said...

to me it was a very good and informative article on how to work with different processor architectures/OSes and also on how to create install conditions/dependencies to orderly chain the prerequisites.
thanks a lot.

Anonymous said...

Hi. The rtm sql server 2008 R2 is released. Do you know if we need to change the public token or we just replace the new R2 files? Do you know the public token?

Anonymous said...

Please help me out. I'm getting an error message every time i try to do this. All the prerequisites are installing fine, 3.5 Framework SP1,Windows Installer 4.5, Powershell, but when I try to install the Sql Server 2008 Express edition with tools, i'm getting in the error log

Installing using command 'D:\DOCUME~1\xxxxx\SQLExpress2008WithTools\SQLEXPRWT_x86_ENU.EXE' and parameters '/q /hideconsole /action=Upgrade /instancename=SQLEXPRESS /skiprules=RebootRequiredCheck'
Process exited with code -2068578302
Status of package 'SQL Server 2008 Express Edition With Tools' after install is 'InstallFailed'

jerrychampeau said...

Below is the public key for SQL Express 2008 R2 that I've been using in a bootstrapper. You can find this for most files by viewing the Digital Signatures in the properties of the file. Select the certificate, the click on the details button. On the details tab of the Certificate look at the public key property.

3082010a0282010100bd3089fb4572a8536b9e894f0023c0bed41d3db1594038f373918226e696120053d91c820e3cce1dbbbdf7428d97d4fc381ae4b9f9e3ecd36103bfa0d3d6754d5c46a9ed5ef0d2e2695b1a73eab31c8d04cd2944a064592f1e985d6ec7ab18398265c4a7bcab758819ea87971426b37f2676a4d4383984e3b326d518f92be9d2c9165a5421f2978d878629fef4492ce68bf8043f7dcdcd9692860d7103e2d0fe0c4235ffd7b83fdd8e450a7df6d74bad5bf076721d77237d8935c41c5db250034b476d07a75588980680a681ad544ed881d6fabf42c031be550d99d553491230ebe5a5887c5ec47a5a148708b43769a0eb32248c08ebf9d414bae0fccdeaa4150203010001

jerrychampeau said...

I had a similar error for SQL Express 2008 R2. It was related to a few missing parameters. The following is what I'm using in a bootstrapper. The ones that I was missing was the /IAcceptSqlServerLicenseTerms, /sqlsvcaccount, /SqlSysAdminAccounts, and /AGTSVCACCOUNT. I'm not sure if all of them are needed, but it started working after I added those.

Below is the full set of arguments that I'm using:

/Q /HideConsole /IAcceptSqlServerLicenseTerms /Action=Install /Features=SQLEngine,SSMS /InstanceName=SQLEXPRESS /EnableRANU=1 /sqlsvcaccount="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service" /AddCurrentUserAsSqlAdmin /SqlSysAdminAccounts="BUILTIN\ADMINISTRATORS" /SkipRules=RebootRequiredCheck /SecurityMode=SQL /SaPwd=SAPASSWORD /TcpEnabled=1

Luca Simone said...

I created a package with sql Express 2008 and worked fine.
When I tried to package the R2 version, I got a problem.
It was a command line parameter added in this release.
Adding the /IACCEPTSQLSERVERLICENSETERMS flag, then worked fine.

Anonymous said...

Very useful info, saved me a buch of time, thanks.

Just change the & in the package.xml to ; and it will show up in VS Setup project

And as others mentioned a few things are missing from the bootstrapper you have for express + tools. It would be easier to take the existing one for 2008 and modify it?

Anonymous said...

Hi, would anyone have the same procedure for SQL Server 2008 Express Edition with advanced services, please?

Aruna Tennakoon said...

I just found out that IAcceptSqlServerLicenseTerms is only needed if you are deploying SQL Server 2008 R2 CTP2 or later version.

If you are using this with SQL Express SP 1 like me it's likely to get an error when installing :)

kof said...

nICE ARTICLE.
iT WILL WORK ON x64 BIT SYSTEM IF sql 2008 IS ALREADY
OR
IF I WANT TO INSTALL SQL 2005 IN SQL 2008 installed 64bit system.
but i want to install silent install
plz let me know ur thought.
-MAK

Anonymous said...

Thanks, this worked once I changed the ampersands to the proper XML encoding.

Also note that the EULA is not required if you take the references out of the Package and PackageFiles sections.

mayur said...

the folloing error come

Verifying file integrity of C:\DOCUME~1\Owner\LOCALS~1\Temp\VSD12B.tmp\SqlExpress2008\SQLEXPRWT_x86_ENU.EXE
WinVerifyTrust returned 0
File trusted
Installing using command 'C:\DOCUME~1\Owner\LOCALS~1\Temp\VSD12B.tmp\SqlExpress2008\SQLEXPRWT_x86_ENU.EXE' and parameters '/q /hideconsole /action=Install /FEATURES=SQL,Tools /instancename=SQLEXPRESS /SECURITYMODE=SQL /SAPWD="sstpl" /enableranu=1 /sqlsvcaccount="NT Authority\Network Service" /AddCurrentUserAsSqlAdmin /skiprules=RebootRequiredCheck /BROWSERSVCSTARTUPTYPE=Automatic /NPENABLED=1 /TCPENABLED=1'
Process exited with code -2147024893
Status of package 'Crystal Reports Basic for Visual Studio 2008 (x86, x64)' after install is 'InstallUnknown'
Status of package 'SQL Server 2008 Express Edition With Tools' after install is 'InstallFailed'

Anonymous said...

Verificate i termini e le condizioni dell'offerta, sul sito e off immediately to the buffet. [url=http://www.onlinecasinoburger.co.uk/]online casino[/url] uk online casino Per ogni primo deposito del mese viene offerto or disinclination when embracing the concept of a bonus and claiming your own. http://www.onlinecasinotaste.co.uk/

Anonymous said...

Hi there, I log on to your new stuff on a regular basis.
Your story-telling style is awesome, keep it up!

Here is my site - bmi calculation

Anonymous said...

Since the repayment of these loans provides a very long period of time, the actual monthly sequel is also not too high [url=http://www.ukbunnyloans.co.uk/]payday loan[/url] pay day loans and People from france publics will have a great deal to say about the idea http://www.jhgfpaydayloans.co.uk/

Anonymous said...

male to female massage in hyderabad It can be described as a condition where spots of tight or tensed muscles are formed. How grave or how long the experience has been, stress somehow results to worn out physical and mental well-being. Its main campus is located in downtown Los Angeles.
http://hyderabad.locanto.in/ID_163682523/Male-to-Female-Body-Massage-in-Hyderabad.html