Search code examples
c#.netwixsetup-deployment

Wix The directory MyAppFolder is in the user profile but is not listed in the RemoveFile table


I am trying to create a user's application data folder where i will have some installation log files and other files. These files will not be removed on uninstall. I have tried to add it in wix xml AppDataFolder

But on build i am getting build error "The directory MyAppFolder is in the user profile but is not listed in the RemoveFile table."

 <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="PosWixSetup">
          <Directory Id="Images" Name="Images" />
          <Directory Id="_x64" Name="x64" />
          <Directory Id="_x86" Name="x86" />
          <Directory Id="en_US" Name="en-US" />
          <Directory Id="dlls" Name="dlls" />
        </Directory>
      </Directory>
      <Directory Id="AppDataFolder">
        <Directory Id="MyAppFolder" Name="Kamran"  >
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

Can somebody help what wrong i am doing


Solution

  • Following xml did the job for me

    <Directory Id='AppDataFolder' Name='Roaming'>
            <Directory Id='_8F59BFDE_678A_D04A_B032_C90D66940878' Name='Kamran'>
              <Component Id='com_dir_8F59BFDE_678A_D04A_B032_C90D66940878' Guid='EECDB3BC-65C4-4A73-A182-2976A649713E' Transitive='no'>
                <CreateFolder Directory='_8F59BFDE_678A_D04A_B032_C90D66940878' />
                <RemoveFolder Id='_F53B4A9B_E7AA_4C30_A42F_DDF464B4A795' On='uninstall' />
                <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]\Installer' Name='com_dir_8F59BFDE_678A_D04A_B032_C90D66940878' Type='string' Value='Kamran POS directory' KeyPath='yes' />
              </Component>
              <Component Id='com_B81229DC_FAC4_654D_B049_EC75EA79F23E' Guid='55A50D8C-2310-45A4-B8BF-54597EEE5B12' Permanent='no' SharedDllRefCount='no' Transitive='no'>
                <File Id='_B81229DC_FAC4_654D_B049_EC75EA79F23E' DiskId='1' Hidden='no' ReadOnly='no' System='no' Vital='yes' Compressed='yes' Name='config.ini' Source='..\PosControlApplication\config.ini' KeyPath='no' />
                <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]\Installer' Name='com_B81229DC_FAC4_654D_B049_EC75EA79F23E' Type='string' Value='config.ini file' KeyPath='yes' />
              </Component>
            </Directory>
          </Directory>