Edw*_*lde 58 wix eventlog-source event-log
我正在为使用自定义事件日志源的网站创建安装程序.我希望我们的基于WiX的安装程序在安装期间创建该事件日志源.
有没有人知道使用WiX框架执行此操作的最佳方法.
Pau*_*nde 54
Wix为创建事件日志源提供了开箱即用的支持.
假设您使用Wix 3,首先需要将WixUtilExtension的引用添加到您的Votive项目或命令行.然后,您可以在组件下添加EventSource元素:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Component ...>
...
<util:EventSource Log="Application" Name="*source name*"
EventMessageFile="*path to message file*"/>
...
</Component>
Run Code Online (Sandbox Code Playgroud)
如果这是一个.NET项目,您可以使用框架目录中的EventLogMessages.dll作为消息文件.
Gor*_*don 18
只是为了节省一些时间 - 如果您尝试使用应用程序日志和.NET消息,您可以剪切粘贴以下代码:
<Util:EventSource
xmlns:Util="http://schemas.microsoft.com/wix/UtilExtension"
Name="ROOT Builder"
Log="Application"
EventMessageFile="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll"
/>
Run Code Online (Sandbox Code Playgroud)
注意:上面的路径现在是正确的..
Dan*_*con 17
内置更灵活的东西怎么样:
EventMessageFile="[NETFRAMEWORK20INSTALLROOTDIR]EventLogMessages.dll"
Run Code Online (Sandbox Code Playgroud)
要么
EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR]EventLogMessages.dll"
Run Code Online (Sandbox Code Playgroud)
和
EventMessageFile="[NETFRAMEWORK40FULLINSTALLROOTDIR64]EventLogMessages.dll"
Run Code Online (Sandbox Code Playgroud)