Wix XmlFile 阻止 SqlDatabase 创建数据库

发布于 2024-08-28 04:15:19 字数 1901 浏览 4 评论 0原文

我有一个由几个片段组成的 Wix 项目。其中一个片段具有数据库组件,另一个片段具有操作 xml 文件的组件。

当我包含 XmlFile 元素来操作文件时,不会创建 SqlDatabase 定义的数据库。如果我注释掉 XmlFile,那么就会创建数据库。

以下是正在使用的两个带有片段的 wix 文件:

数据库:

<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 操作:

<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>

还安装了其他东西,但它们似乎对问题没有任何影响(我已经删除了其他所有内容并测试了安装)。

当查看使用 XmlFile 时和不使用 XmlFile 时的安装日志时,它们几乎是彼此完全相同的副本,只是 SqlDatabase 调用将完全丢失,而 XmlFile 调用将取代它们。

这里有一个已知的错误吗?还是我做了一些不该做的事?这对我们的应用程序来说并不是一个杀手,因为我可以将 xml 文件中的内容移动到注册表中,但我宁愿不这样做。

我正在使用 Wix 3.5。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

听风吹 2024-09-04 04:15:19

好消息,build 1616 修复了这个问题。尽快更新 Wix。

Good news, build 1616 fixes this. Update Wix ASAP.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文