diff options
author | Rob Mensching <rob@firegiant.com> | 2023-03-09 03:43:57 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2023-03-09 06:17:00 -0700 |
commit | 3efe3f3a8682f333741b3c52e10eea2297f43dc9 (patch) | |
tree | c4935644e337175b44ba137e99265144444857bc | |
parent | 3bc1056b69b420de75ce571c102b3b24c8cab390 (diff) | |
download | wix-3efe3f3a8682f333741b3c52e10eea2297f43dc9.tar.gz wix-3efe3f3a8682f333741b3c52e10eea2297f43dc9.tar.bz2 wix-3efe3f3a8682f333741b3c52e10eea2297f43dc9.zip |
Prevent direct references to platform neutral WixUI
Fixes 7265
-rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/TestData/InvalidUIRef/Package.wxs | 23 | ||||
-rw-r--r-- | src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs | 68 | ||||
-rw-r--r-- | src/ext/UI/wixext/UICompiler.cs | 1 | ||||
-rw-r--r-- | src/ext/UI/wixlib/WixUI_Advanced.wxs | 26 | ||||
-rw-r--r-- | src/ext/UI/wixlib/WixUI_FeatureTree.wxs | 22 | ||||
-rw-r--r-- | src/ext/UI/wixlib/WixUI_InstallDir.wxs | 26 | ||||
-rw-r--r-- | src/ext/UI/wixlib/WixUI_Minimal.wxs | 22 | ||||
-rw-r--r-- | src/ext/UI/wixlib/WixUI_Mondo.wxs | 26 | ||||
-rw-r--r-- | src/ext/UI/wixlib/ui.v3.ncrunchproject | 5 | ||||
-rw-r--r-- | src/wix/WixToolset.Converters/WixConverter.cs | 2 | ||||
-rw-r--r-- | src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs | 37 | ||||
-rw-r--r-- | src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs | 82 |
12 files changed, 218 insertions, 122 deletions
diff --git a/src/ext/UI/test/WixToolsetTest.UI/TestData/InvalidUIRef/Package.wxs b/src/ext/UI/test/WixToolsetTest.UI/TestData/InvalidUIRef/Package.wxs new file mode 100644 index 00000000..3cf78b3a --- /dev/null +++ b/src/ext/UI/test/WixToolsetTest.UI/TestData/InvalidUIRef/Package.wxs | |||
@@ -0,0 +1,23 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> | ||
2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200"> | ||
3 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
4 | |||
5 | <Feature Id="ProductFeature" Title="MsiPackage"> | ||
6 | <ComponentGroupRef Id="ProductComponents" /> | ||
7 | </Feature> | ||
8 | |||
9 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
10 | <Component> | ||
11 | <File Source="example.txt" /> | ||
12 | </Component> | ||
13 | </ComponentGroup> | ||
14 | |||
15 | <UIRef Id="WixUI_Mondo" /> | ||
16 | </Package> | ||
17 | |||
18 | <Fragment> | ||
19 | <StandardDirectory Id="ProgramFilesFolder"> | ||
20 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
21 | </StandardDirectory> | ||
22 | </Fragment> | ||
23 | </Wix> | ||
diff --git a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs index e1f18be5..7f9b7313 100644 --- a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs +++ b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs | |||
@@ -2,11 +2,10 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.UI | 3 | namespace WixToolsetTest.UI |
4 | { | 4 | { |
5 | using System; | ||
6 | using System.IO; | 5 | using System.IO; |
7 | using System.Linq; | 6 | using System.Linq; |
8 | using WixInternal.TestSupport; | ||
9 | using WixInternal.Core.TestPackage; | 7 | using WixInternal.Core.TestPackage; |
8 | using WixInternal.TestSupport; | ||
10 | using WixToolset.Data.WindowsInstaller; | 9 | using WixToolset.Data.WindowsInstaller; |
11 | using WixToolset.UI; | 10 | using WixToolset.UI; |
12 | using Xunit; | 11 | using Xunit; |
@@ -16,8 +15,8 @@ namespace WixToolsetTest.UI | |||
16 | [Fact] | 15 | [Fact] |
17 | public void CanBuildUsingWixUIAdvanced() | 16 | public void CanBuildUsingWixUIAdvanced() |
18 | { | 17 | { |
19 | var folder = TestData.Get(@"TestData\WixUI_Advanced"); | 18 | var folder = TestData.Get(@"TestData", "WixUI_Advanced"); |
20 | var bindFolder = TestData.Get(@"TestData\data"); | 19 | var bindFolder = TestData.Get(@"TestData", "data"); |
21 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 20 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
22 | 21 | ||
23 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent"); | 22 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent"); |
@@ -52,8 +51,8 @@ namespace WixToolsetTest.UI | |||
52 | [Fact] | 51 | [Fact] |
53 | public void CanBuildUsingWixUIAdvancedX64() | 52 | public void CanBuildUsingWixUIAdvancedX64() |
54 | { | 53 | { |
55 | var folder = TestData.Get(@"TestData\WixUI_Advanced"); | 54 | var folder = TestData.Get(@"TestData", "WixUI_Advanced"); |
56 | var bindFolder = TestData.Get(@"TestData\data"); | 55 | var bindFolder = TestData.Get(@"TestData", "data"); |
57 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 56 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
58 | 57 | ||
59 | var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent"); | 58 | var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent"); |
@@ -88,8 +87,8 @@ namespace WixToolsetTest.UI | |||
88 | [Fact] | 87 | [Fact] |
89 | public void CanBuildUsingWixUIAdvancedARM64() | 88 | public void CanBuildUsingWixUIAdvancedARM64() |
90 | { | 89 | { |
91 | var folder = TestData.Get(@"TestData\WixUI_Advanced"); | 90 | var folder = TestData.Get(@"TestData", "WixUI_Advanced"); |
92 | var bindFolder = TestData.Get(@"TestData\data"); | 91 | var bindFolder = TestData.Get(@"TestData", "data"); |
93 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 92 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
94 | 93 | ||
95 | var results = build.BuildAndQuery(BuildARM64, "Binary", "Dialog", "CustomAction", "ControlEvent"); | 94 | var results = build.BuildAndQuery(BuildARM64, "Binary", "Dialog", "CustomAction", "ControlEvent"); |
@@ -124,8 +123,8 @@ namespace WixToolsetTest.UI | |||
124 | [Fact] | 123 | [Fact] |
125 | public void CanBuildUsingWixUIFeatureTree() | 124 | public void CanBuildUsingWixUIFeatureTree() |
126 | { | 125 | { |
127 | var folder = TestData.Get(@"TestData\WixUI_FeatureTree"); | 126 | var folder = TestData.Get(@"TestData", "WixUI_FeatureTree"); |
128 | var bindFolder = TestData.Get(@"TestData\data"); | 127 | var bindFolder = TestData.Get(@"TestData", "data"); |
129 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 128 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
130 | 129 | ||
131 | var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent"); | 130 | var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent"); |
@@ -155,8 +154,8 @@ namespace WixToolsetTest.UI | |||
155 | [Fact] | 154 | [Fact] |
156 | public void CanBuildUsingWixUIInstallDir() | 155 | public void CanBuildUsingWixUIInstallDir() |
157 | { | 156 | { |
158 | var folder = TestData.Get(@"TestData\WixUI_InstallDir"); | 157 | var folder = TestData.Get(@"TestData", "WixUI_InstallDir"); |
159 | var bindFolder = TestData.Get(@"TestData\data"); | 158 | var bindFolder = TestData.Get(@"TestData", "data"); |
160 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 159 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
161 | 160 | ||
162 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent"); | 161 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent"); |
@@ -191,8 +190,8 @@ namespace WixToolsetTest.UI | |||
191 | [Fact] | 190 | [Fact] |
192 | public void CanBuildUsingWixUIMinimal() | 191 | public void CanBuildUsingWixUIMinimal() |
193 | { | 192 | { |
194 | var folder = TestData.Get(@"TestData\WixUI_Minimal"); | 193 | var folder = TestData.Get(@"TestData", "WixUI_Minimal"); |
195 | var bindFolder = TestData.Get(@"TestData\data"); | 194 | var bindFolder = TestData.Get(@"TestData", "data"); |
196 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 195 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
197 | 196 | ||
198 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent"); | 197 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent"); |
@@ -220,8 +219,8 @@ namespace WixToolsetTest.UI | |||
220 | [Fact] | 219 | [Fact] |
221 | public void CanBuildUsingWixUIMinimalInKazakh() | 220 | public void CanBuildUsingWixUIMinimalInKazakh() |
222 | { | 221 | { |
223 | var folder = TestData.Get(@"TestData\WixUI_Minimal"); | 222 | var folder = TestData.Get(@"TestData", "WixUI_Minimal"); |
224 | var bindFolder = TestData.Get(@"TestData\data"); | 223 | var bindFolder = TestData.Get(@"TestData", "data"); |
225 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 224 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
226 | 225 | ||
227 | var results = build.BuildAndQuery(BuildInKazakh, "Dialog"); | 226 | var results = build.BuildAndQuery(BuildInKazakh, "Dialog"); |
@@ -232,8 +231,8 @@ namespace WixToolsetTest.UI | |||
232 | [Fact] | 231 | [Fact] |
233 | public void CanBuildUsingWixUIMinimalAndReadPdb() | 232 | public void CanBuildUsingWixUIMinimalAndReadPdb() |
234 | { | 233 | { |
235 | var folder = TestData.Get(@"TestData\WixUI_Minimal"); | 234 | var folder = TestData.Get(@"TestData", "WixUI_Minimal"); |
236 | var bindFolder = TestData.Get(@"TestData\data"); | 235 | var bindFolder = TestData.Get(@"TestData", "data"); |
237 | 236 | ||
238 | using (var fs = new DisposableFileSystem()) | 237 | using (var fs = new DisposableFileSystem()) |
239 | { | 238 | { |
@@ -258,8 +257,8 @@ namespace WixToolsetTest.UI | |||
258 | [Fact] | 257 | [Fact] |
259 | public void CanBuildUsingWixUIMondo() | 258 | public void CanBuildUsingWixUIMondo() |
260 | { | 259 | { |
261 | var folder = TestData.Get(@"TestData\WixUI_Mondo"); | 260 | var folder = TestData.Get(@"TestData", "WixUI_Mondo"); |
262 | var bindFolder = TestData.Get(@"TestData\data"); | 261 | var bindFolder = TestData.Get(@"TestData", "data"); |
263 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 262 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
264 | 263 | ||
265 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent"); | 264 | var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent"); |
@@ -292,8 +291,8 @@ namespace WixToolsetTest.UI | |||
292 | [Fact] | 291 | [Fact] |
293 | public void CanBuildUsingWixUIMondoLocalized() | 292 | public void CanBuildUsingWixUIMondoLocalized() |
294 | { | 293 | { |
295 | var folder = TestData.Get(@"TestData\WixUI_Mondo"); | 294 | var folder = TestData.Get(@"TestData", "WixUI_Mondo"); |
296 | var bindFolder = TestData.Get(@"TestData\data"); | 295 | var bindFolder = TestData.Get(@"TestData", "data"); |
297 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); | 296 | var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); |
298 | 297 | ||
299 | var results = build.BuildAndQuery(BuildInGerman, "Control"); | 298 | var results = build.BuildAndQuery(BuildInGerman, "Control"); |
@@ -303,6 +302,31 @@ namespace WixToolsetTest.UI | |||
303 | }, results.Where(s => s.StartsWith("Control:ErrorDlg\tY")).Select(s => s.Split('\t')[9]).ToArray()); | 302 | }, results.Where(s => s.StartsWith("Control:ErrorDlg\tY")).Select(s => s.Split('\t')[9]).ToArray()); |
304 | } | 303 | } |
305 | 304 | ||
305 | [Fact] | ||
306 | public void CannotBuildWithV3LikeUIRef() | ||
307 | { | ||
308 | var folder = TestData.Get(@"TestData", "InvalidUIRef"); | ||
309 | |||
310 | using (var fs = new DisposableFileSystem()) | ||
311 | { | ||
312 | var intermediateFolder = fs.GetFolder(); | ||
313 | var outputPath = Path.Combine(intermediateFolder, "bin", "test.msi"); | ||
314 | |||
315 | var args = new[] | ||
316 | { | ||
317 | "build", | ||
318 | Path.Combine(folder, "Package.wxs"), | ||
319 | "-ext", typeof(UIExtensionFactory).Assembly.Location, | ||
320 | "-intermediateFolder", intermediateFolder, | ||
321 | "-o", outputPath, | ||
322 | }; | ||
323 | |||
324 | var results = WixRunner.Execute(args); | ||
325 | var message = results.Messages.Single(); | ||
326 | Assert.Equal("The identifier 'WixUI:WixUI_Mondo' is inaccessible due to its protection level.", message.ToString()); | ||
327 | } | ||
328 | } | ||
329 | |||
306 | private static void Build(string[] args) | 330 | private static void Build(string[] args) |
307 | { | 331 | { |
308 | var result = WixRunner.Execute(args) | 332 | var result = WixRunner.Execute(args) |
diff --git a/src/ext/UI/wixext/UICompiler.cs b/src/ext/UI/wixext/UICompiler.cs index 8b527454..5f2751c9 100644 --- a/src/ext/UI/wixext/UICompiler.cs +++ b/src/ext/UI/wixext/UICompiler.cs | |||
@@ -87,7 +87,6 @@ namespace WixToolset.UI | |||
87 | else | 87 | else |
88 | { | 88 | { |
89 | var platform = this.Context.Platform == Platform.ARM64 ? "A64" : this.Context.Platform.ToString(); | 89 | var platform = this.Context.Platform == Platform.ARM64 ? "A64" : this.Context.Platform.ToString(); |
90 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixUI, id); | ||
91 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixUI, $"{id}_{platform}"); | 90 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixUI, $"{id}_{platform}"); |
92 | 91 | ||
93 | if (installDirectory != null) | 92 | if (installDirectory != null) |
diff --git a/src/ext/UI/wixlib/WixUI_Advanced.wxs b/src/ext/UI/wixlib/WixUI_Advanced.wxs index 1aabbf96..bab05ec9 100644 --- a/src/ext/UI/wixlib/WixUI_Advanced.wxs +++ b/src/ext/UI/wixlib/WixUI_Advanced.wxs | |||
@@ -1,7 +1,5 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
2 | 2 | ||
3 | |||
4 | |||
5 | <!-- | 3 | <!-- |
6 | WixUI_Advanced offers a two-click install (EULA checkbox and Install button) | 4 | WixUI_Advanced offers a two-click install (EULA checkbox and Install button) |
7 | and offers an Advanced button that lets users choose per-machine or per-user | 5 | and offers an Advanced button that lets users choose per-machine or per-user |
@@ -22,6 +20,18 @@ Todo: | |||
22 | --> | 20 | --> |
23 | 21 | ||
24 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 22 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
23 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
24 | <Fragment> | ||
25 | <UI Id="WixUI_Advanced_$(WIXUIARCH)"> | ||
26 | <Publish Dialog="AdvancedWelcomeEulaDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
27 | <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="1" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
28 | <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
29 | </UI> | ||
30 | |||
31 | <UIRef Id="WixUI_Advanced" /> | ||
32 | </Fragment> | ||
33 | <?endforeach?> | ||
34 | |||
25 | <Fragment> | 35 | <Fragment> |
26 | <WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes" /> | 36 | <WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes" /> |
27 | <WixVariable Id="WixUISupportPerMachine" Value="1" Overridable="yes" /> | 37 | <WixVariable Id="WixUISupportPerMachine" Value="1" Overridable="yes" /> |
@@ -46,7 +56,7 @@ Todo: | |||
46 | <Custom Action="WixSetPerMachineFolder" After="WixSetPerUserFolder" Condition="ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))" /> | 56 | <Custom Action="WixSetPerMachineFolder" After="WixSetPerUserFolder" Condition="ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))" /> |
47 | </InstallUISequence> | 57 | </InstallUISequence> |
48 | 58 | ||
49 | <UI Id="WixUI_Advanced"> | 59 | <UI Id="file WixUI_Advanced"> |
50 | <TextStyle Id="WixUI_Font_Normal" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Normal_Size)" /> | 60 | <TextStyle Id="WixUI_Font_Normal" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Normal_Size)" /> |
51 | <TextStyle Id="WixUI_Font_Bigger" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Bigger_Size)" /> | 61 | <TextStyle Id="WixUI_Font_Bigger" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Bigger_Size)" /> |
52 | <TextStyle Id="WixUI_Font_Title" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Title_Size)" Bold="yes" /> | 62 | <TextStyle Id="WixUI_Font_Title" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Title_Size)" Bold="yes" /> |
@@ -115,14 +125,4 @@ Todo: | |||
115 | <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" /> | 125 | <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" /> |
116 | <UIRef Id="WixUI_Common" /> | 126 | <UIRef Id="WixUI_Common" /> |
117 | </Fragment> | 127 | </Fragment> |
118 | |||
119 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
120 | <Fragment> | ||
121 | <UI Id="WixUI_Advanced_$(WIXUIARCH)"> | ||
122 | <Publish Dialog="AdvancedWelcomeEulaDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
123 | <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="1" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
124 | <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
125 | </UI> | ||
126 | </Fragment> | ||
127 | <?endforeach?> | ||
128 | </Wix> | 128 | </Wix> |
diff --git a/src/ext/UI/wixlib/WixUI_FeatureTree.wxs b/src/ext/UI/wixlib/WixUI_FeatureTree.wxs index e50839d3..6b9b1cf3 100644 --- a/src/ext/UI/wixlib/WixUI_FeatureTree.wxs +++ b/src/ext/UI/wixlib/WixUI_FeatureTree.wxs | |||
@@ -1,7 +1,5 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
2 | 2 | ||
3 | |||
4 | |||
5 | <!-- | 3 | <!-- |
6 | First-time install dialog sequence: | 4 | First-time install dialog sequence: |
7 | - WixUI_WelcomeDlg | 5 | - WixUI_WelcomeDlg |
@@ -22,8 +20,18 @@ Patch dialog sequence: | |||
22 | --> | 20 | --> |
23 | 21 | ||
24 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 22 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
23 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
25 | <Fragment> | 24 | <Fragment> |
26 | <UI Id="WixUI_FeatureTree"> | 25 | <UI Id="WixUI_FeatureTree_$(WIXUIARCH)"> |
26 | <Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
27 | </UI> | ||
28 | |||
29 | <UIRef Id="WixUI_FeatureTree" /> | ||
30 | </Fragment> | ||
31 | <?endforeach?> | ||
32 | |||
33 | <Fragment> | ||
34 | <UI Id="file WixUI_FeatureTree"> | ||
27 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> | 35 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> |
28 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> | 36 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> |
29 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> | 37 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> |
@@ -65,12 +73,4 @@ Patch dialog sequence: | |||
65 | 73 | ||
66 | <UIRef Id="WixUI_Common" /> | 74 | <UIRef Id="WixUI_Common" /> |
67 | </Fragment> | 75 | </Fragment> |
68 | |||
69 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
70 | <Fragment> | ||
71 | <UI Id="WixUI_FeatureTree_$(WIXUIARCH)"> | ||
72 | <Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
73 | </UI> | ||
74 | </Fragment> | ||
75 | <?endforeach?> | ||
76 | </Wix> | 76 | </Wix> |
diff --git a/src/ext/UI/wixlib/WixUI_InstallDir.wxs b/src/ext/UI/wixlib/WixUI_InstallDir.wxs index 10b32ce8..e3c171df 100644 --- a/src/ext/UI/wixlib/WixUI_InstallDir.wxs +++ b/src/ext/UI/wixlib/WixUI_InstallDir.wxs | |||
@@ -1,7 +1,5 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
2 | 2 | ||
3 | |||
4 | |||
5 | <!-- | 3 | <!-- |
6 | First-time install dialog sequence: | 4 | First-time install dialog sequence: |
7 | - WixUI_WelcomeDlg | 5 | - WixUI_WelcomeDlg |
@@ -23,8 +21,20 @@ Patch dialog sequence: | |||
23 | --> | 21 | --> |
24 | 22 | ||
25 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 23 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
24 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
26 | <Fragment> | 25 | <Fragment> |
27 | <UI Id="WixUI_InstallDir"> | 26 | <UI Id="WixUI_InstallDir_$(WIXUIARCH)"> |
27 | <Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
28 | <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
29 | <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
30 | </UI> | ||
31 | |||
32 | <UIRef Id="WixUI_InstallDir" /> | ||
33 | </Fragment> | ||
34 | <?endforeach?> | ||
35 | |||
36 | <Fragment> | ||
37 | <UI Id="file WixUI_InstallDir"> | ||
28 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> | 38 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> |
29 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> | 39 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> |
30 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> | 40 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> |
@@ -72,14 +82,4 @@ Patch dialog sequence: | |||
72 | 82 | ||
73 | <UIRef Id="WixUI_Common" /> | 83 | <UIRef Id="WixUI_Common" /> |
74 | </Fragment> | 84 | </Fragment> |
75 | |||
76 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
77 | <Fragment> | ||
78 | <UI Id="WixUI_InstallDir_$(WIXUIARCH)"> | ||
79 | <Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
80 | <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
81 | <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
82 | </UI> | ||
83 | </Fragment> | ||
84 | <?endforeach?> | ||
85 | </Wix> | 85 | </Wix> |
diff --git a/src/ext/UI/wixlib/WixUI_Minimal.wxs b/src/ext/UI/wixlib/WixUI_Minimal.wxs index 6d1709c5..0c69d8f8 100644 --- a/src/ext/UI/wixlib/WixUI_Minimal.wxs +++ b/src/ext/UI/wixlib/WixUI_Minimal.wxs | |||
@@ -1,7 +1,5 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
2 | 2 | ||
3 | |||
4 | |||
5 | <!-- | 3 | <!-- |
6 | First-time install dialog sequence: | 4 | First-time install dialog sequence: |
7 | - WixUI_WelcomeEulaDlg | 5 | - WixUI_WelcomeEulaDlg |
@@ -17,8 +15,18 @@ Patch dialog sequence: | |||
17 | --> | 15 | --> |
18 | 16 | ||
19 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 17 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
18 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
20 | <Fragment> | 19 | <Fragment> |
21 | <UI Id="WixUI_Minimal"> | 20 | <UI Id="WixUI_Minimal_$(WIXUIARCH)"> |
21 | <Publish Dialog="WelcomeEulaDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
22 | </UI> | ||
23 | |||
24 | <UIRef Id="WixUI_Minimal" /> | ||
25 | </Fragment> | ||
26 | <?endforeach?> | ||
27 | |||
28 | <Fragment> | ||
29 | <UI Id="file WixUI_Minimal"> | ||
22 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> | 30 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> |
23 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> | 31 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> |
24 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> | 32 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> |
@@ -59,12 +67,4 @@ Patch dialog sequence: | |||
59 | 67 | ||
60 | <UIRef Id="WixUI_Common" /> | 68 | <UIRef Id="WixUI_Common" /> |
61 | </Fragment> | 69 | </Fragment> |
62 | |||
63 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
64 | <Fragment> | ||
65 | <UI Id="WixUI_Minimal_$(WIXUIARCH)"> | ||
66 | <Publish Dialog="WelcomeEulaDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
67 | </UI> | ||
68 | </Fragment> | ||
69 | <?endforeach?> | ||
70 | </Wix> | 70 | </Wix> |
diff --git a/src/ext/UI/wixlib/WixUI_Mondo.wxs b/src/ext/UI/wixlib/WixUI_Mondo.wxs index 92890572..2f883b8b 100644 --- a/src/ext/UI/wixlib/WixUI_Mondo.wxs +++ b/src/ext/UI/wixlib/WixUI_Mondo.wxs | |||
@@ -1,7 +1,5 @@ | |||
1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
2 | 2 | ||
3 | |||
4 | |||
5 | <!-- | 3 | <!-- |
6 | First-time install dialog sequence: | 4 | First-time install dialog sequence: |
7 | - WixUI_WelcomeDlg | 5 | - WixUI_WelcomeDlg |
@@ -24,8 +22,20 @@ Patch dialog sequence: | |||
24 | --> | 22 | --> |
25 | 23 | ||
26 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 24 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
25 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
27 | <Fragment> | 26 | <Fragment> |
28 | <UI Id="WixUI_Mondo"> | 27 | <UI Id="WixUI_Mondo_$(WIXUIARCH)"> |
28 | <Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
29 | <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
30 | <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
31 | </UI> | ||
32 | |||
33 | <UIRef Id="WixUI_Mondo" /> | ||
34 | </Fragment> | ||
35 | <?endforeach?> | ||
36 | |||
37 | <Fragment> | ||
38 | <UI Id="file WixUI_Mondo"> | ||
29 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> | 39 | <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> |
30 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> | 40 | <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> |
31 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> | 41 | <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> |
@@ -74,14 +84,4 @@ Patch dialog sequence: | |||
74 | 84 | ||
75 | <UIRef Id="WixUI_Common" /> | 85 | <UIRef Id="WixUI_Common" /> |
76 | </Fragment> | 86 | </Fragment> |
77 | |||
78 | <?foreach WIXUIARCH in X86;X64;A64 ?> | ||
79 | <Fragment> | ||
80 | <UI Id="WixUI_Mondo_$(WIXUIARCH)"> | ||
81 | <Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" /> | ||
82 | <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
83 | <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" /> | ||
84 | </UI> | ||
85 | </Fragment> | ||
86 | <?endforeach?> | ||
87 | </Wix> | 87 | </Wix> |
diff --git a/src/ext/UI/wixlib/ui.v3.ncrunchproject b/src/ext/UI/wixlib/ui.v3.ncrunchproject new file mode 100644 index 00000000..319cd523 --- /dev/null +++ b/src/ext/UI/wixlib/ui.v3.ncrunchproject | |||
@@ -0,0 +1,5 @@ | |||
1 | <ProjectConfiguration> | ||
2 | <Settings> | ||
3 | <IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely> | ||
4 | </Settings> | ||
5 | </ProjectConfiguration> \ No newline at end of file | ||
diff --git a/src/wix/WixToolset.Converters/WixConverter.cs b/src/wix/WixToolset.Converters/WixConverter.cs index 86664a9f..93e1692d 100644 --- a/src/wix/WixToolset.Converters/WixConverter.cs +++ b/src/wix/WixToolset.Converters/WixConverter.cs | |||
@@ -1687,7 +1687,7 @@ namespace WixToolset.Converters | |||
1687 | && value?.StartsWith("WixUI", StringComparison.OrdinalIgnoreCase) == true | 1687 | && value?.StartsWith("WixUI", StringComparison.OrdinalIgnoreCase) == true |
1688 | && this.OnInformation(ConverterTestType.CustomActionIdsIncludePlatformSuffix, element, "Custom action ids have changed in WiX v4 extensions to support platform-specific custom actions. For more information, see https://wixtoolset.org/docs/fourthree/#converting-custom-wixui-dialog-sets.")) | 1688 | && this.OnInformation(ConverterTestType.CustomActionIdsIncludePlatformSuffix, element, "Custom action ids have changed in WiX v4 extensions to support platform-specific custom actions. For more information, see https://wixtoolset.org/docs/fourthree/#converting-custom-wixui-dialog-sets.")) |
1689 | { | 1689 | { |
1690 | // Just warn. | 1690 | element.Attribute("Value").Value = value + "_$(sys.BUILDARCHSHORT)"; |
1691 | } | 1691 | } |
1692 | } | 1692 | } |
1693 | 1693 | ||
diff --git a/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs b/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs index 736229da..1705a1ed 100644 --- a/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/ConverterFixture.cs | |||
@@ -542,42 +542,5 @@ namespace WixToolsetTest.Converters | |||
542 | Assert.Equal(2, errors); | 542 | Assert.Equal(2, errors); |
543 | WixAssert.CompareLineByLine(expected, actual); | 543 | WixAssert.CompareLineByLine(expected, actual); |
544 | } | 544 | } |
545 | |||
546 | [Fact] | ||
547 | public void WarnsOnWixUIDoActionControlEvents() | ||
548 | { | ||
549 | var parse = String.Join(Environment.NewLine, | ||
550 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
551 | " <Fragment>", | ||
552 | " <UI Id='WixUI_Test'>", | ||
553 | " <Publish Dialog='BrowseDlg' Control='OK' Event='DoAction' Value='WixUIValidatePath' Order='3' />", | ||
554 | " </UI>", | ||
555 | " </Fragment>", | ||
556 | "</Wix>"); | ||
557 | |||
558 | var expected = new[] | ||
559 | { | ||
560 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
561 | " <Fragment>", | ||
562 | " <UI Id=\"WixUI_Test\">", | ||
563 | " <Publish Dialog=\"BrowseDlg\" Control=\"OK\" Event=\"DoAction\" Value=\"WixUIValidatePath\" Order=\"3\" />", | ||
564 | " </UI>", | ||
565 | " </Fragment>", | ||
566 | "</Wix>", | ||
567 | }; | ||
568 | |||
569 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
570 | |||
571 | var messaging = new MockMessaging(); | ||
572 | var converter = new WixConverter(messaging, 2, null, null); | ||
573 | |||
574 | var errors = converter.ConvertDocument(document); | ||
575 | |||
576 | var actual = UnformattedDocumentLines(document); | ||
577 | |||
578 | Assert.Equal(2, errors); | ||
579 | Assert.Single(messaging.Messages.Where(m => m.Id == 65)); | ||
580 | WixAssert.CompareLineByLine(expected, actual); | ||
581 | } | ||
582 | } | 545 | } |
583 | } | 546 | } |
diff --git a/src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs b/src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs index 41a34f71..168751f4 100644 --- a/src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs +++ b/src/wix/test/WixToolsetTest.Converters/UIExtensionFixture.cs | |||
@@ -3,6 +3,7 @@ | |||
3 | namespace WixToolsetTest.Converters | 3 | namespace WixToolsetTest.Converters |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Linq; | ||
6 | using System.Xml.Linq; | 7 | using System.Xml.Linq; |
7 | using WixInternal.TestSupport; | 8 | using WixInternal.TestSupport; |
8 | using WixToolset.Converters; | 9 | using WixToolset.Converters; |
@@ -55,5 +56,86 @@ namespace WixToolsetTest.Converters | |||
55 | var actualLines = UnformattedDocumentLines(document); | 56 | var actualLines = UnformattedDocumentLines(document); |
56 | WixAssert.CompareLineByLine(expected, actualLines); | 57 | WixAssert.CompareLineByLine(expected, actualLines); |
57 | } | 58 | } |
59 | |||
60 | [Fact] | ||
61 | public void FixPrintCustomAction() | ||
62 | { | ||
63 | var parse = String.Join(Environment.NewLine, | ||
64 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
65 | " <Fragment>", | ||
66 | " <UI>", | ||
67 | " <Dialog Id='CustomResumeDlg' Width='370' Height='270' Title='!(loc.ResumeDlg_Title)'>", | ||
68 | " <Control Id='Print' Type='PushButton' X='112' Y='243' Width='56' Height='17' Text='!(loc.WixUIPrint)'>", | ||
69 | " <Publish Event='DoAction' Value='WixUIPrintEula'>1</Publish>", | ||
70 | " </Control>", | ||
71 | " </Dialog>", | ||
72 | " </UI>", | ||
73 | " </Fragment>", | ||
74 | "</Wix>"); | ||
75 | |||
76 | var expected = new[] | ||
77 | { | ||
78 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
79 | " <Fragment>", | ||
80 | " <UI>", | ||
81 | " <Dialog Id=\"CustomResumeDlg\" Width=\"370\" Height=\"270\" Title=\"!(loc.ResumeDlg_Title)\">", | ||
82 | " <Control Id=\"Print\" Type=\"PushButton\" X=\"112\" Y=\"243\" Width=\"56\" Height=\"17\" Text=\"!(loc.WixUIPrint)\">", | ||
83 | " <Publish Event=\"DoAction\" Value=\"WixUIPrintEula_$(sys.BUILDARCHSHORT)\" />", | ||
84 | " </Control>", | ||
85 | " </Dialog>", | ||
86 | " </UI>", | ||
87 | " </Fragment>", | ||
88 | "</Wix>" | ||
89 | }; | ||
90 | |||
91 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
92 | |||
93 | var messaging = new MockMessaging(); | ||
94 | var converter = new WixConverter(messaging, 2, null, null); | ||
95 | |||
96 | var errors = converter.ConvertDocument(document); | ||
97 | |||
98 | var actual = UnformattedDocumentLines(document); | ||
99 | |||
100 | WixAssert.CompareLineByLine(expected, actual); | ||
101 | Assert.Equal(4, errors); | ||
102 | } | ||
103 | |||
104 | [Fact] | ||
105 | public void FixValidatePathCustomAction() | ||
106 | { | ||
107 | var parse = String.Join(Environment.NewLine, | ||
108 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
109 | " <Fragment>", | ||
110 | " <UI Id='WixUI_Test'>", | ||
111 | " <Publish Dialog='BrowseDlg' Control='OK' Event='DoAction' Value='WixUIValidatePath' Order='3' />", | ||
112 | " </UI>", | ||
113 | " </Fragment>", | ||
114 | "</Wix>"); | ||
115 | |||
116 | var expected = new[] | ||
117 | { | ||
118 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
119 | " <Fragment>", | ||
120 | " <UI Id=\"WixUI_Test\">", | ||
121 | " <Publish Dialog=\"BrowseDlg\" Control=\"OK\" Event=\"DoAction\" Value=\"WixUIValidatePath_$(sys.BUILDARCHSHORT)\" Order=\"3\" />", | ||
122 | " </UI>", | ||
123 | " </Fragment>", | ||
124 | "</Wix>", | ||
125 | }; | ||
126 | |||
127 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
128 | |||
129 | var messaging = new MockMessaging(); | ||
130 | var converter = new WixConverter(messaging, 2, null, null); | ||
131 | |||
132 | var errors = converter.ConvertDocument(document); | ||
133 | |||
134 | var actual = UnformattedDocumentLines(document); | ||
135 | |||
136 | WixAssert.CompareLineByLine(expected, actual); | ||
137 | Assert.Single(messaging.Messages.Where(m => m.Id == 65)); | ||
138 | Assert.Equal(2, errors); | ||
139 | } | ||
58 | } | 140 | } |
59 | } | 141 | } |