WiX MultiString registry keys

1.1k views Asked by At

I tried adding registry keys for compatibility assistant to a wix setup like this:

<File Id="File1.exe" Name="File1.exe" LongName="File1.exe" Source="..\Binaries\File1.exe" DiskId="1" />
<File Id="File2.exe" Name="File2.exe" LongName="File2.exe" Source="..\Binaries\File2.exe" DiskId="1" />
<File Id="File3.exe" Name="File3.exe" LongName="File3.exe" Source="..\Binaries\File3.exe" DiskId="1" />
<Registry Root="HKLM"
          Key="Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant"
          Name="ExecutablesToExclude"
          Type="multiString"
          Action="append">
    <RegistryValue Action="append" Value="[File1.exe]" />
    <RegistryValue Action="append" Value="[File2.exe]" />
    <RegistryValue Action="append" Value="[File3.exe]" />
</Registry>

But when installing no key gets generated. Am I missing anything or doing something wrong? I got the details for what I'm doing from this question and the wix documentation.

Update: The syntax is a bit different, I think because the question I pointed to uses a different version of WiX. The syntax I used is the only one WiX 2 accepts, and this wix file builds fine - it just doesn't generate new registry entries.


Update: I was misdiagnosing the problem; the wix scrpit worked properly, but put the values in the Wow6432bit node of the registry because the containing component didn't have the attribute Win64="yes".

1

There are 1 answers

1
Yan Sklyarenko On

As far as I can see, RegistryValue element in WiX2 doesn't have attributes. I wonder, how your sample gets compiled without errors...

Anyway, try to rewrite your Registry element like this:

<Registry Root="HKLM"
          Key="Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant"
          Name="ExecutablesToExclude"
          Type="multiString"
          Action="append">
    <RegistryValue>[File1.exe]</RegistryValue>
    <RegistryValue>[File2.exe]</RegistryValue>
    <RegistryValue>[File3.exe]</RegistryValue>
</Registry>