How to copy files to Programdata folder using Wix?

Asked

Viewed 181 times

2

I create the directory on Wix

<Directory Id="CommonAppDataFolder">
    <Directory Id="CommonAppDataManufacturerFolder" Name="$(var.MANUFACTURER)">
        <Directory Id="AppDataFolder" Name="$(var.PRODUCTNAME)">
            <Directory Id="DatasFolder" Name="Datas"/>
        </Directory>
    </Directory>
</Directory>

and have the component copied

<ComponentGroup Id="DatasComponents" Directory="DatasFolder">
    <Component Id="Database.sdf" Guid="4c33c78e-7113-4a8c-b9fd-6ba4f6490935">
        <File Id="Database.sdf" Source="Database.sdf" />
        <RemoveFolder Id='DatasFolder' On='uninstall' />
        <RegistryValue Root='HKCU'
                        Key='Software\[Manufacturer]\[ProductName]'
                        Type='string'
                        Value=''
                        KeyPath='yes' />
    </Component>
</ComponentGroup>

But the file is being copied to C:\Users\username\AppData\Roaming\Datas\ and not where I want: %ProgramData%\Manufacturer\ProductName\Datas\

  • 2

    I asked the same question in English http://stackoverflow.com/questions/21865005/how-to-copy-files-to-commonappdatafolder

1 answer

1


The problem was that AppDataFolder is a reserved word, I just had to exchange this ID and it worked:

<Directory Id="CommonAppDataFolder">
    <Directory Id="CommonAppDataManufacturerFolder" Name="$(var.MANUFACTURER)">
        <Directory Id="MyAppDataFolder" Name="$(var.PRODUCTNAME)">
            <Directory Id="DatasFolder" Name="Datas"/>
        </Directory>
    </Directory>
</Directory>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.