10

Can I create a component with Wix that has files in different directories/subdirectories? Or all the files of a component should be in the same directory?

How do I set the XML for that?

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
Nestor
  • 13,706
  • 11
  • 78
  • 119
  • I was searching for this and came across this question. What I didn't realize is that what I wanted was not a component with files in multiple directories, but a feature which has files in different directories. So create a component for each file, and in the feature, reference the different components. – Carlos Campderrós Oct 02 '13 at 08:50

1 Answers1

9

No.

See the Windows Installer documentation on Components... one of the main rules is that Each component must be stored in a single folder.

Component rules are very easy to violate, the best solution is to stick to one file per component if there is any chance at all any of the files will change in a later version.

Putting multiple files into a component can cause headaches down the line, avoid it if possible unless you have a valid reason - and having easier to maintain WiX sources isn't a valid reason :)

saschabeaumont
  • 22,080
  • 4
  • 63
  • 85
  • 4
    I feel like "having easier to maintain WiX sources" really ought to line up with what is considered Best Practices. – thepaulpage Sep 15 '15 at 18:52