@joebigelow / wix / commits / 9eeaf6cc

Read WindowsInstallerData at same XML conformance as writing

Rob Mensching committed Jan 4, 2022 at 17:21 UTC 9eeaf6cc7d32ddd1a45b824558ecbb89f466308a
4 files changed +50 -1
src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs
+5 -1
@@ -18,6 +18,10 @@ namespace WixToolset.Data.WindowsInstaller
18
19 private static readonly Version CurrentVersion = new Version("4.0.0.0");
20 private const string WixOutputStreamName = "wix-wid.xml";
21 + private static readonly XmlReaderSettings ReaderSettings = new XmlReaderSettings
22 + {
23 + CheckCharacters = false
24 + };
25 private static readonly XmlWriterSettings WriterSettings = new XmlWriterSettings
26 {
27 CheckCharacters = false,
@@ -159,7 +163,7 @@ namespace WixToolset.Data.WindowsInstaller
163 public static WindowsInstallerData Load(WixOutput wixOutput, TableDefinitionCollection tableDefinitions, bool suppressVersionCheck = false)
164 {
165 using (var stream = wixOutput.GetDataStream(WixOutputStreamName))
162 - using (var reader = XmlReader.Create(stream, null, wixOutput.Uri.AbsoluteUri))
166 + using (var reader = XmlReader.Create(stream, ReaderSettings, wixOutput.Uri.AbsoluteUri))
167 {
168 try
169 {
src/api/wix/api_wix.v3.ncrunchsolution new
+6
@@ -0,0 +1,6 @@
1 +<SolutionConfiguration>
2 + <Settings>
3 + <AllowParallelTestExecution>True</AllowParallelTestExecution>
4 + <SolutionConfigured>True</SolutionConfigured>
5 + </Settings>
6 +</SolutionConfiguration>
\ No newline at end of file
src/ext/UI/UI.wixext.v3.ncrunchsolution new
+6
@@ -0,0 +1,6 @@
1 +<SolutionConfiguration>
2 + <Settings>
3 + <AllowParallelTestExecution>True</AllowParallelTestExecution>
4 + <SolutionConfigured>True</SolutionConfigured>
5 + </Settings>
6 +</SolutionConfiguration>
\ No newline at end of file
src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs
+33
@@ -2,9 +2,14 @@
2
3 namespace WixToolsetTest.UI
4 {
5 + using System;
6 + using System.IO;
7 using System.Linq;
8 using WixBuildTools.TestSupport;
9 using WixToolset.Core.TestPackage;
10 + using WixToolset.Data;
11 + using WixToolset.Data.Symbols;
12 + using WixToolset.Data.WindowsInstaller;
13 using WixToolset.UI;
14 using Xunit;
15
@@ -66,6 +71,34 @@ namespace WixToolsetTest.UI
71 }, results.Where(s => s.StartsWith("Property:WixUI_Mode")).ToArray());
72 }
73
74 + [Fact]
75 + public void CanBuildUsingWixUIMinimalAndReadPdb()
76 + {
77 + var folder = TestData.Get(@"TestData\WixUI_Minimal");
78 + var bindFolder = TestData.Get(@"TestData\data");
79 +
80 + using (var fs = new DisposableFileSystem())
81 + {
82 + var intermediateFolder = fs.GetFolder();
83 +
84 + Build(new[]
85 + {
86 + "build",
87 + Path.Combine(folder, "Package.wxs"),
88 + "-ext", Path.GetFullPath(new Uri(typeof(UIExtensionFactory).Assembly.CodeBase).LocalPath),
89 + "-bindpath", bindFolder,
90 + "-intermediateFolder", intermediateFolder,
91 + "-o", Path.Combine(intermediateFolder, @"bin\test.msi")
92 + });
93 +
94 + var wid = WindowsInstallerData.Load(Path.Combine(intermediateFolder, @"bin\test.wixpdb"));
95 + var propertyTable = wid.Tables["Property"];
96 +
97 + var propertyRow = propertyTable.Rows.Single(r => r.GetPrimaryKey() == "WixUI_Mode");
98 + WixAssert.StringEqual("Minimal", propertyRow.FieldAsString(1));
99 + }
100 + }
101 +
102 [Fact]
103 public void CanBuildUsingWixUIMondo()
104 {