title: Add files in program data using wix
body: <p>I am developing an Outlook addin using addin express. I am using a <code>.wxs</code> file in my program's setup project. It helps me to install my program in <code>roaming</code> folder. I want to add <code>Redemption.dll</code> to the path <code>C:\programData\Flow</code>. So I modified the code as mentioned below. But it is not working. Please advice me.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"&gt;
    &lt;!--Modified[Id]--&gt;
    &lt;Product
    Id="faa8e62a-0834-4efa-aad3-b2f7903a3a6c"
    Name="FlowOutlook"
    Language="1033"
    Version="1.1.4"
    Manufacturer="Default Company"
    UpgradeCode="faa8e62a-0834-4efa-aad3-b2f7903a3a6d"
    Codepage="1252"&gt;
  
      &lt;Package
        InstallerVersion="200"
        Compressed="yes"
        InstallScope="perUser"
        Description="FlowOutlook"
        Manufacturer="Default Company"
        Languages="1033"
        SummaryCodepage="1252"
        InstallPrivileges="limited"
      /&gt;
  
      &lt;!--Added--&gt;
      &lt;Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" /&gt;
      &lt;Upgrade Id="faa8e62a-0834-4efa-aad3-b2f7903a3a6d"&gt;
        &lt;!--Should be same as "UpgradeCode"--&gt;
        &lt;UpgradeVersion
           Minimum="1.0.0" Maximum="1.1.4"
           Property="PREVIOUSVERSIONSINSTALLED"
           IncludeMinimum="yes" IncludeMaximum="no" /&gt;
      &lt;/Upgrade&gt;
  
      &lt;!--Romoved--&gt;
      &lt;!--&lt;MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /&gt;--&gt;
      &lt;Media Id="1" Cabinet="FlowOutlook.cab" EmbedCab="yes" /&gt;
  
      &lt;Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" /&gt;
  
      &lt;Feature Id="ProductFeature" Title="FlowOutlook" Level="1" ConfigurableDirectory="INSTALLFOLDER"&gt;
        &lt;ComponentRef Id="INSTALLFOLDER" /&gt;
        &lt;ComponentGroupRef Id="ProductComponents" /&gt;
        &lt;!--&lt;ComponentRef Id="Redemption.dll" /&gt;--&gt;
        &lt;!--Added--&gt;
      &lt;/Feature&gt;
  
      &lt;UIRef Id="WixUI_InstallDir" /&gt;
      &lt;UIRef Id="WixUI_ErrorProgressText" /&gt;
  
      &lt;!-- Pics--&gt;
      &lt;!-- Pics--&gt;
  
      &lt;Binary Id="adxregistrator_exe" SourceFile="$(var.ADX_PATH)\Redistributables\adxregistrator.exe" /&gt;
  
      &lt;CustomAction Id="RegisterApp" BinaryKey="adxregistrator_exe" Execute="deferred" ExeCommand='/install="[INSTALLFOLDER]$(var.FlowOutlook.TargetFileName)" /privileges=user /returnExitCode=false' Impersonate="yes" /&gt;
      &lt;CustomAction Id="RollbackApp" BinaryKey="adxregistrator_exe" Execute="rollback" ExeCommand='/uninstall="[INSTALLFOLDER]$(var.FlowOutlook.TargetFileName)" /privileges=user' Impersonate="yes" Return="ignore" /&gt;
      &lt;CustomAction Id="UnregisterApp" BinaryKey="adxregistrator_exe" Execute="deferred" ExeCommand='/uninstall="[INSTALLFOLDER]$(var.FlowOutlook.TargetFileName)" /privileges=user' Impersonate="yes" Return="ignore" /&gt;
  
      &lt;!--Added--&gt;
      &lt;CustomAction Id="RegisterRedemption32" Directory="INSTALLFOLDER" ExeCommand='regsvr32.exe "C:\ProgramData\Flow\Redemption.dll"'&gt;&lt;/CustomAction&gt;
      &lt;!--self registering Redemption 32-bit --&gt;
      &lt;CustomAction Id="UnregisterRedemption32" Directory="INSTALLFOLDER" ExeCommand='regsvr32.exe /u "C:\ProgramData\Flow\Redemption.dll"'&gt;&lt;/CustomAction&gt;
      &lt;!--self unregistering Redemption 32-bit --&gt;
      &lt;CustomAction Id="RegisterRedemption64" Directory="INSTALLFOLDER" ExeCommand='regsvr32.exe "C:\ProgramData\Flow\Redemption64.dll"'&gt;&lt;/CustomAction&gt;
      &lt;!--self registering Redemption 64-bit --&gt;
      &lt;CustomAction Id="UnregisterRedemption64" Directory="INSTALLFOLDER" ExeCommand='regsvr32.exe /u "C:\ProgramData\Flow\Redemption64.dll"'&gt;&lt;/CustomAction&gt;
      &lt;!--self unregistering Redemption 64-bit --&gt;
  
      &lt;!--Added--&gt;
  
      &lt;InstallExecuteSequence&gt;
        &lt;Custom Action="RegisterApp" After="StartServices"&gt;&lt;![CDATA[$ProductComponent&gt;2]]&gt;&lt;/Custom&gt;
        &lt;Custom Action="RollbackApp" After="RegisterApp"&gt;&lt;![CDATA[$ProductComponent&gt;2]]&gt;&lt;/Custom&gt;
        &lt;Custom Action="UnregisterApp" After="MsiUnpublishAssemblies"&gt;&lt;![CDATA[$ProductComponent=2]]&gt;&lt;/Custom&gt;
        &lt;!--Added--&gt;
        &lt;RemoveExistingProducts Before="InstallInitialize" /&gt;
        &lt;Custom Action="RegisterRedemption32" After="InstallFinalize"&gt;NOT Installed&lt;/Custom&gt;
        &lt;!--self registering Redemption 32-bit--&gt;
        &lt;Custom Action="UnregisterRedemption32" After="InstallFinalize"&gt;REMOVE="ALL"&lt;/Custom&gt;
        &lt;!--self unregistering Redemption 32-bit--&gt;
        &lt;Custom Action="RegisterRedemption64" After="InstallFinalize"&gt;NOT Installed&lt;/Custom&gt;
        &lt;!--self registering Redemption 64-bit--&gt;
        &lt;Custom Action="UnregisterRedemption64" After="InstallFinalize"&gt;REMOVE="ALL"&lt;/Custom&gt;
        &lt;!--self unregistering Redemption 64-bit--&gt;
        &lt;!--Added--&gt;
      &lt;/InstallExecuteSequence&gt;
  
      &lt;!-- Properties for all current versions of the .NET Framework are available here: http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htm --&gt;
      &lt;PropertyRef Id="NETFRAMEWORK40CLIENT"/&gt;
      &lt;Condition Message="This application requires .NET Framework 4.0. Please install the .NET Framework then run this installer again."&gt;
        &lt;![CDATA[Installed OR NETFRAMEWORK40CLIENT]]&gt;
      &lt;/Condition&gt;
    &lt;/Product&gt;
  
    &lt;Fragment&gt;
      &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
        &lt;Directory Id="AppDataFolder"&gt;
          &lt;Directory Id="INSTALLFOLDER" Name="FlowOutlook" &gt;
            &lt;Component Id="INSTALLFOLDER" Guid="cdca45fb-ce6c-4a00-9865-29b24123c62a"&gt;
              &lt;RemoveFolder On="both" Id="INSTALLFOLDER"/&gt;
              &lt;RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="FlowOutlook" /&gt;
            &lt;/Component&gt;
          &lt;/Directory&gt;
        &lt;/Directory&gt;
      &lt;/Directory&gt;
    &lt;/Fragment&gt;
  
    &lt;Fragment&gt;
      &lt;Directory Id="TARGETDIR2" Name="SourceDir2"&gt;
        &lt;Directory Id="ProgramFilesFolder"&gt;
          &lt;Directory Id="APPLICATIONROOTDIRECTORY" Name="Flow"/&gt;
        &lt;/Directory&gt;
      &lt;/Directory&gt;
    &lt;/Fragment&gt;
  
    &lt;Fragment&gt;
      &lt;ComponentGroup Id="ProductComponents" &gt;
        &lt;Component Id="ProductComponent" Guid="2596359b-ed35-42f1-be52-2ff4625189f5" DiskId="1" Directory="INSTALLFOLDER" &gt;
          &lt;RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]"&gt;
            &lt;RegistryValue Type="string" Name="Installed" Value="[INSTALLFOLDER]" KeyPath="yes" /&gt;
          &lt;/RegistryKey&gt;
          &lt;File Id="_$(var.FlowOutlook.TargetName)_dll" Name="$(var.FlowOutlook.TargetFileName)" Source="$(var.FlowOutlook.TargetPath)" /&gt;
          &lt;File Id="_adxloader_dll_manifest" Name="adxloader.dll.manifest" Source="$(var.FlowOutlook.ProjectDir)Loader\" /&gt;
          &lt;File Id="_adxloader_dll" Name="adxloader.dll" Source="$(var.FlowOutlook.ProjectDir)Loader\"  /&gt;
          &lt;File Id="_adxloader64_dll" Name="adxloader64.dll" Source="$(var.FlowOutlook.ProjectDir)Loader\" /&gt;
          &lt;File Id="_AddinExpress_MSO_2005_dll" Name="AddinExpress.MSO.2005.dll" Source="C:\Program Files (x86)\Add-in Express\Add-in Express for .NET\Bin\" /&gt;
          &lt;File Id="_AddinExpress_OL_2005_dll" Name="AddinExpress.OL.2005.dll" Source="C:\Program Files (x86)\Add-in Express\Add-in Express for .NET\Bin\" /&gt;
  
          &lt;File Id="_Newtonsoft_Json_dll" Name="Newtonsoft.Json.dll" Source="$(var.FlowOutlook.TargetDir)" /&gt;
          &lt;File Id="_Microsoft_Vbe_Interop_dll" Name="Microsoft.Vbe.Interop.dll" Source="$(var.FlowOutlook.TargetDir)" /&gt;
          &lt;File Id="_Newtonsoft_Json_pdb" Name="Newtonsoft.Json.pdb" Source="$(var.FlowOutlook.TargetDir)" /&gt;
          &lt;File Id="_Newtonsoft_Json_xml" Name="Newtonsoft.Json.xml" Source="$(var.FlowOutlook.TargetDir)" /&gt;
          &lt;File Id="_Redemption_dll" Name="Redemption.dll" Source="$(var.FlowOutlook.TargetDir2)" /&gt;
          &lt;File Id="_Newtonsoft_Json_xml" Name="Redemption64.dll" Source="$(var.FlowOutlook.TargetDir2)" /&gt;
  
        &lt;/Component&gt;
      &lt;/ComponentGroup&gt;
    &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>
  
  <p>Thanks for helping. Kushan Randima</p>