aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/TestData/MsiTransaction/BundleBv1/BundleB.wxi1
-rw-r--r--src/TestData/MsiTransaction/BundleBv1/BundleBv1.wxs1
-rw-r--r--src/TestData/MsiTransaction/BundleBv2/BundleBv2.wxs1
-rw-r--r--src/TestData/PrereqBa/BundleA/BundleA.wixproj16
-rw-r--r--src/TestData/PrereqBa/BundleA/BundleA.wxi17
-rw-r--r--src/TestData/PrereqBa/BundleA/BundleA.wxs21
-rw-r--r--src/TestData/PrereqBa/BundleA/bad.runtimeconfig.json10
-rw-r--r--src/TestData/PrereqBa/BundleB/BundleB.wixproj16
-rw-r--r--src/TestData/PrereqBa/BundleB/BundleB.wxi17
-rw-r--r--src/TestData/PrereqBa/BundleB/BundleB.wxs20
-rw-r--r--src/TestData/PrereqBa/BundleB/bad.config17
-rw-r--r--src/TestData/PrereqBa/PackageA/PackageA.wixproj9
-rw-r--r--src/TestData/PrereqBa/PackageB/PackageB.wixproj9
-rw-r--r--src/TestData/PrereqBa/PackageF/PackageF.wixproj12
-rw-r--r--src/TestData/TestBA/TestBAWixlib/TestBA.wxs22
-rw-r--r--src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj3
-rw-r--r--src/Utilities/TestBA/TestBA.csproj11
-rw-r--r--src/WixToolsetTest.BurnE2E/PrereqBaTests.cs76
18 files changed, 267 insertions, 12 deletions
diff --git a/src/TestData/MsiTransaction/BundleBv1/BundleB.wxi b/src/TestData/MsiTransaction/BundleBv1/BundleB.wxi
index cb7a602d..943b8b48 100644
--- a/src/TestData/MsiTransaction/BundleBv1/BundleB.wxi
+++ b/src/TestData/MsiTransaction/BundleBv1/BundleB.wxi
@@ -11,7 +11,6 @@
11 <Variable Name="TestGroupName" Value="$(var.TestGroupName)" /> 11 <Variable Name="TestGroupName" Value="$(var.TestGroupName)" />
12 12
13 <Chain> 13 <Chain>
14 <PackageGroupRef Id="TestBA" />
15 <PackageGroupRef Id="BundlePackages" /> 14 <PackageGroupRef Id="BundlePackages" />
16 </Chain> 15 </Chain>
17 </Bundle> 16 </Bundle>
diff --git a/src/TestData/MsiTransaction/BundleBv1/BundleBv1.wxs b/src/TestData/MsiTransaction/BundleBv1/BundleBv1.wxs
index 420d5157..1a24f53e 100644
--- a/src/TestData/MsiTransaction/BundleBv1/BundleBv1.wxs
+++ b/src/TestData/MsiTransaction/BundleBv1/BundleBv1.wxs
@@ -5,6 +5,7 @@
5 <?include BundleB.wxi ?> 5 <?include BundleB.wxi ?>
6 <Fragment> 6 <Fragment>
7 <PackageGroup Id="BundlePackages"> 7 <PackageGroup Id="BundlePackages">
8 <PackageGroupRef Id="TestBA" />
8 <MsiPackage Id="PackageB" SourceFile="$(var.PackageBv1.TargetPath)" /> 9 <MsiPackage Id="PackageB" SourceFile="$(var.PackageBv1.TargetPath)" />
9 </PackageGroup> 10 </PackageGroup>
10 </Fragment> 11 </Fragment>
diff --git a/src/TestData/MsiTransaction/BundleBv2/BundleBv2.wxs b/src/TestData/MsiTransaction/BundleBv2/BundleBv2.wxs
index 39197d7d..33665860 100644
--- a/src/TestData/MsiTransaction/BundleBv2/BundleBv2.wxs
+++ b/src/TestData/MsiTransaction/BundleBv2/BundleBv2.wxs
@@ -5,6 +5,7 @@
5 <?include ..\BundleBv1\BundleB.wxi ?> 5 <?include ..\BundleBv1\BundleB.wxi ?>
6 <Fragment> 6 <Fragment>
7 <PackageGroup Id="BundlePackages"> 7 <PackageGroup Id="BundlePackages">
8 <PackageGroupRef Id="TestBAdnc" />
8 <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" /> 9 <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" />
9 <RollbackBoundary Transaction="yes" /> 10 <RollbackBoundary Transaction="yes" />
10 <MsiPackage Id="PackageB" SourceFile="$(var.PackageBv2.TargetPath)" /> 11 <MsiPackage Id="PackageB" SourceFile="$(var.PackageBv2.TargetPath)" />
diff --git a/src/TestData/PrereqBa/BundleA/BundleA.wixproj b/src/TestData/PrereqBa/BundleA/BundleA.wixproj
new file mode 100644
index 00000000..ab4c0499
--- /dev/null
+++ b/src/TestData/PrereqBa/BundleA/BundleA.wixproj
@@ -0,0 +1,16 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <OutputType>Bundle</OutputType>
5 </PropertyGroup>
6 <ItemGroup>
7 <BindInputPaths Include="$(OutputPath)..\net5.0-windows\win-x86" BindName="dnc5x86" />
8 </ItemGroup>
9 <ItemGroup>
10 <ProjectReference Include="..\PackageA\PackageA.wixproj" />
11 <ProjectReference Include="..\PackageF\PackageF.wixproj" />
12 </ItemGroup>
13 <ItemGroup>
14 <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.77" />
15 </ItemGroup>
16</Project> \ No newline at end of file
diff --git a/src/TestData/PrereqBa/BundleA/BundleA.wxi b/src/TestData/PrereqBa/BundleA/BundleA.wxi
new file mode 100644
index 00000000..23623ffb
--- /dev/null
+++ b/src/TestData/PrereqBa/BundleA/BundleA.wxi
@@ -0,0 +1,17 @@
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<?ifndef Version?>
4<?define Version = 1.0.0.0?>
5<?endif?>
6
7<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
8 <Bundle Name="~$(var.TestGroupName) - Bundle A" Version="$(var.Version)" UpgradeCode="{A4456636-916A-43A0-87BF-A897C2717A00}" Compressed="yes">
9 <Log Prefix="~$(var.TestGroupName)_BundleA" />
10
11 <Variable Name="TestGroupName" Value="$(var.TestGroupName)" />
12
13 <Chain>
14 <PackageGroupRef Id="BundlePackages" />
15 </Chain>
16 </Bundle>
17</Include>
diff --git a/src/TestData/PrereqBa/BundleA/BundleA.wxs b/src/TestData/PrereqBa/BundleA/BundleA.wxs
new file mode 100644
index 00000000..53139834
--- /dev/null
+++ b/src/TestData/PrereqBa/BundleA/BundleA.wxs
@@ -0,0 +1,21 @@
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
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
5 <?include BundleA.wxi ?>
6 <Fragment>
7 <BootstrapperApplication>
8 <Payload SourceFile="!(bindpath.dnc5x86)\TestBA.deps.json" />
9 <Payload SourceFile="!(bindpath.dnc5x86)\TestBA.dll" bal:BAFactoryAssembly="yes" />
10 <Payload Name="TestBA.runtimeconfig.json" SourceFile="bad.runtimeconfig.json" />
11 <Payload SourceFile="!(bindpath.dnc5x86)\mbanative.dll" />
12 <Payload SourceFile="!(bindpath.dnc5x86)\WixToolset.Mba.Core.dll" />
13 <bal:WixDotNetCoreBootstrapperApplicationHost />
14 </BootstrapperApplication>
15
16 <PackageGroup Id="BundlePackages">
17 <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" />
18 <MsiPackage Id="PackageF" SourceFile="$(var.PackageF.TargetPath)" />
19 </PackageGroup>
20 </Fragment>
21</Wix>
diff --git a/src/TestData/PrereqBa/BundleA/bad.runtimeconfig.json b/src/TestData/PrereqBa/BundleA/bad.runtimeconfig.json
new file mode 100644
index 00000000..07a1a830
--- /dev/null
+++ b/src/TestData/PrereqBa/BundleA/bad.runtimeconfig.json
@@ -0,0 +1,10 @@
1{
2 "runtimeOptions": {
3 "tfm": "net5.5",
4 "rollForward": "Disable",
5 "framework": {
6 "name": "Microsoft.WindowsDesktop.App",
7 "version": "5.5.0"
8 }
9 }
10} \ No newline at end of file
diff --git a/src/TestData/PrereqBa/BundleB/BundleB.wixproj b/src/TestData/PrereqBa/BundleB/BundleB.wixproj
new file mode 100644
index 00000000..7d4d1ebd
--- /dev/null
+++ b/src/TestData/PrereqBa/BundleB/BundleB.wixproj
@@ -0,0 +1,16 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <OutputType>Bundle</OutputType>
5 </PropertyGroup>
6 <ItemGroup>
7 <BindInputPaths Include="$(OutputPath)..\net35\win-x86" BindName="net2x86" />
8 </ItemGroup>
9 <ItemGroup>
10 <ProjectReference Include="..\PackageB\PackageB.wixproj" />
11 <ProjectReference Include="..\PackageF\PackageF.wixproj" />
12 </ItemGroup>
13 <ItemGroup>
14 <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.77" />
15 </ItemGroup>
16</Project> \ No newline at end of file
diff --git a/src/TestData/PrereqBa/BundleB/BundleB.wxi b/src/TestData/PrereqBa/BundleB/BundleB.wxi
new file mode 100644
index 00000000..6bfeb213
--- /dev/null
+++ b/src/TestData/PrereqBa/BundleB/BundleB.wxi
@@ -0,0 +1,17 @@
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<?ifndef Version?>
4<?define Version = 1.0.0.0?>
5<?endif?>
6
7<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
8 <Bundle Name="~$(var.TestGroupName) - Bundle B" Version="$(var.Version)" UpgradeCode="{157A1FBA-3825-4AAA-B13D-F45435A79D64}" Compressed="yes">
9 <Log Prefix="~$(var.TestGroupName)_BundleB" />
10
11 <Variable Name="TestGroupName" Value="$(var.TestGroupName)" />
12
13 <Chain>
14 <PackageGroupRef Id="BundlePackages" />
15 </Chain>
16 </Bundle>
17</Include>
diff --git a/src/TestData/PrereqBa/BundleB/BundleB.wxs b/src/TestData/PrereqBa/BundleB/BundleB.wxs
new file mode 100644
index 00000000..57d8a552
--- /dev/null
+++ b/src/TestData/PrereqBa/BundleB/BundleB.wxs
@@ -0,0 +1,20 @@
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
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
5 <?include BundleB.wxi ?>
6 <Fragment>
7 <BootstrapperApplication>
8 <Payload Name="WixToolset.Mba.Host.config" SourceFile="bad.config" />
9 <Payload SourceFile="!(bindpath.net2x86)\TestBA.dll" />
10 <Payload SourceFile="!(bindpath.net2x86)\mbanative.dll" />
11 <Payload SourceFile="!(bindpath.net2x86)\WixToolset.Mba.Core.dll" />
12 <bal:WixManagedBootstrapperApplicationHost />
13 </BootstrapperApplication>
14
15 <PackageGroup Id="BundlePackages">
16 <MsiPackage Id="PackageB" SourceFile="$(var.PackageB.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" />
17 <MsiPackage Id="PackageF" SourceFile="$(var.PackageF.TargetPath)" />
18 </PackageGroup>
19 </Fragment>
20</Wix>
diff --git a/src/TestData/PrereqBa/BundleB/bad.config b/src/TestData/PrereqBa/BundleB/bad.config
new file mode 100644
index 00000000..1512e59a
--- /dev/null
+++ b/src/TestData/PrereqBa/BundleB/bad.config
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<!-- 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. -->
3
4
5<configuration>
6 <configSections>
7 <sectionGroup name="wix.bootstrapper" type="WixToolset.Mba.Host.BootstrapperSectionGroup, WixToolset.Mba.Host">
8 <section name="host" type="WixToolset.Mba.Host.HostSection, WixToolset.Mba.Host" />
9 </sectionGroup>
10 </configSections>
11 <startup>
12 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v5.8" />
13 </startup>
14 <wix.bootstrapper>
15 <host assemblyName="TestBA" />
16 </wix.bootstrapper>
17</configuration>
diff --git a/src/TestData/PrereqBa/PackageA/PackageA.wixproj b/src/TestData/PrereqBa/PackageA/PackageA.wixproj
new file mode 100644
index 00000000..d46982fa
--- /dev/null
+++ b/src/TestData/PrereqBa/PackageA/PackageA.wixproj
@@ -0,0 +1,9 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <UpgradeCode>{A13BFF68-61DF-4015-9AD1-03854B5E0212}</UpgradeCode>
5 </PropertyGroup>
6 <ItemGroup>
7 <Compile Include="..\..\Templates\Package.wxs" Link="Package.wxs" />
8 </ItemGroup>
9</Project> \ No newline at end of file
diff --git a/src/TestData/PrereqBa/PackageB/PackageB.wixproj b/src/TestData/PrereqBa/PackageB/PackageB.wixproj
new file mode 100644
index 00000000..d5edf338
--- /dev/null
+++ b/src/TestData/PrereqBa/PackageB/PackageB.wixproj
@@ -0,0 +1,9 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <UpgradeCode>{3DD4621A-F7AB-4548-89A8-6DCB0A9BC954}</UpgradeCode>
5 </PropertyGroup>
6 <ItemGroup>
7 <Compile Include="..\..\Templates\Package.wxs" Link="Package.wxs" />
8 </ItemGroup>
9</Project> \ No newline at end of file
diff --git a/src/TestData/PrereqBa/PackageF/PackageF.wixproj b/src/TestData/PrereqBa/PackageF/PackageF.wixproj
new file mode 100644
index 00000000..3d52e939
--- /dev/null
+++ b/src/TestData/PrereqBa/PackageF/PackageF.wixproj
@@ -0,0 +1,12 @@
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<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup>
4 <UpgradeCode>{7DEEE928-CD7F-49AD-8000-2ED6339D8A78}</UpgradeCode>
5 </PropertyGroup>
6 <ItemGroup>
7 <Compile Include="..\..\Templates\PackageFail.wxs" Link="PackageFail.wxs" />
8 </ItemGroup>
9 <ItemGroup>
10 <PackageReference Include="WixToolset.Util.wixext" Version="4.0.66" />
11 </ItemGroup>
12</Project> \ No newline at end of file
diff --git a/src/TestData/TestBA/TestBAWixlib/TestBA.wxs b/src/TestData/TestBA/TestBAWixlib/TestBA.wxs
index 56ddd1aa..348a0cbb 100644
--- a/src/TestData/TestBA/TestBAWixlib/TestBA.wxs
+++ b/src/TestData/TestBA/TestBAWixlib/TestBA.wxs
@@ -2,10 +2,24 @@
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> 2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
3 <Fragment> 3 <Fragment>
4 <BootstrapperApplication> 4 <BootstrapperApplication>
5 <Payload Name="WixToolset.Mba.Host.config" SourceFile="!(bindpath.x86)\TestBA.BootstrapperCore.config" /> 5 <Payload SourceFile="!(bindpath.dnc5x86)\TestBA.deps.json" />
6 <Payload SourceFile="!(bindpath.x86)\TestBA.dll" /> 6 <Payload SourceFile="!(bindpath.dnc5x86)\TestBA.dll" bal:BAFactoryAssembly="yes" />
7 <Payload SourceFile="!(bindpath.x86)\mbanative.dll" /> 7 <Payload SourceFile="!(bindpath.dnc5x86)\TestBA.runtimeconfig.json" />
8 <Payload SourceFile="!(bindpath.x86)\WixToolset.Mba.Core.dll" /> 8 <Payload SourceFile="!(bindpath.dnc5x86)\mbanative.dll" />
9 <Payload SourceFile="!(bindpath.dnc5x86)\WixToolset.Mba.Core.dll" />
10 <bal:WixDotNetCoreBootstrapperApplicationHost />
11 </BootstrapperApplication>
12
13 <PackageGroup Id="TestBAdnc">
14 <PackageGroupRef Id="NetFx48WebAsPrereq" /> <!-- Yes, this is wrong but we don't have .NET 5 packages yet -->
15 </PackageGroup>
16 </Fragment>
17 <Fragment>
18 <BootstrapperApplication>
19 <Payload Name="WixToolset.Mba.Host.config" SourceFile="!(bindpath.net2x86)\TestBA.BootstrapperCore.config" />
20 <Payload SourceFile="!(bindpath.net2x86)\TestBA.dll" />
21 <Payload SourceFile="!(bindpath.net2x86)\mbanative.dll" />
22 <Payload SourceFile="!(bindpath.net2x86)\WixToolset.Mba.Core.dll" />
9 <bal:WixManagedBootstrapperApplicationHost /> 23 <bal:WixManagedBootstrapperApplicationHost />
10 </BootstrapperApplication> 24 </BootstrapperApplication>
11 25
diff --git a/src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj b/src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj
index ee63707e..7dd1798c 100644
--- a/src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj
+++ b/src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj
@@ -6,7 +6,8 @@
6 <Cultures>en-us</Cultures> 6 <Cultures>en-us</Cultures>
7 </PropertyGroup> 7 </PropertyGroup>
8 <ItemGroup> 8 <ItemGroup>
9 <BindInputPaths Include="$(OutputPath)..\net35\win-x86" BindName="x86" /> 9 <BindInputPaths Include="$(OutputPath)..\net35\win-x86" BindName="net2x86" />
10 <BindInputPaths Include="$(OutputPath)..\net5.0-windows\win-x86" BindName="dnc5x86" />
10 </ItemGroup> 11 </ItemGroup>
11 <ItemGroup> 12 <ItemGroup>
12 <ProjectReference Include="..\..\..\Utilities\TestBA\TestBA.csproj" /> 13 <ProjectReference Include="..\..\..\Utilities\TestBA\TestBA.csproj" />
diff --git a/src/Utilities/TestBA/TestBA.csproj b/src/Utilities/TestBA/TestBA.csproj
index f23235b9..796a0dfd 100644
--- a/src/Utilities/TestBA/TestBA.csproj
+++ b/src/Utilities/TestBA/TestBA.csproj
@@ -3,22 +3,21 @@
3 3
4<Project Sdk="Microsoft.NET.Sdk"> 4<Project Sdk="Microsoft.NET.Sdk">
5 <PropertyGroup> 5 <PropertyGroup>
6 <TargetFramework>net35</TargetFramework> 6 <TargetFrameworks>net35;net5.0-windows</TargetFrameworks>
7 <AssemblyName>TestBA</AssemblyName> 7 <AssemblyName>TestBA</AssemblyName>
8 <RootNamespace>WixToolset.Test.BA</RootNamespace> 8 <RootNamespace>WixToolset.Test.BA</RootNamespace>
9 <DebugType>embedded</DebugType> 9 <DebugType>embedded</DebugType>
10 <RuntimeIdentifier>win-x86</RuntimeIdentifier> 10 <RuntimeIdentifier>win-x86</RuntimeIdentifier>
11 <EnableDynamicLoading>true</EnableDynamicLoading>
12 <UseWindowsForms>true</UseWindowsForms>
11 </PropertyGroup> 13 </PropertyGroup>
12 14
13 <ItemGroup> 15 <ItemGroup Condition=" '$(TargetFramework)'=='net35' ">
14 <Content Include="TestBA.BootstrapperCore.config" CopyToOutputDirectory="PreserveNewest" /> 16 <Content Include="TestBA.BootstrapperCore.config" CopyToOutputDirectory="PreserveNewest" />
17 <Reference Include="System.Windows.Forms" />
15 </ItemGroup> 18 </ItemGroup>
16 19
17 <ItemGroup> 20 <ItemGroup>
18 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.45" /> 21 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.45" />
19 </ItemGroup> 22 </ItemGroup>
20
21 <ItemGroup>
22 <Reference Include="System.Windows.Forms" />
23 </ItemGroup>
24</Project> \ No newline at end of file 23</Project> \ No newline at end of file
diff --git a/src/WixToolsetTest.BurnE2E/PrereqBaTests.cs b/src/WixToolsetTest.BurnE2E/PrereqBaTests.cs
new file mode 100644
index 00000000..c10736b1
--- /dev/null
+++ b/src/WixToolsetTest.BurnE2E/PrereqBaTests.cs
@@ -0,0 +1,76 @@
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
3namespace WixToolsetTest.BurnE2E
4{
5 using System;
6 using System.IO;
7 using Xunit;
8 using Xunit.Abstractions;
9
10 public class PrereqBaTests : BurnE2ETests
11 {
12 public PrereqBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper, "PrereqBa") { }
13
14 /// <summary>
15 /// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist,
16 /// with an MSI package to represent the prerequisite package.
17 /// This verifies that:
18 /// The preqba doesn't infinitely reload itself after failing to load the managed BA.
19 /// The engine automatically uninstalls the bundle since only permanent packages were installed.
20 /// </summary>
21 [Fact]
22 public void DncPreqBaDetectsInfiniteLoop()
23 {
24 var packageA = this.CreatePackageInstaller("PackageA");
25 this.CreatePackageInstaller("PackageF");
26
27 var bundleA = this.CreateBundleInstaller("BundleA");
28
29 var packageASourceCodeInstalled = packageA.GetInstalledFilePath("Package.wxs");
30
31 // Source file should *not* be installed
32 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}");
33
34 bundleA.Install();
35
36 // Part of the test is Install actually completing.
37
38 // Source file should be installed
39 Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled));
40
41 // No non-permanent packages should have ended up installed or cached so it should have unregistered.
42 bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
43 }
44
45 /// <summary>
46 /// This bundle purposely provides a WixToolset.Mba.Host.config file that requires a version of .NET Framework that doesn't exist,
47 /// with an MSI package to represent the prerequisite package.
48 /// This verifies that:
49 /// The preqba doesn't infinitely reload itself after failing to load the managed BA.
50 /// The engine automatically uninstalls the bundle since only permanent packages were installed.
51 /// </summary>
52 [Fact]
53 public void MbaPreqBaDetectsInfiniteLoop()
54 {
55 var packageB = this.CreatePackageInstaller("PackageB");
56 this.CreatePackageInstaller("PackageF");
57
58 var bundleB = this.CreateBundleInstaller("BundleB");
59
60 var packageBSourceCodeInstalled = packageB.GetInstalledFilePath("Package.wxs");
61
62 // Source file should *not* be installed
63 Assert.False(File.Exists(packageBSourceCodeInstalled), $"Package B payload should not be there on test start: {packageBSourceCodeInstalled}");
64
65 bundleB.Install();
66
67 // Part of the test is Install actually completing.
68
69 // Source file should be installed
70 Assert.True(File.Exists(packageBSourceCodeInstalled), String.Concat("Should have found Package B payload installed at: ", packageBSourceCodeInstalled));
71
72 // No non-permanent packages should have ended up installed or cached so it should have unregistered.
73 bundleB.VerifyUnregisteredAndRemovedFromPackageCache();
74 }
75 }
76}