Wix事件日志没有被创建

时间:2011-09-24 05:08:17

标签: wix windows-installer wix3.5

我正在尝试使用Wix在安装时创建事件日志和事件源。安装不会失败或给出任何错误......但我没有看到任何名为MyApp的事件日志被创建。

      <PropertyRef Id="NETFRAMEWORK40FULLINSTALLROOTDIR"/>


      <Component Id="EventLog" Guid="AD09F8B9-80A0-46E6-9E36-9618E2023D67">
        <util:EventSource Log="MyApp" Name="MyApp" EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR]EventLogMessages.dll" />
      </Component>

我之前有一个.NET Installer类,它可以正常运行,并且没有问题。

我做错了什么?

2 个答案:

答案 0 :(得分:0)

您可以发布安装程序日志吗? EventSource元素实际上只是一些合成糖。 WiX将这些转换为简单的注册表键/值,我从来没有看到它在我使用它的任何安装中失败。

答案 1 :(得分:0)

我遇到了这个问题,这是因为我错过了一个<CreateFolder />元素;我的代码最终看起来像这样:

<Component Id="CreateEventLog32Bit" Guid="{some-guid}" Permanent="yes">
    <Condition><![CDATA[NETFRAMEWORK40FULLINSTALLROOTDIR AND NOT VersionNT64]]></Condition>
    <CreateFolder />
    <util:EventSource Log="Application" Name="MyApp" EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR]EventLogMessages.dll" />
</Component>
<Component Id="CreateEventLog64Bit" Guid="{some-other-guid}" Permanent="yes">
    <Condition><![CDATA[NETFRAMEWORK40FULLINSTALLROOTDIR64  AND VersionNT64]]></Condition>
    <CreateFolder />
    <util:EventSource Log="Application" Name="MyApp" EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR64]EventLogMessages.dll" />
</Component>

(因此它可以处理.NET 4的32位和64位安装)