| 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.CoreIntegration |
| 4 | { |
| 5 | using System.IO; |
| 6 | using System.Linq; |
| 7 | using System.Xml; |
| 8 | using WixInternal.TestSupport; |
| 9 | using WixInternal.Core.TestPackage; |
| 10 | using Xunit; |
| 11 | |
| 12 | public class MsiPackageFixture |
| 13 | { |
| 14 | [Fact] |
| 15 | public void CanDefaultPermanentMsiPackageToVisible() |
| 16 | { |
| 17 | var folder = TestData.Get(@"TestData"); |
| 18 | |
| 19 | using (var fs = new DisposableFileSystem()) |
| 20 | { |
| 21 | var baseFolder = fs.GetFolder(); |
| 22 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
| 23 | var binFolder = Path.Combine(baseFolder, "bin"); |
| 24 | var exePath = Path.Combine(binFolder, "test.exe"); |
| 25 | var baFolderPath = Path.Combine(baseFolder, "ba"); |
| 26 | var extractFolderPath = Path.Combine(baseFolder, "extract"); |
| 27 | |
| 28 | var result = WixRunner.Execute(new[] |
| 29 | { |
| 30 | "build", |
| 31 | Path.Combine(folder, "MsiPackage", "VisibleWhenPermanent.wxs"), |
| 32 | Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), |
| 33 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), |
| 34 | "-bindpath", binFolder, |
| 35 | "-intermediateFolder", intermediateFolder, |
| 36 | "-o", exePath, |
| 37 | }); |
| 38 | |
| 39 | result.AssertSuccess(); |
| 40 | |
| 41 | var extractResult = BundleExtractor.ExtractBAContainer(null, exePath, baFolderPath, extractFolderPath); |
| 42 | extractResult.AssertSuccess(); |
| 43 | |
| 44 | var msiProperties = extractResult.GetManifestTestXmlLines("/burn:BurnManifest/burn:Chain/burn:MsiPackage/burn:MsiProperty"); |
| 45 | WixAssert.CompareLineByLine(new[] |
| 46 | { |
| 47 | "<MsiProperty Id='MSIFASTINSTALL' Value='7' />" |
| 48 | }, msiProperties); |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | } |