Wix Event Log Not Getting Created
I'm trying to create an Event Log and Event Source at install time using Wix. The install doesn't fail or give any error...b开发者_JAVA技巧ut I don't see any Event Log called MyApp getting created.
<PropertyRef Id="NETFRAMEWORK40FULLINSTALLROOTDIR"/>
<Component Id="EventLog" Guid="AD09F8B9-80A0-46E6-9E36-9618E2023D67">
<util:EventSource Log="MyApp" Name="MyApp" EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR]EventLogMessages.dll" />
</Component>
I previously had a .NET Installer class that did this and it worked without a problem.
What am I doing wrong?
I had problems with this, and it was because I was missing a <CreateFolder />
element; my code ended up looking like this:
<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>
(so it can handle both 32-bit and 64-bit installs of .NET 4)
Can you post an installer log? The EventSource element is really just some syntatical sugar. WiX translates these into simple registry keys/values and I've never seen it fail in any of the installs I've used it in.
精彩评论