Iain
Iain

Reputation: 12779

How do I deploy registry keys and values using WiX 3.0?

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.

Upvotes: 3

Views: 3121

Answers (5)

Paul Lalonde
Paul Lalonde

Reputation: 5050

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.

Upvotes: 5

Mike Dimmick
Mike Dimmick

Reputation: 9802

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.

Upvotes: 1

Iain
Iain

Reputation: 12779

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>

Upvotes: 1

SCdF
SCdF

Reputation: 59428

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

Upvotes: 1

Dror Helper
Dror Helper

Reputation: 30819

Use the following under DirectoryRef --> Directory...

<Component 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" />

</Component>

Upvotes: 0

Related Questions