TL:DR
How can I tell WiX to copy files from the installer to a specified directory within the user MyDocuments
folder?
I'm trying to write a rudimentary installer using WiX. I've figured out how to reference the projects and the executable, but I want the installer to write a few files to the MyDocuments directory of the user installing the program.
Why not AppData? Because most users don't know how to access the AppData directory and the program should allow the relatively easy access to the files in question, so that they can add or remove the files as they see fit, for good or for ill.
Additionally, if the user decides to remove those files, I would prefer for the program NOT to yell at them when on subsequent runs, as the program has internal checks to make sure the files exist before referencing them, and if they do not, references them internally.
What would I need to add to the following WiX script to tell it "Put MySetupInstallerDocument.txt in MyDocuments/MySetupProject/MySetupProjectFiles" where MySetupInstallerDocument.txt is located within the same folder as the .wxs file?
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product
Id="*" Name="MySetupInstaller" Language="1033" Version="1.0.0.0" Manufacturer=""
UpgradeCode="07a36861-41cf-40e4-a1b6-eb970bc305ff">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade
DowngradeErrorMessage="Bla bla bla" />
<MediaTemplate />
<Feature Id="ProductFeature" Title="MySetupInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MySetupInstaller" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent">
<File Source="$(var.MySetupProject.TargetPath)" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>