0
votes

Using WiX, a file can be installed to ProgramFiles using the following:

<DirectoryRef Id="ApplicationBinDirectory">
    <Component ...>
        <File Id="..." KeyPath="yes" Source="..." />
    </Component>
</DirectoryRef>

Now I want to do the same, but the target is a folder in local application data. The file really belongs there according to http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx

<!-- this is the folder in %LOCALAPPDATA% -->
<Directory Id="LocalAppDataFolder">
    <Directory Id="ApplicationLocalAppDataDirectory" Name="my folder name"/>
</Directory>
<DirectoryRef Id="ApplicationLocalAppDataDirectory">
    <File Id="fil" KeyPath="yes" Source="..." />
</DirectoryRef>

But I get the following error and warning now:

installer.wxs(63) : error LGHT0204 : ICE38: Component ApplicationConfiguration installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file. installer.wxs(64) : warning LGHT1076 : ICE91: The file 'fil' will be installed to the per user directory 'ApplicationLocalAppDataDirectory' that doesn't vary based on ALLUSERS value. This file won't be copied to each user's profile even if a per machine installation is desired.

Adding RegistryValue and RemoveFolder as I have to do it for start menu shortcuts doesn't change the message.

I'm kind of lost here. How do I install a file to local appdata? Please note that I want to install only 1 file there, in addition to the usual setup in program files.

1

1 Answers

0
votes

This should help. It shows adding a registry key item to be the keypath:

http://nofoe.blogspot.com/2008/12/wix-it-must-use-registry-key-under-hkcu.html