diff options
author | Rob Mensching <rob@firegiant.com> | 2024-03-06 14:48:10 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2024-03-07 10:55:57 -0800 |
commit | 3d2d46f62fc01e2653d0251ad9703090574e7c41 (patch) | |
tree | ffdf7dce6c646f38b5e3ad8325c2ce78ca891a1a /src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs | |
parent | a8504dc4eb1c2d09965b0858699ac737336ef3c1 (diff) | |
download | wix-3d2d46f62fc01e2653d0251ad9703090574e7c41.tar.gz wix-3d2d46f62fc01e2653d0251ad9703090574e7c41.tar.bz2 wix-3d2d46f62fc01e2653d0251ad9703090574e7c41.zip |
Better .nupkg names
Diffstat (limited to 'src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs')
-rw-r--r-- | src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs | 519 |
1 files changed, 519 insertions, 0 deletions
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs new file mode 100644 index 00000000..7e64c13f --- /dev/null +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs | |||
@@ -0,0 +1,519 @@ | |||
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 | |||
3 | namespace WixToolsetTest.BootstrapperApplications | ||
4 | { | ||
5 | using System; | ||
6 | using System.IO; | ||
7 | using System.Linq; | ||
8 | using WixInternal.TestSupport; | ||
9 | using WixInternal.Core.TestPackage; | ||
10 | using Xunit; | ||
11 | |||
12 | public class InternalUIBAFixture | ||
13 | { | ||
14 | [Fact] | ||
15 | public void CanBuildUsingWixIuiBa() | ||
16 | { | ||
17 | using (var fs = new DisposableFileSystem()) | ||
18 | { | ||
19 | var baseFolder = fs.GetFolder(); | ||
20 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
21 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
22 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
23 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
24 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
25 | |||
26 | var compileResult = WixRunner.Execute(new[] | ||
27 | { | ||
28 | "build", | ||
29 | Path.Combine(bundleSourceFolder, "SinglePrimaryPackage.wxs"), | ||
30 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
31 | "-intermediateFolder", intermediateFolder, | ||
32 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
33 | "-o", bundleFile, | ||
34 | }); | ||
35 | compileResult.AssertSuccess(); | ||
36 | |||
37 | Assert.True(File.Exists(bundleFile)); | ||
38 | |||
39 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | ||
40 | extractResult.AssertSuccess(); | ||
41 | |||
42 | var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); | ||
43 | WixAssert.CompareLineByLine(new string[] | ||
44 | { | ||
45 | "<WixBalPackageInfo PackageId='test.msi' PrimaryPackageType='default' />", | ||
46 | }, balPackageInfos); | ||
47 | |||
48 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); | ||
49 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); | ||
50 | } | ||
51 | } | ||
52 | |||
53 | [Fact] | ||
54 | public void CanBuildUsingWixIuiBaWithUrlPrereqPackage() | ||
55 | { | ||
56 | using (var fs = new DisposableFileSystem()) | ||
57 | { | ||
58 | var baseFolder = fs.GetFolder(); | ||
59 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
60 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
61 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
62 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
63 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
64 | |||
65 | var compileResult = WixRunner.Execute(new[] | ||
66 | { | ||
67 | "build", | ||
68 | Path.Combine(bundleSourceFolder, "UrlPrereqPackage.wxs"), | ||
69 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
70 | "-intermediateFolder", intermediateFolder, | ||
71 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
72 | "-o", bundleFile, | ||
73 | }); | ||
74 | compileResult.AssertSuccess(); | ||
75 | |||
76 | Assert.True(File.Exists(bundleFile)); | ||
77 | |||
78 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | ||
79 | extractResult.AssertSuccess(); | ||
80 | |||
81 | var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); | ||
82 | WixAssert.CompareLineByLine(new string[] | ||
83 | { | ||
84 | "<WixBalPackageInfo PackageId='test.msi' PrimaryPackageType='default' />", | ||
85 | }, balPackageInfos); | ||
86 | |||
87 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); | ||
88 | WixAssert.CompareLineByLine(new[] | ||
89 | { | ||
90 | "<WixPrereqInformation PackageId='wixnative.exe' LicenseUrl='https://www.mysite.com/prereqterms' />", | ||
91 | }, mbaPrereqInfos); | ||
92 | |||
93 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); | ||
94 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); | ||
95 | } | ||
96 | } | ||
97 | |||
98 | [Fact] | ||
99 | public void CanBuildUsingWixIuiBaWithImplicitPrimaryPackage() | ||
100 | { | ||
101 | using (var fs = new DisposableFileSystem()) | ||
102 | { | ||
103 | var baseFolder = fs.GetFolder(); | ||
104 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
105 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
106 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
107 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
108 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
109 | |||
110 | var compileResult = WixRunner.Execute(new[] | ||
111 | { | ||
112 | "build", | ||
113 | Path.Combine(bundleSourceFolder, "ImplicitPrimaryPackage.wxs"), | ||
114 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
115 | "-intermediateFolder", intermediateFolder, | ||
116 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
117 | "-o", bundleFile, | ||
118 | }); | ||
119 | compileResult.AssertSuccess(); | ||
120 | |||
121 | Assert.True(File.Exists(bundleFile)); | ||
122 | |||
123 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | ||
124 | extractResult.AssertSuccess(); | ||
125 | |||
126 | var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); | ||
127 | WixAssert.CompareLineByLine(new string[] | ||
128 | { | ||
129 | "<WixBalPackageInfo PackageId='test.msi' PrimaryPackageType='default' />", | ||
130 | }, balPackageInfos); | ||
131 | |||
132 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); | ||
133 | WixAssert.CompareLineByLine(new[] | ||
134 | { | ||
135 | "<WixPrereqInformation PackageId='wixnative.exe' />", | ||
136 | }, mbaPrereqInfos); | ||
137 | |||
138 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); | ||
139 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); | ||
140 | } | ||
141 | } | ||
142 | |||
143 | [Fact] | ||
144 | public void CanBuildUsingWixIuiBaWithWarnings() | ||
145 | { | ||
146 | using (var fs = new DisposableFileSystem()) | ||
147 | { | ||
148 | var baseFolder = fs.GetFolder(); | ||
149 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
150 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
151 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
152 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
153 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
154 | |||
155 | var compileResult = WixRunner.Execute(warningsAsErrors: false, new[] | ||
156 | { | ||
157 | "build", | ||
158 | Path.Combine(bundleSourceFolder, "IuiBaWarnings.wxs"), | ||
159 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
160 | "-intermediateFolder", intermediateFolder, | ||
161 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
162 | "-o", bundleFile, | ||
163 | }); | ||
164 | |||
165 | WixAssert.CompareLineByLine(new[] | ||
166 | { | ||
167 | "WixInternalUIBootstrapperApplication does not support the value of 'force' for Cache on prereq packages. Prereq packages are only cached when they need to be installed.", | ||
168 | "WixInternalUIBootstrapperApplication ignores InstallCondition for the primary package so that the MSI UI is always shown.", | ||
169 | "WixInternalUIBootstrapperApplication ignores DisplayInternalUICondition for the primary package so that the MSI UI is always shown.", | ||
170 | "When using WixInternalUIBootstrapperApplication, all prereq packages should be before the primary package in the chain. The prereq packages are always installed before the primary package.", | ||
171 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
172 | |||
173 | compileResult.AssertSuccess(); | ||
174 | |||
175 | Assert.True(File.Exists(bundleFile)); | ||
176 | |||
177 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | ||
178 | extractResult.AssertSuccess(); | ||
179 | |||
180 | var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); | ||
181 | WixAssert.CompareLineByLine(new string[] | ||
182 | { | ||
183 | "<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='DISPLAYTEST' PrimaryPackageType='default' />", | ||
184 | }, balPackageInfos); | ||
185 | |||
186 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); | ||
187 | WixAssert.CompareLineByLine(new[] | ||
188 | { | ||
189 | "<WixPrereqInformation PackageId='wixnative.exe' />", | ||
190 | }, mbaPrereqInfos); | ||
191 | |||
192 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.thm"))); | ||
193 | Assert.True(File.Exists(Path.Combine(baFolderPath, "wixpreq.wxl"))); | ||
194 | } | ||
195 | } | ||
196 | |||
197 | [Fact] | ||
198 | public void CannotBuildUsingWixIuiBaWithAllPrereqPackages() | ||
199 | { | ||
200 | using (var fs = new DisposableFileSystem()) | ||
201 | { | ||
202 | var baseFolder = fs.GetFolder(); | ||
203 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
204 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
205 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
206 | |||
207 | var compileResult = WixRunner.Execute(new[] | ||
208 | { | ||
209 | "build", | ||
210 | Path.Combine(bundleSourceFolder, "AllPrereqPackages.wxs"), | ||
211 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
212 | "-intermediateFolder", intermediateFolder, | ||
213 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
214 | "-o", bundleFile, | ||
215 | }); | ||
216 | |||
217 | WixAssert.CompareLineByLine(new[] | ||
218 | { | ||
219 | "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\".", | ||
220 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
221 | |||
222 | Assert.Equal(6808, compileResult.ExitCode); | ||
223 | } | ||
224 | } | ||
225 | |||
226 | [Fact] | ||
227 | public void CannotBuildUsingWixIuiBaWithImplicitNonMsiPrimaryPackage() | ||
228 | { | ||
229 | using (var fs = new DisposableFileSystem()) | ||
230 | { | ||
231 | var baseFolder = fs.GetFolder(); | ||
232 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
233 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
234 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
235 | |||
236 | var compileResult = WixRunner.Execute(new[] | ||
237 | { | ||
238 | "build", | ||
239 | Path.Combine(bundleSourceFolder, "ImplicitNonMsiPrimaryPackage.wxs"), | ||
240 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
241 | "-intermediateFolder", intermediateFolder, | ||
242 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
243 | "-o", bundleFile, | ||
244 | }); | ||
245 | |||
246 | WixAssert.CompareLineByLine(new[] | ||
247 | { | ||
248 | "When using WixInternalUIBootstrapperApplication, packages must either be non-permanent and have the bal:PrimaryPackageType attribute, or be permanent and have the bal:PrereqPackage attribute set to 'yes'.", | ||
249 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
250 | |||
251 | Assert.Equal(6811, compileResult.ExitCode); | ||
252 | } | ||
253 | } | ||
254 | |||
255 | [Fact] | ||
256 | public void CannotBuildUsingWixIuiBaWithImplicitPrimaryPackageEnableFeatureSelection() | ||
257 | { | ||
258 | using (var fs = new DisposableFileSystem()) | ||
259 | { | ||
260 | var baseFolder = fs.GetFolder(); | ||
261 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
262 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
263 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
264 | |||
265 | var compileResult = WixRunner.Execute(new[] | ||
266 | { | ||
267 | "build", | ||
268 | Path.Combine(bundleSourceFolder, "ImplicitPrimaryPackageEnableFeatureSelection.wxs"), | ||
269 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
270 | "-intermediateFolder", intermediateFolder, | ||
271 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
272 | "-o", bundleFile, | ||
273 | }); | ||
274 | |||
275 | WixAssert.CompareLineByLine(new[] | ||
276 | { | ||
277 | "When using WixInternalUIBootstrapperApplication, packages must either be non-permanent and have the bal:PrimaryPackageType attribute, or be permanent and have the bal:PrereqPackage attribute set to 'yes'.", | ||
278 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
279 | |||
280 | Assert.Equal(6811, compileResult.ExitCode); | ||
281 | } | ||
282 | } | ||
283 | |||
284 | [Fact] | ||
285 | public void CannotBuildUsingWixIuiBaWithMultipleNonPermanentNonPrimaryPackages() | ||
286 | { | ||
287 | using (var fs = new DisposableFileSystem()) | ||
288 | { | ||
289 | var baseFolder = fs.GetFolder(); | ||
290 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
291 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
292 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
293 | |||
294 | var compileResult = WixRunner.Execute(new[] | ||
295 | { | ||
296 | "build", | ||
297 | Path.Combine(bundleSourceFolder, "MultipleNonPermanentNonPrimaryPackages.wxs"), | ||
298 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
299 | "-intermediateFolder", intermediateFolder, | ||
300 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
301 | "-o", bundleFile, | ||
302 | }); | ||
303 | |||
304 | WixAssert.CompareLineByLine(new[] | ||
305 | { | ||
306 | "When using WixInternalUIBootstrapperApplication, packages must either be non-permanent and have the bal:PrimaryPackageType attribute, or be permanent and have the bal:PrereqPackage attribute set to 'yes'.", | ||
307 | "When using WixInternalUIBootstrapperApplication, packages must either be non-permanent and have the bal:PrimaryPackageType attribute, or be permanent and have the bal:PrereqPackage attribute set to 'yes'.", | ||
308 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
309 | |||
310 | Assert.Equal(6811, compileResult.ExitCode); | ||
311 | } | ||
312 | } | ||
313 | |||
314 | [Fact] | ||
315 | public void CannotBuildUsingWixIuiBaWithMultiplePrimaryPackagesOfSameType() | ||
316 | { | ||
317 | using (var fs = new DisposableFileSystem()) | ||
318 | { | ||
319 | var baseFolder = fs.GetFolder(); | ||
320 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
321 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
322 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
323 | |||
324 | var compileResult = WixRunner.Execute(new[] | ||
325 | { | ||
326 | "build", | ||
327 | Path.Combine(bundleSourceFolder, "MultipleDefaultPrimaryPackages.wxs"), | ||
328 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
329 | "-intermediateFolder", intermediateFolder, | ||
330 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
331 | "-o", bundleFile, | ||
332 | }); | ||
333 | |||
334 | WixAssert.CompareLineByLine(new[] | ||
335 | { | ||
336 | "There may only be one package in the bundle with PrimaryPackageType of 'default'.", | ||
337 | "The location of the package related to the previous error.", | ||
338 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
339 | |||
340 | Assert.Equal(6810, compileResult.ExitCode); | ||
341 | } | ||
342 | } | ||
343 | |||
344 | [Fact] | ||
345 | public void CannotBuildUsingWixIuiBaWithNoDefaultPrimaryPackage() | ||
346 | { | ||
347 | using (var fs = new DisposableFileSystem()) | ||
348 | { | ||
349 | var baseFolder = fs.GetFolder(); | ||
350 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
351 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
352 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
353 | |||
354 | var compileResult = WixRunner.Execute(new[] | ||
355 | { | ||
356 | "build", | ||
357 | Path.Combine(bundleSourceFolder, "NoDefaultPrimaryPackage.wxs"), | ||
358 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
359 | "-intermediateFolder", intermediateFolder, | ||
360 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
361 | "-o", bundleFile, | ||
362 | }); | ||
363 | |||
364 | WixAssert.CompareLineByLine(new[] | ||
365 | { | ||
366 | "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\".", | ||
367 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
368 | |||
369 | Assert.Equal(6808, compileResult.ExitCode); | ||
370 | } | ||
371 | } | ||
372 | |||
373 | [Fact] | ||
374 | public void CannotBuildUsingWixIuiBaWithNonMsiPrimaryPackage() | ||
375 | { | ||
376 | using (var fs = new DisposableFileSystem()) | ||
377 | { | ||
378 | var baseFolder = fs.GetFolder(); | ||
379 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
380 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
381 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
382 | |||
383 | var compileResult = WixRunner.Execute(new[] | ||
384 | { | ||
385 | "build", | ||
386 | Path.Combine(bundleSourceFolder, "NonMsiPrimaryPackage.wxs"), | ||
387 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
388 | "-intermediateFolder", intermediateFolder, | ||
389 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
390 | "-o", bundleFile, | ||
391 | }); | ||
392 | |||
393 | WixAssert.CompareLineByLine(new[] | ||
394 | { | ||
395 | "When using WixInternalUIBootstrapperApplication, each primary package must be an MsiPackage.", | ||
396 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
397 | |||
398 | Assert.Equal(6814, compileResult.ExitCode); | ||
399 | } | ||
400 | } | ||
401 | |||
402 | [Fact] | ||
403 | public void CannotBuildUsingWixIuiBaWithNonPermanentPrereqPackage() | ||
404 | { | ||
405 | using (var fs = new DisposableFileSystem()) | ||
406 | { | ||
407 | var baseFolder = fs.GetFolder(); | ||
408 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
409 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
410 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
411 | |||
412 | var compileResult = WixRunner.Execute(new[] | ||
413 | { | ||
414 | "build", | ||
415 | Path.Combine(bundleSourceFolder, "NonPermanentPrereqPackage.wxs"), | ||
416 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
417 | "-intermediateFolder", intermediateFolder, | ||
418 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
419 | "-o", bundleFile, | ||
420 | }); | ||
421 | |||
422 | WixAssert.CompareLineByLine(new[] | ||
423 | { | ||
424 | "When using WixInternalUIBootstrapperApplication and bal:PrereqPackage is set to 'yes', the package must be permanent.", | ||
425 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
426 | |||
427 | Assert.Equal(6812, compileResult.ExitCode); | ||
428 | } | ||
429 | } | ||
430 | |||
431 | [Fact] | ||
432 | public void CannotBuildUsingWixIuiBaWithPermanentPrimaryPackage() | ||
433 | { | ||
434 | using (var fs = new DisposableFileSystem()) | ||
435 | { | ||
436 | var baseFolder = fs.GetFolder(); | ||
437 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
438 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
439 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
440 | |||
441 | var compileResult = WixRunner.Execute(new[] | ||
442 | { | ||
443 | "build", | ||
444 | Path.Combine(bundleSourceFolder, "PermanentPrimaryPackage.wxs"), | ||
445 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
446 | "-intermediateFolder", intermediateFolder, | ||
447 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
448 | "-o", bundleFile, | ||
449 | }); | ||
450 | |||
451 | WixAssert.CompareLineByLine(new[] | ||
452 | { | ||
453 | "When using WixInternalUIBootstrapperApplication, packages with the bal:PrimaryPackageType attribute must not be permanent.", | ||
454 | "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\".", | ||
455 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
456 | |||
457 | Assert.Equal(6808, compileResult.ExitCode); | ||
458 | } | ||
459 | } | ||
460 | |||
461 | [Fact] | ||
462 | public void CannotBuildUsingWixIuiBaWithPrimaryPackageEnableFeatureSelection() | ||
463 | { | ||
464 | using (var fs = new DisposableFileSystem()) | ||
465 | { | ||
466 | var baseFolder = fs.GetFolder(); | ||
467 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
468 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
469 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
470 | |||
471 | var compileResult = WixRunner.Execute(new[] | ||
472 | { | ||
473 | "build", | ||
474 | Path.Combine(bundleSourceFolder, "PrimaryPackageEnableFeatureSelection.wxs"), | ||
475 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
476 | "-intermediateFolder", intermediateFolder, | ||
477 | "-bindpath", TestData.Get(@"TestData\WixStdBa\Data"), | ||
478 | "-o", bundleFile, | ||
479 | }); | ||
480 | |||
481 | WixAssert.CompareLineByLine(new[] | ||
482 | { | ||
483 | "When using WixInternalUIBootstrapperApplication, primary packages must not have feature selection enabled because it interferes with the user selecting feature through the MSI UI.", | ||
484 | "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\".", | ||
485 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
486 | |||
487 | Assert.Equal(6808, compileResult.ExitCode); | ||
488 | } | ||
489 | } | ||
490 | |||
491 | [Fact] | ||
492 | public void CannotBuildUsingWixIuiBaWithPrimaryPrereqPackage() | ||
493 | { | ||
494 | using (var fs = new DisposableFileSystem()) | ||
495 | { | ||
496 | var baseFolder = fs.GetFolder(); | ||
497 | var wixlibFile = Path.Combine(baseFolder, "bin", "test.wixlib"); | ||
498 | var bundleSourceFolder = TestData.Get(@"TestData\WixIuiBa"); | ||
499 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
500 | |||
501 | var compileResult = WixRunner.Execute(new[] | ||
502 | { | ||
503 | "build", | ||
504 | Path.Combine(bundleSourceFolder, "PrimaryPrereqPackage.wxs"), | ||
505 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
506 | "-intermediateFolder", intermediateFolder, | ||
507 | "-o", wixlibFile, | ||
508 | }); | ||
509 | |||
510 | WixAssert.CompareLineByLine(new[] | ||
511 | { | ||
512 | "The MsiPackage/@PrereqPackage attribute's value, 'yes', cannot be specified with attribute PrimaryPackageType present.", | ||
513 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | ||
514 | |||
515 | Assert.Equal(193, compileResult.ExitCode); | ||
516 | } | ||
517 | } | ||
518 | } | ||
519 | } | ||