如果我想创建注册表项
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp
带有字符串值
事件消息文件:C:\Path\To\File.dll
如何在我的WiX 3.0 WXS 文件中定义它?非常感谢 XML 应该是什么样子的示例。
如果我想创建注册表项
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp
带有字符串值
事件消息文件:C:\Path\To\File.dll
如何在我的WiX 3.0 WXS 文件中定义它?非常感谢 XML 应该是什么样子的示例。
您似乎想创建一个事件日志源。如果是这种情况,您应该查看 util 扩展中的<EventSource>元素。
看看这个页面。一个例子是:
<registry action="write"
root"HKLM" key="SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp"
type="string" value="EventMessageFile : C:\Path\To\File.dll" />
我和这个一起去了:
<Component Id="EventLogRegKeys" Guid="{my guid}">
<RegistryKey Id="Registry_EventLog" Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp" Action="create">
<RegistryValue Id="Registry_EventLog_EventSourceDll" Action="write" KeyPath="yes" Name="EventMessageFile" Type="string" Value="C:\Path\To\File.dll" />
</RegistryKey>
</Component>
最好使用文件引用语法来引用 File.dll,以确保使用它安装到的实际路径。使用[#filekey]
,其中filekey
是描述文件Id
的File
元素。
在 DirectoryRef --> Directory... 下使用以下内容
<组件 ID="RegisterAddReferencesTab32" Guid="D9D01248-8F19-45FC-B807-093CD6765A60"> <RegistryValue Action="write" Id="RegInstallDir32" Key="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp" Root="HKLM" Type="string" Value="C:\Path\To\File .dll" /></组件>