Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX Includes vs Fragments

Tags:

wix

wix3

  • What's the difference between a WiX include (.wxi file) and a WiX fragment (.wxs file)?
  • What are the use cases for each?
  • Which should be used and why?
like image 973
alastairs Avatar asked Feb 24 '09 14:02

alastairs


People also ask

What are WiX fragments?

The Fragment element is the building block of creating an installer database in WiX. Once defined, the Fragment becomes an immutable, atomic unit which can either be completely included or excluded from a product.

What is a Wxi file?

File created by the WiX toolset, a Windows installer developing program; contains a top-level container element called, <Include>, which is the root element of the file; similar to header (. H) files used by C++ code. An example of the <Include> root file is below: <Include>


2 Answers

The file extension is a convenience, the content of the file is what really matters. The distinction makes it easier to manage the difference between the actual installation (wxs files) and the properties required to create the installation (wxi files).

For example, your wxs files specify the product and its contents (which files you install) whereas you would use your wxi files to specify product version, upgrade codes, common paths, etc.

The WiX documentation provides some clear information.

  • Include files (.wxi)
  • Source files (.wxs)
like image 189
Jeff Yates Avatar answered Sep 19 '22 13:09

Jeff Yates


Personally, I only use .wxi files to include common <?define?>s. I organize the rest of my product into many different logical groupings of Fragments. Treat Fragments like functions in your typical procedural language. Group like stuff together and don't make them too long.

like image 33
Rob Mensching Avatar answered Sep 19 '22 13:09

Rob Mensching