如何使用 WiX 创建事件日志源 [英] How do you create an event log source using WiX

查看:20
本文介绍了如何使用 WiX 创建事件日志源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为使用自定义事件日志源的网站创建安装程序.我希望我们基于 WiX 的安装程序在安装期间创建该事件日志源.

I'm creating an installer for a website that uses a custom event log source. I would like our WiX based installer to create that event log source during installation.

有谁知道使用 WiX 框架的最佳方法.

Does anyone know the best way to do this using the WiX framework.

推荐答案

Wix 开箱即用地支持创建事件日志源.

Wix has out-of-the-box support for creating event log sources.

假设您使用 Wix 3,您首先需要在您的 Votive 项目或命令行中添加对 WixUtilExtension 的引用.然后,您可以在组件下添加 EventSource 元素:

Assuming you use Wix 3, you first need to add a reference to WixUtilExtension to either your Votive project or the command line. You can then add an EventSource element under a component :

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

如果是.NET项目,可以使用framework目录下的EventLogMessages.dll作为消息文件.

If this is a .NET project, you can use EventLogMessages.dll in the framework directory as the message file.

这篇关于如何使用 WiX 创建事件日志源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆