title: How to make changing MSI install folder work in WiX?
body: <p>I created a MSI installer to install per-user.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Wix xmlns=&quot;http://schemas.microsoft.com/wix/2006/wi&quot;&gt;
    &lt;Product
      Id=&quot;*&quot;
      Language=&quot;1033&quot;
      Manufacturer=&quot;my company&quot;
      Name=&quot;my software&quot;
      UpgradeCode=&quot;{9B85A1B0-6914-4573-92C1-27A6DB849E1D}&quot;
      Version=&quot;2.0.0.0&quot;&gt;
  
      &lt;Package 
        Compressed=&quot;yes&quot;
        Description=&quot;a software&quot; 
        InstallerVersion=&quot;500&quot; 
        InstallScope=&quot;perUser&quot;
        Manufacturer=&quot;my company&quot;
        Comments=&quot;copyright&quot; /&gt;
  
      &lt;MediaTemplate EmbedCab=&quot;yes&quot; /&gt;
  
      &lt;Directory Id=&quot;TARGETDIR&quot; Name=&quot;SourceDir&quot;&gt;
        &lt;Directory Id=&quot;AppDataFolder&quot;&gt;
          &lt;Directory Id=&quot;ManufacturerFolder&quot; Name=&quot;MyCompany&quot;&gt;
            &lt;Directory Id=&quot;INSTALLFOLDER&quot; Name=&quot;MySoftware&quot;&gt;
            &lt;/Directory&gt;
          &lt;/Directory&gt;
        &lt;/Directory&gt;
      &lt;/Directory&gt;
  
      &lt;DirectoryRef Id=&quot;ManufacturerFolder&quot;&gt;
        &lt;Component Id=&quot;cmp_manufacturer&quot; Guid=&quot;{264B9740-7BF6-4D90-9F0A-5B9489687C96}&quot;&gt;
          &lt;RegistryValue 
            Root='HKCU' 
            Key='Software\MyCompany\MySoftware\Product'
            Name='reg_manufacturer'
            Value='manufacturer'
            Type='string'
            KeyPath='yes' /&gt;
          &lt;RemoveFolder Id=&quot;removeManufacturerFolder&quot; On=&quot;uninstall&quot; /&gt;
        &lt;/Component&gt;
      &lt;/DirectoryRef&gt;
  
      &lt;DirectoryRef Id=&quot;INSTALLFOLDER&quot;&gt;
        &lt;Component Id=&quot;cmp_install&quot; Guid=&quot;{0CF4AFFB-9676-4944-BCE7-9B0F54704677}&quot;&gt;
          &lt;RegistryValue 
            Root='HKCU' 
            Key='Software\MyCompany\MySoftware\Product'
            Name='reg_install'
            Value='install'
            Type='string'
            KeyPath='yes' /&gt;
          &lt;File Id=&quot;file_install&quot; Source=&quot;installfile.txt&quot; /&gt;
          &lt;RemoveFolder Id=&quot;removeInstallFolder&quot; On=&quot;uninstall&quot; /&gt;
        &lt;/Component&gt;
      &lt;/DirectoryRef&gt;
  
      &lt;UIRef Id=&quot;WixUI_InstallDir&quot; /&gt;
      &lt;Property Id=&quot;WIXUI_INSTALLDIR&quot; Value=&quot;INSTALLFOLDER&quot; /&gt;
  
      &lt;Feature 
        Id=&quot;MainFeature&quot;
        Title=&quot;My Software&quot;
        Level=&quot;1&quot;&gt;
        &lt;ComponentRef Id=&quot;cmp_manufacturer&quot; /&gt;
        &lt;ComponentRef Id=&quot;cmp_install&quot; /&gt;
      &lt;/Feature&gt;
    &lt;/Product&gt;
  &lt;/Wix&gt;
  </code></pre>
  <p>It works well if using default install folder <code>C:\Users\xxx\AppData\Roaming\MyCompany\MySoftware</code>. The file <code>installfile.txt</code> can be removed on uninstall. If I changed the install folder to a different folder using the WiXUI, the file <code>installfile.txt</code> can be copied to the right folder, But the copied file cannot be removed on uninstall. So why that file cannot be removed on uninstall, how to fix this?</p>
  <p>I'll appreciate any help.</p>