Wix is lots of xml but for simple setup programs it isn’t all that bad. I guess it can become a maintenance problem for big projects but for small things it’s kind of easy to use, once you understand the madness and forget the bad documentation.

So I like to keep some order in my installfolder (the one where your program is installed.

I like to keep the helpfile(s) in their separate little folder. And my program also goes to look for them in that folder. So we need to recreate this.

Typically your Wix would look something like this.

```xml <?xml version=“1.0” encoding=“UTF-8”?> <Wix xmlns=“http://schemas.microsoft.com/wix/2006/wi"> <Product Id=”*” Name=“test” Language=“1033” Version=“1.0.0.0” Manufacturer=“Me” UpgradeCode=“someguid”> <Package InstallerVersion=“200” Compressed=“yes” InstallScope=“perMachine” />

&lt;Feature Id="ProductFeature" Title="Test" Level="1"&gt;
  &lt;ComponentGroupRef Id="TestComponents" /&gt;
&lt;/Feature&gt;

    &lt;MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /&gt;
    &lt;MediaTemplate /&gt;

&lt;/Product&gt;

<Fragment> <Directory Id=“TARGETDIR” Name=“SourceDir”> <Directory Id=“ProgramFilesFolder”> <Directory Id=“INSTALLFOLDER” Name=“Test”>
</Directory> </Directory> <Directory Id=“ProgramMenuFolder”> <Directory Id=“ApplicationProgramsFolder” Name=“Test”/> </Directory> </Directory> </Fragment>

<Fragment> <ComponentGroup Id=“TestComponents” Directory=“INSTALLFOLDER”> <Component Id=“Test.exe” Guid=“someguid”> <File Id=“test.exe” Source=“$(var.Test.TargetPath)” KeyPath=“yes” Checksum=“yes”/> </Component> <Component Id=“NLog.dll” Guid=“someguid”> <File Id=“NLog.dll” Source=“$(var.Test.TargetDir)NLog.dll” KeyPath=“yes”/> </Component> <Component Id=“testhelp.chm” Guid=“someguid”> <File Id=“testhelp.chm” Source=“$(var.Test.TargetDir)helpfilestesthelp.chm” KeyPath=“yes”/> </Component> </Fragment> </Wix>``` But the above will put your helpfile straight into root of the installfolder. Of course now my program is looking for it in the helpfiles folder instead of the root.

Not to worry we can simply fix this.

```xml <?xml version=“1.0” encoding=“UTF-8”?> <Wix xmlns=“http://schemas.microsoft.com/wix/2006/wi"> <Product Id=”*” Name=“test” Language=“1033” Version=“1.0.0.0” Manufacturer=“Me” UpgradeCode=“someguid”> <Package InstallerVersion=“200” Compressed=“yes” InstallScope=“perMachine” />

&lt;Feature Id="ProductFeature" Title="Test" Level="1"&gt;
  &lt;ComponentGroupRef Id="TestComponents" /&gt;
  &lt;ComponentGroupRef Id="HelpFilesComponents" /&gt;
&lt;/Feature&gt;

    &lt;MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /&gt;
    &lt;MediaTemplate /&gt;

&lt;/Product&gt;

<Fragment> <Directory Id=“TARGETDIR” Name=“SourceDir”> <Directory Id=“ProgramFilesFolder”> <Directory Id=“INSTALLFOLDER” Name=“Test”> <Directory Id=“HELPFILES” Name=“HelpFiles” /> </Directory> </Directory> <Directory Id=“ProgramMenuFolder”> <Directory Id=“ApplicationProgramsFolder” Name=“Test”/> </Directory> </Directory> </Fragment>

<Fragment> <ComponentGroup Id=“TestComponents” Directory=“INSTALLFOLDER”> <Component Id=“Test.exe” Guid=“someguid”> <File Id=“test.exe” Source=“$(var.Test.TargetPath)” KeyPath=“yes” Checksum=“yes”/> </Component> <Component Id=“NLog.dll” Guid=“someguid”> <File Id=“NLog.dll” Source=“$(var.Test.TargetDir)NLog.dll” KeyPath=“yes”/> </Component>
</ComponentGroup> <ComponentGroup Id=“HelpFilesComponents” Directory=“HELPFILES”> <Component Id=“testhelp.chm” Guid=“someguid”> <File Id=“testhelp.chm” Source=“$(var.Test.TargetDir)helpfilestesthelp.chm” KeyPath=“yes”/> </Component> </ComponentGroup> </Fragment> </Wix>``` So we add a ComponentGroupRef to our feature tag in the product tags and give it an id of HelpFilesComponents.

We add a directory tag to the installfolder directory. That way it becomes a subfolder of the installfolder.

And we add a Componentgroup with a helpfilescomponents id and a directory using the Id of helpfiles and move the chm file component to that group.

And now your helpfile is in the correct folder as it should be.