1

How do use multiple files inside of the component in WiX?

<DirectoryRef Id='v5.0' >
   <Component Id='V5.0Ref' Guid='7c9e6679-83F1-4F22-985B-FDB3C8ABD471'>
     <File Id='SimpleMvvmToolkitCommon.dll' Name='SimpleMvvmToolkit-Common.dll' DiskId='1' Source='Source\Binaries\Silverlight\v5.0\SimpleMvvmToolkit-Common.dll' KeyPath='yes'>
     </File>        
   </Component>
 </DirectoryRef>

I am getting an issue when I add more than on file inside of the component.

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130
Smaug
  • 2,625
  • 5
  • 28
  • 44

1 Answers1

2

Adding multiple files to a Component is just a matter of adding child File elements. For example the following adds a file.txt to the same Component from the same source location:

<DirectoryRef Id='v5.0' >
  <Component Id='V5.0Ref' Guid='7c9e6679-83F1-4F22-985B-FDB3C8ABD471'>
    <File Id='SimpleMvvmToolkitCommon.dll' Name='SimpleMvvmToolkit-Common.dll' DiskId='1' Source='Source\Binaries\Silverlight\v5.0\SimpleMvvmToolkit-Common.dll' KeyPath='yes' />
    <File Id='file2.txt' Name='file2.txt' DiskId='1' Source='Source\Binaries\Silverlight\v5.0\file2.txt' />
  </Component>
</DirectoryRef>

It is important to note that only one File element can be marked KeyPath='yes'.

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130