aboutsummaryrefslogtreecommitdiff
path: root/src/ext/UI/test/WixToolsetTest.UI
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2022-11-21 16:57:23 -0500
committerBob Arnson <github@bobs.org>2022-12-06 15:16:20 -0500
commitc4ffb9967e4e4f7d67f5925208e3e0a885e903c5 (patch)
tree3f34ca158b1bc39d5b6aaee2a4bb2f93dae0d365 /src/ext/UI/test/WixToolsetTest.UI
parent0af946e794ec85801dc542edd9905f9e9e18e7ed (diff)
downloadwix-c4ffb9967e4e4f7d67f5925208e3e0a885e903c5.tar.gz
wix-c4ffb9967e4e4f7d67f5925208e3e0a885e903c5.tar.bz2
wix-c4ffb9967e4e4f7d67f5925208e3e0a885e903c5.zip
Better solution to the UI custom action "problem."
Add platform-specific fragments that are referenced by the compiler extension. That makes it easier to customize: Just copy the dialog set authoring and rename, like in v3.
Diffstat (limited to 'src/ext/UI/test/WixToolsetTest.UI')
-rw-r--r--src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs80
1 files changed, 58 insertions, 22 deletions
diff --git a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs
index 4fd203c5..c637b5dd 100644
--- a/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs
+++ b/src/ext/UI/test/WixToolsetTest.UI/UIExtensionFixture.cs
@@ -20,7 +20,7 @@ namespace WixToolsetTest.UI
20 var bindFolder = TestData.Get(@"TestData\data"); 20 var bindFolder = TestData.Get(@"TestData\data");
21 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); 21 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder });
22 22
23 var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction"); 23 var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent");
24 Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); 24 Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t"));
25 WixAssert.CompareLineByLine(new[] 25 WixAssert.CompareLineByLine(new[]
26 { 26 {
@@ -38,9 +38,15 @@ namespace WixToolsetTest.UI
38 "CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t", 38 "CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t",
39 "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t", 39 "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t",
40 "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t", 40 "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t",
41 "CustomAction:WixUIPrintEula\t65\tWixUiCa_X86\tPrintEula\t", 41 "CustomAction:WixUIPrintEula_X86\t65\tWixUiCa_X86\tPrintEula\t",
42 "CustomAction:WixUIValidatePath\t65\tWixUiCa_X86\tValidatePath\t", 42 "CustomAction:WixUIValidatePath_X86\t65\tWixUiCa_X86\tValidatePath\t",
43 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); 43 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray());
44 WixAssert.CompareLineByLine(new[]
45 {
46 "ControlEvent:AdvancedWelcomeEulaDlg\tPrint\tDoAction\tWixUIPrintEula_X86\t1\t1",
47 "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t1",
48 "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t2",
49 }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray());
44 } 50 }
45 51
46 [Fact] 52 [Fact]
@@ -50,7 +56,7 @@ namespace WixToolsetTest.UI
50 var bindFolder = TestData.Get(@"TestData\data"); 56 var bindFolder = TestData.Get(@"TestData\data");
51 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); 57 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder });
52 58
53 var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction"); 59 var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent");
54 Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); 60 Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t"));
55 WixAssert.CompareLineByLine(new[] 61 WixAssert.CompareLineByLine(new[]
56 { 62 {
@@ -68,9 +74,15 @@ namespace WixToolsetTest.UI
68 "CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t", 74 "CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t",
69 "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t", 75 "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t",
70 "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t", 76 "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t",
71 "CustomAction:WixUIPrintEula\t65\tWixUiCa_X64\tPrintEula\t", 77 "CustomAction:WixUIPrintEula_X64\t65\tWixUiCa_X64\tPrintEula\t",
72 "CustomAction:WixUIValidatePath\t65\tWixUiCa_X64\tValidatePath\t", 78 "CustomAction:WixUIValidatePath_X64\t65\tWixUiCa_X64\tValidatePath\t",
73 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); 79 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray());
80 WixAssert.CompareLineByLine(new[]
81 {
82 "ControlEvent:AdvancedWelcomeEulaDlg\tPrint\tDoAction\tWixUIPrintEula_X64\t1\t1",
83 "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X64\tNOT WIXUI_DONTVALIDATEPATH\t1",
84 "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X64\tNOT WIXUI_DONTVALIDATEPATH\t2",
85 }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray());
74 } 86 }
75 87
76 [Fact] 88 [Fact]
@@ -80,7 +92,7 @@ namespace WixToolsetTest.UI
80 var bindFolder = TestData.Get(@"TestData\data"); 92 var bindFolder = TestData.Get(@"TestData\data");
81 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); 93 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder });
82 94
83 var results = build.BuildAndQuery(BuildARM64, "Binary", "Dialog", "CustomAction"); 95 var results = build.BuildAndQuery(BuildARM64, "Binary", "Dialog", "CustomAction", "ControlEvent");
84 Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t")); 96 Assert.Single(results, result => result.StartsWith("Dialog:AdvancedWelcomeEulaDlg\t"));
85 WixAssert.CompareLineByLine(new[] 97 WixAssert.CompareLineByLine(new[]
86 { 98 {
@@ -98,9 +110,15 @@ namespace WixToolsetTest.UI
98 "CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t", 110 "CustomAction:WixSetDefaultPerUserFolder\t51\tWixPerUserFolder\t[LocalAppDataFolder]Apps\\[ApplicationFolderName]\t",
99 "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t", 111 "CustomAction:WixSetPerMachineFolder\t51\tAPPLICATIONFOLDER\t[WixPerMachineFolder]\t",
100 "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t", 112 "CustomAction:WixSetPerUserFolder\t51\tAPPLICATIONFOLDER\t[WixPerUserFolder]\t",
101 "CustomAction:WixUIPrintEula\t65\tWixUiCa_A64\tPrintEula\t", 113 "CustomAction:WixUIPrintEula_A64\t65\tWixUiCa_A64\tPrintEula\t",
102 "CustomAction:WixUIValidatePath\t65\tWixUiCa_A64\tValidatePath\t", 114 "CustomAction:WixUIValidatePath_A64\t65\tWixUiCa_A64\tValidatePath\t",
103 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); 115 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray());
116 WixAssert.CompareLineByLine(new[]
117 {
118 "ControlEvent:AdvancedWelcomeEulaDlg\tPrint\tDoAction\tWixUIPrintEula_A64\t1\t1",
119 "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_A64\tNOT WIXUI_DONTVALIDATEPATH\t1",
120 "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_A64\tNOT WIXUI_DONTVALIDATEPATH\t2",
121 }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray());
104 } 122 }
105 123
106 [Fact] 124 [Fact]
@@ -110,7 +128,7 @@ namespace WixToolsetTest.UI
110 var bindFolder = TestData.Get(@"TestData\data"); 128 var bindFolder = TestData.Get(@"TestData\data");
111 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); 129 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder });
112 130
113 var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction"); 131 var results = build.BuildAndQuery(BuildX64, "Binary", "Dialog", "CustomAction", "ControlEvent");
114 Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); 132 Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t"));
115 Assert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t")); 133 Assert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t"));
116 Assert.Empty(results.Where(result => result.StartsWith("Dialog:SetupTypeDlg\t"))); 134 Assert.Empty(results.Where(result => result.StartsWith("Dialog:SetupTypeDlg\t")));
@@ -122,13 +140,16 @@ namespace WixToolsetTest.UI
122 "Binary:WixUI_Bmp_Up\t[Binary data]", 140 "Binary:WixUI_Bmp_Up\t[Binary data]",
123 "Binary:WixUI_Ico_Exclam\t[Binary data]", 141 "Binary:WixUI_Ico_Exclam\t[Binary data]",
124 "Binary:WixUI_Ico_Info\t[Binary data]", 142 "Binary:WixUI_Ico_Info\t[Binary data]",
125 "Binary:WixUiCa_X86\t[Binary data]", 143 "Binary:WixUiCa_X64\t[Binary data]",
126 }, results.Where(r => r.StartsWith("Binary:")).ToArray()); 144 }, results.Where(r => r.StartsWith("Binary:")).ToArray());
127 WixAssert.CompareLineByLine(new[] 145 WixAssert.CompareLineByLine(new[]
128 { 146 {
129 "CustomAction:WixUIPrintEula\t65\tWixUiCa_X86\tPrintEula\t", 147 "CustomAction:WixUIPrintEula_X64\t65\tWixUiCa_X64\tPrintEula\t",
130 "CustomAction:WixUIValidatePath\t65\tWixUiCa_X86\tValidatePath\t",
131 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); 148 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray());
149 WixAssert.CompareLineByLine(new[]
150 {
151 "ControlEvent:LicenseAgreementDlg\tPrint\tDoAction\tWixUIPrintEula_X64\t1\t1",
152 }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray());
132 } 153 }
133 154
134 [Fact] 155 [Fact]
@@ -138,7 +159,7 @@ namespace WixToolsetTest.UI
138 var bindFolder = TestData.Get(@"TestData\data"); 159 var bindFolder = TestData.Get(@"TestData\data");
139 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); 160 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder });
140 161
141 var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "Property"); 162 var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "Property", "ControlEvent");
142 Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t")); 163 Assert.Single(results, result => result.StartsWith("Dialog:InstallDirDlg\t"));
143 WixAssert.CompareLineByLine(new[] 164 WixAssert.CompareLineByLine(new[]
144 { 165 {
@@ -152,13 +173,19 @@ namespace WixToolsetTest.UI
152 }, results.Where(r => r.StartsWith("Binary:")).ToArray()); 173 }, results.Where(r => r.StartsWith("Binary:")).ToArray());
153 WixAssert.CompareLineByLine(new[] 174 WixAssert.CompareLineByLine(new[]
154 { 175 {
155 "CustomAction:WixUIPrintEula\t65\tWixUiCa_X86\tPrintEula\t", 176 "CustomAction:WixUIPrintEula_X86\t65\tWixUiCa_X86\tPrintEula\t",
156 "CustomAction:WixUIValidatePath\t65\tWixUiCa_X86\tValidatePath\t", 177 "CustomAction:WixUIValidatePath_X86\t65\tWixUiCa_X86\tValidatePath\t",
157 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); 178 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray());
158 WixAssert.CompareLineByLine(new[] 179 WixAssert.CompareLineByLine(new[]
159 { 180 {
160 "Property:WIXUI_INSTALLDIR\tINSTALLFOLDER", 181 "Property:WIXUI_INSTALLDIR\tINSTALLFOLDER",
161 }, results.Where(r => r.StartsWith("Property:WIXUI")).ToArray()); 182 }, results.Where(r => r.StartsWith("Property:WIXUI")).ToArray());
183 WixAssert.CompareLineByLine(new[]
184 {
185 "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t3",
186 "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t2",
187 "ControlEvent:LicenseAgreementDlg\tPrint\tDoAction\tWixUIPrintEula_X86\t1\t1",
188 }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray());
162 } 189 }
163 190
164 [Fact] 191 [Fact]
@@ -168,7 +195,7 @@ namespace WixToolsetTest.UI
168 var bindFolder = TestData.Get(@"TestData\data"); 195 var bindFolder = TestData.Get(@"TestData\data");
169 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); 196 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder });
170 197
171 var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction"); 198 var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent");
172 Assert.Single(results, result => result.StartsWith("Dialog:WelcomeEulaDlg\t")); 199 Assert.Single(results, result => result.StartsWith("Dialog:WelcomeEulaDlg\t"));
173 WixAssert.CompareLineByLine(new[] 200 WixAssert.CompareLineByLine(new[]
174 { 201 {
@@ -182,9 +209,12 @@ namespace WixToolsetTest.UI
182 }, results.Where(r => r.StartsWith("Binary:")).ToArray()); 209 }, results.Where(r => r.StartsWith("Binary:")).ToArray());
183 WixAssert.CompareLineByLine(new[] 210 WixAssert.CompareLineByLine(new[]
184 { 211 {
185 "CustomAction:WixUIPrintEula\t65\tWixUiCa_X86\tPrintEula\t", 212 "CustomAction:WixUIPrintEula_X86\t65\tWixUiCa_X86\tPrintEula\t",
186 "CustomAction:WixUIValidatePath\t65\tWixUiCa_X86\tValidatePath\t",
187 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); 213 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray());
214 WixAssert.CompareLineByLine(new[]
215 {
216 "ControlEvent:WelcomeEulaDlg\tPrint\tDoAction\tWixUIPrintEula_X86\t1\t1",
217 }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).OrderBy(s => s).ToArray());
188 } 218 }
189 219
190 [Fact] 220 [Fact]
@@ -232,7 +262,7 @@ namespace WixToolsetTest.UI
232 var bindFolder = TestData.Get(@"TestData\data"); 262 var bindFolder = TestData.Get(@"TestData\data");
233 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder }); 263 var build = new Builder(folder, typeof(UIExtensionFactory), new[] { bindFolder });
234 264
235 var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction"); 265 var results = build.BuildAndQuery(Build, "Binary", "Dialog", "CustomAction", "ControlEvent");
236 Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t")); 266 Assert.Single(results, result => result.StartsWith("Dialog:WelcomeDlg\t"));
237 Assert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t")); 267 Assert.Single(results, result => result.StartsWith("Dialog:CustomizeDlg\t"));
238 Assert.Single(results, result => result.StartsWith("Dialog:SetupTypeDlg\t")); 268 Assert.Single(results, result => result.StartsWith("Dialog:SetupTypeDlg\t"));
@@ -248,9 +278,15 @@ namespace WixToolsetTest.UI
248 }, results.Where(r => r.StartsWith("Binary:")).ToArray()); 278 }, results.Where(r => r.StartsWith("Binary:")).ToArray());
249 WixAssert.CompareLineByLine(new[] 279 WixAssert.CompareLineByLine(new[]
250 { 280 {
251 "CustomAction:WixUIPrintEula\t65\tWixUiCa_X86\tPrintEula\t", 281 "CustomAction:WixUIPrintEula_X86\t65\tWixUiCa_X86\tPrintEula\t",
252 "CustomAction:WixUIValidatePath\t65\tWixUiCa_X86\tValidatePath\t", 282 "CustomAction:WixUIValidatePath_X86\t65\tWixUiCa_X86\tValidatePath\t",
253 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray()); 283 }, results.Where(r => r.StartsWith("CustomAction:")).ToArray());
284 WixAssert.CompareLineByLine(new[]
285 {
286 "ControlEvent:BrowseDlg\tOK\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t3",
287 "ControlEvent:InstallDirDlg\tNext\tDoAction\tWixUIValidatePath_X86\tNOT WIXUI_DONTVALIDATEPATH\t2",
288 "ControlEvent:LicenseAgreementDlg\tPrint\tDoAction\tWixUIPrintEula_X86\t1\t1",
289 }, results.Where(result => result.StartsWith("ControlEvent:") && result.Contains("DoAction")).ToArray());
254 } 290 }
255 291
256 [Fact] 292 [Fact]