diff options
author | Rob Mensching <rob@firegiant.com> | 2022-01-04 17:21:30 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2022-01-04 17:57:45 -0800 |
commit | 9eeaf6cc7d32ddd1a45b824558ecbb89f466308a (patch) | |
tree | 09cccb5223b3a9580c8f7d034914fe4e26e51603 /src | |
parent | 1f5314302b3c8bc1977aed79df1d05c52608f382 (diff) | |
download | wix-9eeaf6cc7d32ddd1a45b824558ecbb89f466308a.tar.gz wix-9eeaf6cc7d32ddd1a45b824558ecbb89f466308a.tar.bz2 wix-9eeaf6cc7d32ddd1a45b824558ecbb89f466308a.zip |
Read WindowsInstallerData at same XML conformance as writing
Diffstat (limited to 'src')
4 files changed, 50 insertions, 1 deletions
diff --git a/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs b/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs index 8d69cd08..66d9a56f 100644 --- a/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs +++ b/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs | |||
@@ -18,6 +18,10 @@ 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 XmlReaderSettings ReaderSettings = new XmlReaderSettings | ||
22 | { | ||
23 | CheckCharacters = false | ||
24 | }; | ||
21 | private static readonly XmlWriterSettings WriterSettings = new XmlWriterSettings | 25 | private static readonly XmlWriterSettings WriterSettings = new XmlWriterSettings |
22 | { | 26 | { |
23 | CheckCharacters = false, | 27 | CheckCharacters = false, |
@@ -159,7 +163,7 @@ namespace WixToolset.Data.WindowsInstaller | |||
159 | public static WindowsInstallerData Load(WixOutput wixOutput, TableDefinitionCollection tableDefinitions, bool suppressVersionCheck = false) | 163 | public static WindowsInstallerData Load(WixOutput wixOutput, TableDefinitionCollection tableDefinitions, bool suppressVersionCheck = false) |
160 | { | 164 | { |
161 | using (var stream = wixOutput.GetDataStream(WixOutputStreamName)) | 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)) |
163 | { | 167 | { |
164 | try | 168 | try |
165 | { | 169 | { |
diff --git a/src/api/wix/api_wix.v3.ncrunchsolution b/src/api/wix/api_wix.v3.ncrunchsolution new file mode 100644 index 00000000..10420ac9 --- /dev/null +++ b/src/api/wix/api_wix.v3.ncrunchsolution | |||
@@ -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 | ||
diff --git a/src/ext/UI/UI.wixext.v3.ncrunchsolution b/src/ext/UI/UI.wixext.v3.ncrunchsolution new file mode 100644 index 00000000..10420ac9 --- /dev/null +++ b/src/ext/UI/UI.wixext.v3.ncrunchsolution | |||
@@ -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 | ||
diff --git a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs index ca36fed5..778bfb64 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs +++ b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs | |||
@@ -2,9 +2,14 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.UI | 3 | namespace WixToolsetTest.UI |
4 | { | 4 | { |
5 | using System; | ||
6 | using System.IO; | ||
5 | using System.Linq; | 7 | using System.Linq; |
6 | using WixBuildTools.TestSupport; | 8 | using WixBuildTools.TestSupport; |
7 | using WixToolset.Core.TestPackage; | 9 | using WixToolset.Core.TestPackage; |
10 | using WixToolset.Data; | ||
11 | using WixToolset.Data.Symbols; | ||
12 | using WixToolset.Data.WindowsInstaller; | ||
8 | using WixToolset.UI; | 13 | using WixToolset.UI; |
9 | using Xunit; | 14 | using Xunit; |
10 | 15 | ||
@@ -67,6 +72,34 @@ namespace WixToolsetTest.UI | |||
67 | } | 72 | } |
68 | 73 | ||
69 | [Fact] | 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] | ||
70 | public void CanBuildUsingWixUIMondo() | 103 | public void CanBuildUsingWixUIMondo() |
71 | { | 104 | { |
72 | var folder = TestData.Get(@"TestData\WixUI_Mondo"); | 105 | var folder = TestData.Get(@"TestData\WixUI_Mondo"); |