oleg-shilo / wixsharp

Framework for building a complete MSI or WiX source code by using script files written with C# syntax.
MIT License
1.12k stars 175 forks source link

Avoid unnecessary *Ref element for Fragment definitions. #1653

Open oleg-shilo opened 1 month ago

oleg-shilo commented 1 month ago

Discussed in https://github.com/oleg-shilo/wixsharp/discussions/1639

Originally posted by **Lindsay-Mathieson** September 15, 2024 Have the main installer sorted - does my desktop app and service ...

The discussion helped to identify the issue with the XML root Fragment elements (e.g. DotNetCompatibilityCheck) failing because of the unconditional *Ref element being inserted in the XML doc while it's only required for the non-root elements.

In the future even more explicit control might be required over project.AddWixFragment(...) but until the need is detected/confirmed a simple conditional auto-insert for *Ref is sufficient.