简体   繁体   English

WiX 工具集 - EventSource 设置错误的 EventMessageFile 路径(前置“#%”)

[英]WiX toolset - EventSource sets wrong path to EventMessageFile (prepends "#%")

I have WiX 4.0 project.我有 WiX 4.0 项目。 I'm using Util to create Windows EventLog event source.我正在使用 Util 创建 Windows EventLog 事件源。 The problem is, the Registry entry to the EventMessageFile gets the path prepended with "#%".问题是,EventMessageFile 的注册表项获得了前缀为“#%”的路径。 Therefore, the EventLog will display errors for events created by this event source.因此,EventLog 将显示此事件源创建的事件的错误。

Code to create the EventSource:创建 EventSource 的代码:

<Include xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
    <PropertyRef Id="NETFRAMEWORK40FULLINSTALLROOTDIR64"/>
    <PropertyRef Id="NETFRAMEWORK40CLIENTINSTALLROOTDIR64"/>
    <PropertyRef Id="NETFRAMEWORK40CLIENT"/>
    <PropertyRef Id="NETFRAMEWORK40FULL"/>

.
.
.

    <ComponentGroup Id="EventLog" Directory="INSTALLFOLDER">
        <!-- 64 bit -->
        <Component Id="CreateEventSource64BitFullNet4" DiskId="1" Guid="{9978592B-3E96-4AAA-B7A6-34B0421FDD02}" Condition="NETFRAMEWORK40FULLINSTALLROOTDIR64 AND VersionNT64">
            <CreateFolder/>
            <util:EventSource Log="Application" Name="ScholarshipSapQueue" EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR64]EventLogMessages.dll" />
        </Component>
        <Component Id="CreateEventSource64BitClientNet4" DiskId="1" Guid="{B42622A1-B7C0-48CB-B306-65F3558C6678}" Condition="NETFRAMEWORK40CLIENTINSTALLROOTDIR64 AND NOT NETFRAMEWORK40FULL AND VersionNT64">
            <CreateFolder/>
            <util:EventSource Log="Application" Name="ScholarshipSapQueue" EventMessageFile="[NETFRAMEWORK40CLIENTINSTALLROOTDIR64]EventLogMessages.dll" />
        </Component>
    </ComponentGroup>
</Include>

Looking at the log file from installing the MSI, the value of the properties does look correct:查看安装 MSI 的日志文件,属性值看起来确实正确:

MSI (c) (B4:68) [10:05:27:331]: PROPERTY CHANGE: Adding NETFRAMEWORK40FULLINSTALLROOTDIR64 property. Its value is 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\'.

But the Registry entry is wrong:但是注册表项是错误的:

MSI (s) (3C:28) [10:05:33:008]: Executing op: ActionStart(Name=WriteRegistryValues,Description=Writing system registry values,Template=Key: [1], Name: [2], Value: [3])
Action 10:05:33: WriteRegistryValues. Writing system registry values
MSI (s) (3C:28) [10:05:33:014]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=13200)
MSI (s) (3C:28) [10:05:33:014]: Executing op: RegOpenKey(Root=-2147483646,Key=SYSTEM\CurrentControlSet\Services\EventLog\Application\ScholarshipSapQueue,,BinaryType=0,,)
MSI (s) (3C:28) [10:05:33:014]: Executing op: RegAddValue(Name=EventMessageFile,Value=##%C:\Windows\Microsoft.NET\Framework64\v4.0.30319\EventLogMessages.dll,)
WriteRegistryValues: Key: \SYSTEM\CurrentControlSet\Services\EventLog\Application\ScholarshipSapQueue, Name: EventMessageFile, Value: ##%C:\Windows\Microsoft.NET\Framework64\v4.0.30319\EventLogMessages.dll

在此处输入图像描述

That smells like a WiX v4 bug.这闻起来像 WiX v4 错误。 Please open an issue at https://github.com/wixtoolset/issues/issues/new/choose .请在https://github.com/wixtoolset/issues/issues/new/choose打开一个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM