views:

610

answers:

5

If I want to create the registry key

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp

with the string value

EventMessageFile : C:\Path\To\File.dll

how do I define this in my WiX 3.0 WXS file? Examples of what the XML should look like is much appreciated.

A: 
Dror Helper
+1  A: 

Check out this page. An example would be:

<registry action="write" 
 root"HKLM" key="SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp"
 type="string" value="EventMessageFile : C:\Path\To\File.dll" />
SCdF
+1  A: 

I went with this:

<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>
Iain
+1  A: 

It would be better to refer to File.dll using file reference syntax, to ensure that the actual path it's installed to is used. Use [#filekey], where filekey is the Id of the File element describing the file.

Mike Dimmick
+4  A: 

You seem to want to create an event log source. If that is the case, you should take a look at the <EventSource> element in the util extension.

Paul Lalonde
Agree. See http://www.wixwiki.com/index.php?title=EventSource_Element
Pavel Chuchuva