Wix XmlFile is keeping SqlDatabase from creating databases

Posted by Grandpappy on Stack Overflow See other posts from Stack Overflow or by Grandpappy
Published on 2010-04-08T19:49:38Z Indexed on 2010/04/08 19:53 UTC
Read the original article Hit count: 780

Filed under:
|
|

I've got a Wix project made up of several fragments. One of those fragments has the database components, another has a component that manipulates xml files.

When I include the XmlFile element to manipulate a file, the databases defined by the SqlDatabase do not get created. If I comment out the XmlFile, then the databases do get created.

Here are the two wix files with fragments that are being used:

Database:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension">
  <Fragment>
    <DirectoryRef Id="TARGETDIR">
      <Component Id="Database1Creation" Guid="GUID_HERE">
        <sql:SqlDatabase Id="Database1"
          Server="[DATABASE_SERVER]" Database="[DATABASE_NAME]"
          CreateOnInstall="yes" ConfirmOverwrite="no"
          DropOnUninstall="yes">
        </sql:SqlDatabase>
      </Component>
    </DirectoryRef>
 </Fragment>
</Wix>

Xml Manipulation:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Fragment>

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="MyDirectory">
          <Component Id="ServiceExecutables" Guid="GUID_HERE">
            <File Id="File1" Name="File1.xml" Source="Source/File1.xml" />
            <util:XmlFile Id="UpdateFile1" File="[INSTALLDIR]File1.xml" Action="setValue" ElementPath="//SomeContainer/SomeElement" Value="[SOME_VALUE]" />
          </Component>
        </Directory>
      </Directory>
    </Directory>

  </Fragment>
</Wix>

There are other things that are also installed, but they don't appear to have any influence on the issue (I've removed everything else and tested the install).

When looking at the install logs when using XmlFile and when not, they are almost exact copies of each other, except that the SqlDatabase calls would be completely missing, and the XmlFile calls would be in their place.

Is there a known bug here? Or am I doing something I shouldn't be? This isn't a killer for our app, since I can move the things I'm putting in the xml file into the registry, but I'd rather not do that.

I am using Wix 3.5.

© Stack Overflow or respective owner

Related posts about wix

Related posts about msi