WiX Includes vs Fragments

2019-03-14 06:42发布

  • 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?

标签: wix wix3
3条回答
Animai°情兽
2楼-- · 2019-03-14 07:18

One thing to be aware of is that adding a wxs file to your project implies that MSBuild will do an incremental build when you update the wxs file. Including a wxi file does not do this.

But on the other hand, MSBuild is not doing automatic builds when any of the files you're including into your msi have been updated, so you're probably not doing incremental builds anyway.

查看更多
Juvenile、少年°
3楼-- · 2019-03-14 07:33

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.

查看更多
Fickle 薄情
4楼-- · 2019-03-14 07:40

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.

查看更多
登录 后发表回答