Wednesday, December 17, 2008

wix - It must use a registry key under HKCU as its KeyPath, not a file.

Took me a few minutes to figure out my problem with this error in wix: It must use a registry key under HKCU as its KeyPath, not a file.

My original code:
<Directory Id="AppDataFolderName="AppDataFolder">
  <Directory Id="MyAppFolderName="My">
    <Component Id="MyComponentGuid="cc509cb7-c1a1-46cf-8c62-7cbb0017783c">
      <File Id="test1.txtName="test1.txtKeyPath="yesSource="Files\test1.txt" />
    </Component>
  </Directory>
</Directory>

This is what it needed to be:
<Directory Id="AppDataFolderName="AppDataFolder">
  <Directory Id="MyAppFolderName="My">
    <Component Id="MyComponentGuid="cc509cb7-c1a1-46cf-8c62-7cbb0017783c">
    <RegistryKey Action="noneKey="myKeyNameRoot="HKCU>
         <RegistryValue Type="integerValue="1KeyPath="yes" />
    </RegistryKey>
      <File Id="test1.txtName="test1.txtKeyPath="yesSource="Files\test1.txt" />
    </Component>
  </Directory>
</Directory>