From 80304ddaf48d843e9d6971d2e44f84bb096d494b Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 19 Jul 2020 01:21:08 -0700 Subject: Fix persisting of WindowsInstallerData by minimizing compliance checks Support storing characters such as NULL that are technically invalid in XML text but can be escaped properly if settings are set just right. Also, skip the XML declaration that wastes space. --- src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs b/src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs index 67a074c6..cc16bca5 100644 --- a/src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs +++ b/src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs @@ -18,6 +18,12 @@ namespace WixToolset.Data.WindowsInstaller private static readonly Version CurrentVersion = new Version("4.0.0.0"); private const string WixOutputStreamName = "wix-wid.xml"; + private static readonly XmlWriterSettings WriterSettings = new XmlWriterSettings + { + CheckCharacters = false, + CloseOutput = false, + OmitXmlDeclaration = true, + }; /// /// Creates a new empty output object. @@ -83,7 +89,7 @@ namespace WixToolset.Data.WindowsInstaller /// Container to save to. public void Save(WixOutput wixout) { - using (var writer = XmlWriter.Create(wixout.CreateDataStream(WixOutputStreamName))) + using (var writer = XmlWriter.Create(wixout.CreateDataStream(WixOutputStreamName), WriterSettings)) { this.Save(writer); } -- cgit v1.2.3-55-g6feb