WiX v4 - supress root directory not working

50 views Asked by At

I've set the 'supress root directory' value to true in my harvest directory tag - this worked on wix v3 - however here it doesn't seem to work. Probably too long to include but looking at the generated file it also seems supress registry isnt working.

 <ItemGroup>
   <HarvestDirectory Include="C:\WorkspaceWix\Folder">
     <ComponentGroupName>FolderComponents</ComponentGroupName>
     <DirectoryRefId>INSTALLFOLDER</DirectoryRefId>
     <SupressRootDirectory>true</SupressRootDirectory>
     <SupressRegistry>true</SupressRegistry>
   </HarvestDirectory>
   <BindPath Include="C:\WorkspaceWix\Folder" />
 </ItemGroup>
  <Fragment>
      <Directory Id="APPLICATIONROOTDIRECTORY" ComponentGuidGenerationSeed='{guid}'>
          <Directory Id="INSTALLFOLDER" Name="MyInstaller">
              <!--Files install here-->
          </Directory>
      </Directory>
  </Fragment>

instead of C:/MyInstaller/'folder contents' - it comes out as C:/MyInstaller/Folder/folder contents'

any suggestion?

UPDATE - while this is a fix I'm not counting it as an answer: I manually went into the generated file and removed the directory tag. However, I'd still like some guidance on why the suppress root tag didn't work - to my understanding, when I build the solution these changes should be taken into account.

1

There are 1 answers

1
Viktor Spáčil On

You have misspelled the word suppress, you have got only one p in it. The same problem is also when you trying to suppress the registry. Correct form is as follows:

<ItemGroup>
   <HarvestDirectory Include="C:\WorkspaceWix\Folder">
     <ComponentGroupName>FolderComponents</ComponentGroupName>
     <DirectoryRefId>INSTALLFOLDER</DirectoryRefId>
     <SuppressRootDirectory>true</SuppressRootDirectory>
     <SuppressRegistry>true</SuppressRegistry>
   </HarvestDirectory>
   <BindPath Include="C:\WorkspaceWix\Folder" />
 </ItemGroup>

Everything works as expected.