0

I am trying to install SQL Serve CE along with my application bootstrap bundle.

Here is my code:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
   xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="Bootstrapper" Version="1.0.0.0" Manufacturer="Billy"
        UpgradeCode="4a2346e9-a126-43fb-a352-05a95623e0d4">
  <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
  <Chain>

    <PackageGroupRef Id="Netfx4Full"/>
    <PackageGroupRef Id="SQLExpressCE"/>

    <!-- Install Application -->
    <MsiPackage Id="MyApplication" SourceFile="$(var.Installer.TargetPath)"/>

  </Chain>
</Bundle>

<Fragment>
  <!-- Check for .NET 4.0 -->
  <util:RegistrySearch Root="HKLM"
                       Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                       Value="Version"
                       Variable="Netfx4FullVersion" />
  <util:RegistrySearch Root="HKLM"
                       Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
                       Value="Version"
                       Variable="Netfx4x64FullVersion"
                       Win64="yes" />

  <!-- Install .NEt 4.0 -->
  <PackageGroup Id="Netfx4Full">
    <ExePackage Id="Netfx4Full"
                DisplayName="Microsoft .NET Framework 4.0"
                Compressed="no"
                Cache="yes"
                PerMachine="yes"
                Permanent="yes"
                Protocol="netfx4"
                Vital="yes"
                SourceFile=".\prerequisites\dotNetFx40_Full_x86_x64.exe"
                InstallCommand="/passive /norestart"
                DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
  </PackageGroup>

  <!-- Install SQL Server CE -->
  <PackageGroup Id="SQLExpressCE">
    <MsiPackage
              Cache="no"
              Compressed="no"
              ForcePerMachine="yes"
              Permanent="yes"
              Vital="yes"
              SourceFile=".\prerequisites\SSCERuntime-ENU.msi"
              InstallCondition="NOT VersionNT64 AND SqlInstance AND SqlServerInstalled AND SQLServer2008R2Installed" />
    <MsiPackage
              Cache="no"
              Compressed="no"
              ForcePerMachine="yes"
              Permanent="yes"
              Vital="yes"
              SourceFile=".\prerequisites\SSCERuntime-ENU-x64.msi"
              InstallCondition="VersionNT64 AND NOT SqlInstance AND SqlServerInstalled AND SQLServer2008R2Installed" />
  </PackageGroup>

</Fragment>
</Wix>

However .NET 4.0 is installing fine, the only problem I am facing is that SQL Server CE is not installing with package. What would be wrong?

Django Anonymous
  • 2,987
  • 16
  • 58
  • 106

1 Answers1

0

Install conditions for both SQL packages never evaluate to true.

First of all, there are no SqlInstance, SqlServerInstalled or SQLServer2008R2Installed Burn built-in variables (please see documentation for a full list of available ones). You need to create them manually, like you do for Netfx4FullVersion and Netfx4x64FullVersion.

Secondly, condition expressions themselves are wrong. They will pass only if there is already SQL Server installed.

I don't have SQL Server installed, so I'm not sure about exact searches you should perform, but they will look something like:

<util:RegistrySearch Root="HKLM"
                 Key="SYSTEM\CurrentControlSet\services\MSSQLSERVER"
                 Result="exists"
                 Variable="SQLServerInstalled" />

<util:RegistrySearch Root="HKLM"
                     Key="SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER"
                     Result="exists"
                     Variable="SQLServer2008R2Installed" />

And then as your install condition use approximately this:

InstallCondition="VersionNT64 AND NOT SqlServerInstalled AND NOT SQLServer2008R2Installed"

You can also refer to this message from the original Wix mailing list for more complete example: Install SQL SERVER 2008 R2 Express. Unfortunately I can't post any more links cause of low reputation.

Somedust
  • 1,150
  • 1
  • 19
  • 28
  • Could you please help me making it correct. What exactly has to be `InstallCondition` then? And how to frame it correctly? – Django Anonymous Nov 14 '13 at 15:05
  • One more link on this matter http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/SQL-CE-4-0-Package-tp7586592p7587030.html – Somedust Nov 15 '13 at 07:38