aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-07-19 01:21:08 -0700
committerRob Mensching <rob@firegiant.com>2020-07-19 01:23:53 -0700
commit80304ddaf48d843e9d6971d2e44f84bb096d494b (patch)
treec4c2758095ea9d60b6948701da1cbfb5285f32f2
parent7052dbba84e0815e75b3d85b4ffe05e0260304ab (diff)
downloadwix-80304ddaf48d843e9d6971d2e44f84bb096d494b.tar.gz
wix-80304ddaf48d843e9d6971d2e44f84bb096d494b.tar.bz2
wix-80304ddaf48d843e9d6971d2e44f84bb096d494b.zip
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.
Diffstat (limited to '')
-rw-r--r--src/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs8
1 files changed, 7 insertions, 1 deletions
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
18 18
19 private static readonly Version CurrentVersion = new Version("4.0.0.0"); 19 private static readonly Version CurrentVersion = new Version("4.0.0.0");
20 private const string WixOutputStreamName = "wix-wid.xml"; 20 private const string WixOutputStreamName = "wix-wid.xml";
21 private static readonly XmlWriterSettings WriterSettings = new XmlWriterSettings
22 {
23 CheckCharacters = false,
24 CloseOutput = false,
25 OmitXmlDeclaration = true,
26 };
21 27
22 /// <summary> 28 /// <summary>
23 /// Creates a new empty output object. 29 /// Creates a new empty output object.
@@ -83,7 +89,7 @@ namespace WixToolset.Data.WindowsInstaller
83 /// <param name="wixout">Container to save to.</param> 89 /// <param name="wixout">Container to save to.</param>
84 public void Save(WixOutput wixout) 90 public void Save(WixOutput wixout)
85 { 91 {
86 using (var writer = XmlWriter.Create(wixout.CreateDataStream(WixOutputStreamName))) 92 using (var writer = XmlWriter.Create(wixout.CreateDataStream(WixOutputStreamName), WriterSettings))
87 { 93 {
88 this.Save(writer); 94 this.Save(writer);
89 } 95 }