diff options
-rw-r--r-- | global.json | 2 | ||||
-rw-r--r-- | src/TestData/PrereqBaTests/BundleA/BundleA.wxs | 2 | ||||
-rw-r--r-- | src/TestData/RegistrationTests/BundleA/BundleA.wixproj | 18 | ||||
-rw-r--r-- | src/TestData/RegistrationTests/BundleA/BundleA.wxs | 10 | ||||
-rw-r--r-- | src/TestData/RegistrationTests/PackageA/PackageA.wixproj | 9 | ||||
-rw-r--r-- | src/Utilities/TestBA/TestBA.cs | 82 | ||||
-rw-r--r-- | src/WixToolsetTest.BurnE2E/BundleVerifier.cs | 26 | ||||
-rw-r--r-- | src/WixToolsetTest.BurnE2E/BurnE2ETests.cs | 10 | ||||
-rw-r--r-- | src/WixToolsetTest.BurnE2E/PackageInstaller.cs | 4 | ||||
-rw-r--r-- | src/WixToolsetTest.BurnE2E/PrereqBaTests.cs | 4 | ||||
-rw-r--r-- | src/WixToolsetTest.BurnE2E/RegistrationTests.cs | 51 | ||||
-rw-r--r-- | src/WixToolsetTest.BurnE2E/TestBAController.cs | 10 |
12 files changed, 193 insertions, 35 deletions
diff --git a/global.json b/global.json index f227ec06..71e4088d 100644 --- a/global.json +++ b/global.json | |||
@@ -1,6 +1,6 @@ | |||
1 | { | 1 | { |
2 | "msbuild-sdks": { | 2 | "msbuild-sdks": { |
3 | "WixToolset.Sdk": "4.0.0-build-0186" | 3 | "WixToolset.Sdk": "4.0.0-build-0187" |
4 | }, | 4 | }, |
5 | "sdk": { | 5 | "sdk": { |
6 | "allowPrerelease": false | 6 | "allowPrerelease": false |
diff --git a/src/TestData/PrereqBaTests/BundleA/BundleA.wxs b/src/TestData/PrereqBaTests/BundleA/BundleA.wxs index 0c9e8d21..c903988b 100644 --- a/src/TestData/PrereqBaTests/BundleA/BundleA.wxs +++ b/src/TestData/PrereqBaTests/BundleA/BundleA.wxs | |||
@@ -16,7 +16,7 @@ | |||
16 | <Fragment> | 16 | <Fragment> |
17 | <PackageGroup Id="BundlePackages"> | 17 | <PackageGroup Id="BundlePackages"> |
18 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" /> | 18 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" /> |
19 | <MsiPackage Id="PackageF" SourceFile="$(var.PackageF.TargetPath)" /> | 19 | <MsiPackage Id="PackageF" SourceFile="$(var.PackageF.TargetPath)" Cache="always" /> |
20 | </PackageGroup> | 20 | </PackageGroup> |
21 | </Fragment> | 21 | </Fragment> |
22 | </Wix> | 22 | </Wix> |
diff --git a/src/TestData/RegistrationTests/BundleA/BundleA.wixproj b/src/TestData/RegistrationTests/BundleA/BundleA.wixproj new file mode 100644 index 00000000..313ffec9 --- /dev/null +++ b/src/TestData/RegistrationTests/BundleA/BundleA.wixproj | |||
@@ -0,0 +1,18 @@ | |||
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 | <UpgradeCode>{17041020-8A61-4A3B-8FDB-4591CB900049}</UpgradeCode> | ||
6 | </PropertyGroup> | ||
7 | <ItemGroup> | ||
8 | <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> | ||
9 | </ItemGroup> | ||
10 | <ItemGroup> | ||
11 | <ProjectReference Include="..\PackageA\PackageA.wixproj" /> | ||
12 | <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" /> | ||
13 | </ItemGroup> | ||
14 | <ItemGroup> | ||
15 | <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.82" /> | ||
16 | <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.59" /> | ||
17 | </ItemGroup> | ||
18 | </Project> \ No newline at end of file | ||
diff --git a/src/TestData/RegistrationTests/BundleA/BundleA.wxs b/src/TestData/RegistrationTests/BundleA/BundleA.wxs new file mode 100644 index 00000000..bd164a29 --- /dev/null +++ b/src/TestData/RegistrationTests/BundleA/BundleA.wxs | |||
@@ -0,0 +1,10 @@ | |||
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"> | ||
5 | <Fragment> | ||
6 | <PackageGroup Id="BundlePackages"> | ||
7 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" /> | ||
8 | </PackageGroup> | ||
9 | </Fragment> | ||
10 | </Wix> | ||
diff --git a/src/TestData/RegistrationTests/PackageA/PackageA.wixproj b/src/TestData/RegistrationTests/PackageA/PackageA.wixproj new file mode 100644 index 00000000..7e5dbb8c --- /dev/null +++ b/src/TestData/RegistrationTests/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>{BF26D3E4-1D6B-480E-B312-3FECE6363E43}</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/Utilities/TestBA/TestBA.cs b/src/Utilities/TestBA/TestBA.cs index c68c2b61..1348ce98 100644 --- a/src/Utilities/TestBA/TestBA.cs +++ b/src/Utilities/TestBA/TestBA.cs | |||
@@ -18,14 +18,17 @@ namespace WixToolset.Test.BA | |||
18 | { | 18 | { |
19 | private const string BurnBundleVersionVariable = "WixBundleVersion"; | 19 | private const string BurnBundleVersionVariable = "WixBundleVersion"; |
20 | 20 | ||
21 | private ApplicationContext appContext; | ||
22 | private Form dummyWindow; | 21 | private Form dummyWindow; |
22 | private IntPtr windowHandle; | ||
23 | private LaunchAction action; | 23 | private LaunchAction action; |
24 | private ManualResetEvent wait; | ||
24 | private int result; | 25 | private int result; |
25 | 26 | ||
26 | private string updateBundlePath; | 27 | private string updateBundlePath; |
27 | 28 | ||
28 | private int redetectCount; | 29 | private bool immediatelyQuit; |
30 | private bool quitAfterDetect; | ||
31 | private int redetectRemaining; | ||
29 | private int sleepDuringCache; | 32 | private int sleepDuringCache; |
30 | private int cancelCacheAtProgress; | 33 | private int cancelCacheAtProgress; |
31 | private int sleepDuringExecute; | 34 | private int sleepDuringExecute; |
@@ -45,6 +48,7 @@ namespace WixToolset.Test.BA | |||
45 | : base(engine) | 48 | : base(engine) |
46 | { | 49 | { |
47 | this.Command = bootstrapperCommand; | 50 | this.Command = bootstrapperCommand; |
51 | this.wait = new ManualResetEvent(false); | ||
48 | } | 52 | } |
49 | 53 | ||
50 | /// <summary> | 54 | /// <summary> |
@@ -60,8 +64,17 @@ namespace WixToolset.Test.BA | |||
60 | /// <summary> | 64 | /// <summary> |
61 | /// UI Thread entry point for TestUX. | 65 | /// UI Thread entry point for TestUX. |
62 | /// </summary> | 66 | /// </summary> |
63 | protected override void Run() | 67 | protected override void OnStartup(StartupEventArgs args) |
64 | { | 68 | { |
69 | string immediatelyQuit = this.ReadPackageAction(null, "ImmediatelyQuit"); | ||
70 | if (!String.IsNullOrEmpty(immediatelyQuit) && Boolean.TryParse(immediatelyQuit, out this.immediatelyQuit) && this.immediatelyQuit) | ||
71 | { | ||
72 | this.Engine.Quit(0); | ||
73 | return; | ||
74 | } | ||
75 | |||
76 | base.OnStartup(args); | ||
77 | |||
65 | this.action = this.Command.Action; | 78 | this.action = this.Command.Action; |
66 | this.TestVariables(); | 79 | this.TestVariables(); |
67 | 80 | ||
@@ -102,20 +115,46 @@ namespace WixToolset.Test.BA | |||
102 | return; | 115 | return; |
103 | } | 116 | } |
104 | 117 | ||
105 | this.dummyWindow = new Form(); | 118 | int redetectCount; |
106 | this.dummyWindow.CreateControl(); | ||
107 | this.appContext = new ApplicationContext(); | ||
108 | |||
109 | this.redetectCount = 0; | ||
110 | string redetect = this.ReadPackageAction(null, "RedetectCount"); | 119 | string redetect = this.ReadPackageAction(null, "RedetectCount"); |
111 | if (String.IsNullOrEmpty(redetect) || !Int32.TryParse(redetect, out this.redetectCount)) | 120 | if (String.IsNullOrEmpty(redetect) || !Int32.TryParse(redetect, out redetectCount)) |
121 | { | ||
122 | redetectCount = 0; | ||
123 | } | ||
124 | |||
125 | string quitAfterDetect = this.ReadPackageAction(null, "QuitAfterDetect"); | ||
126 | if (String.IsNullOrEmpty(quitAfterDetect) || !Boolean.TryParse(quitAfterDetect, out this.quitAfterDetect)) | ||
112 | { | 127 | { |
113 | this.redetectCount = 0; | 128 | this.quitAfterDetect = false; |
114 | } | 129 | } |
115 | 130 | ||
116 | this.Engine.Detect(); | 131 | this.wait.WaitOne(); |
132 | |||
133 | this.redetectRemaining = redetectCount; | ||
134 | for (int i = -1; i < redetectCount; i++) | ||
135 | { | ||
136 | this.Engine.Detect(this.windowHandle); | ||
137 | } | ||
138 | } | ||
139 | |||
140 | protected override void Run() | ||
141 | { | ||
142 | this.dummyWindow = new Form(); | ||
143 | this.windowHandle = this.dummyWindow.Handle; | ||
144 | |||
145 | this.Log("Running TestBA application"); | ||
146 | this.wait.Set(); | ||
147 | Application.Run(); | ||
148 | } | ||
149 | |||
150 | private void ShutdownUiThread() | ||
151 | { | ||
152 | if (this.dummyWindow != null) | ||
153 | { | ||
154 | this.dummyWindow.Invoke(new Action(Application.ExitThread)); | ||
155 | this.dummyWindow.Dispose(); | ||
156 | } | ||
117 | 157 | ||
118 | Application.Run(this.appContext); | ||
119 | this.Engine.Quit(this.result & 0xFFFF); // return plain old Win32 error, not HRESULT. | 158 | this.Engine.Quit(this.result & 0xFFFF); // return plain old Win32 error, not HRESULT. |
120 | } | 159 | } |
121 | 160 | ||
@@ -167,10 +206,13 @@ namespace WixToolset.Test.BA | |||
167 | if (Hresult.Succeeded(this.result) && | 206 | if (Hresult.Succeeded(this.result) && |
168 | (this.UpdateAvailable || LaunchAction.UpdateReplaceEmbedded != this.action && LaunchAction.UpdateReplace != this.action)) | 207 | (this.UpdateAvailable || LaunchAction.UpdateReplaceEmbedded != this.action && LaunchAction.UpdateReplace != this.action)) |
169 | { | 208 | { |
170 | if (this.redetectCount > 0) | 209 | if (this.redetectRemaining > 0) |
210 | { | ||
211 | this.Log("Completed detection phase: {0} re-runs remaining", this.redetectRemaining--); | ||
212 | } | ||
213 | else if (this.quitAfterDetect) | ||
171 | { | 214 | { |
172 | this.Log("Completed detection phase: {0} re-runs remaining", this.redetectCount--); | 215 | this.ShutdownUiThread(); |
173 | this.Engine.Detect(); | ||
174 | } | 216 | } |
175 | else | 217 | else |
176 | { | 218 | { |
@@ -179,7 +221,7 @@ namespace WixToolset.Test.BA | |||
179 | } | 221 | } |
180 | else | 222 | else |
181 | { | 223 | { |
182 | this.appContext.ExitThread(); | 224 | this.ShutdownUiThread(); |
183 | } | 225 | } |
184 | } | 226 | } |
185 | 227 | ||
@@ -218,11 +260,11 @@ namespace WixToolset.Test.BA | |||
218 | this.result = args.Status; | 260 | this.result = args.Status; |
219 | if (Hresult.Succeeded(this.result)) | 261 | if (Hresult.Succeeded(this.result)) |
220 | { | 262 | { |
221 | this.Engine.Apply(this.dummyWindow.Handle); | 263 | this.Engine.Apply(this.windowHandle); |
222 | } | 264 | } |
223 | else | 265 | else |
224 | { | 266 | { |
225 | this.appContext.ExitThread(); | 267 | this.ShutdownUiThread(); |
226 | } | 268 | } |
227 | } | 269 | } |
228 | 270 | ||
@@ -402,7 +444,7 @@ namespace WixToolset.Test.BA | |||
402 | this.Log("After elevation: WixBundleElevated = {0}", this.Engine.GetVariableNumeric("WixBundleElevated")); | 444 | this.Log("After elevation: WixBundleElevated = {0}", this.Engine.GetVariableNumeric("WixBundleElevated")); |
403 | 445 | ||
404 | this.result = args.Status; | 446 | this.result = args.Status; |
405 | this.appContext.ExitThread(); | 447 | this.ShutdownUiThread(); |
406 | } | 448 | } |
407 | 449 | ||
408 | protected override void OnSystemShutdown(SystemShutdownEventArgs args) | 450 | protected override void OnSystemShutdown(SystemShutdownEventArgs args) |
@@ -411,7 +453,7 @@ namespace WixToolset.Test.BA | |||
411 | this.Log("Disallowed system request to shut down the bootstrapper application."); | 453 | this.Log("Disallowed system request to shut down the bootstrapper application."); |
412 | args.Cancel = true; | 454 | args.Cancel = true; |
413 | 455 | ||
414 | this.appContext.ExitThread(); | 456 | this.ShutdownUiThread(); |
415 | } | 457 | } |
416 | 458 | ||
417 | private void TestVariables() | 459 | private void TestVariables() |
diff --git a/src/WixToolsetTest.BurnE2E/BundleVerifier.cs b/src/WixToolsetTest.BurnE2E/BundleVerifier.cs index 94d51890..98ec96a0 100644 --- a/src/WixToolsetTest.BurnE2E/BundleVerifier.cs +++ b/src/WixToolsetTest.BurnE2E/BundleVerifier.cs | |||
@@ -33,14 +33,19 @@ namespace WixToolsetTest.BurnE2E | |||
33 | return this.BundleSymbol; | 33 | return this.BundleSymbol; |
34 | } | 34 | } |
35 | 35 | ||
36 | public string GetExpectedCachedBundlePath() | 36 | public string GetPackageCachePathForCacheId(string cacheId) |
37 | { | 37 | { |
38 | var bundleSymbol = this.GetBundleSymbol(); | ||
39 | |||
40 | using var policyKey = Registry.LocalMachine.OpenSubKey(FULL_BURN_POLICY_REGISTRY_PATH); | 38 | using var policyKey = Registry.LocalMachine.OpenSubKey(FULL_BURN_POLICY_REGISTRY_PATH); |
41 | var redirectedCachePath = policyKey?.GetValue("PackageCache") as string; | 39 | var redirectedCachePath = policyKey?.GetValue("PackageCache") as string; |
42 | var cachePath = redirectedCachePath ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), PACKAGE_CACHE_FOLDER_NAME); | 40 | var cachePath = redirectedCachePath ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), PACKAGE_CACHE_FOLDER_NAME); |
43 | return Path.Combine(cachePath, bundleSymbol.BundleId, Path.GetFileName(this.Bundle)); | 41 | return Path.Combine(cachePath, cacheId); |
42 | } | ||
43 | |||
44 | public string GetExpectedCachedBundlePath() | ||
45 | { | ||
46 | var bundleSymbol = this.GetBundleSymbol(); | ||
47 | var cachePath = this.GetPackageCachePathForCacheId(bundleSymbol.BundleId); | ||
48 | return Path.Combine(cachePath, Path.GetFileName(this.Bundle)); | ||
44 | } | 49 | } |
45 | 50 | ||
46 | public bool TryGetPerMachineRegistration(out BundleRegistration registration) | 51 | public bool TryGetPerMachineRegistration(out BundleRegistration registration) |
@@ -74,5 +79,18 @@ namespace WixToolsetTest.BurnE2E | |||
74 | Assert.False(this.TryGetPerMachineRegistration(out _)); | 79 | Assert.False(this.TryGetPerMachineRegistration(out _)); |
75 | Assert.False(File.Exists(cachedBundlePath)); | 80 | Assert.False(File.Exists(cachedBundlePath)); |
76 | } | 81 | } |
82 | |||
83 | public void RemovePackageFromCache(string packageId) | ||
84 | { | ||
85 | using var wixOutput = WixOutput.Read(this.BundlePdb); | ||
86 | var intermediate = Intermediate.Load(wixOutput); | ||
87 | var section = intermediate.Sections.Single(); | ||
88 | var packageSymbol = section.Symbols.OfType<WixBundlePackageSymbol>().Single(p => p.Id.Id == packageId); | ||
89 | var cachePath = this.GetPackageCachePathForCacheId(packageSymbol.CacheId); | ||
90 | if (Directory.Exists(cachePath)) | ||
91 | { | ||
92 | Directory.Delete(cachePath, true); | ||
93 | } | ||
94 | } | ||
77 | } | 95 | } |
78 | } | 96 | } |
diff --git a/src/WixToolsetTest.BurnE2E/BurnE2ETests.cs b/src/WixToolsetTest.BurnE2E/BurnE2ETests.cs index f3b3e583..d3400658 100644 --- a/src/WixToolsetTest.BurnE2E/BurnE2ETests.cs +++ b/src/WixToolsetTest.BurnE2E/BurnE2ETests.cs | |||
@@ -12,32 +12,32 @@ namespace WixToolsetTest.BurnE2E | |||
12 | { | 12 | { |
13 | protected BurnE2ETests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } | 13 | protected BurnE2ETests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } |
14 | 14 | ||
15 | private Queue<IDisposable> Installers { get; } = new Queue<IDisposable>(); | 15 | private Stack<IDisposable> Installers { get; } = new Stack<IDisposable>(); |
16 | 16 | ||
17 | protected BundleInstaller CreateBundleInstaller(string name) | 17 | protected BundleInstaller CreateBundleInstaller(string name) |
18 | { | 18 | { |
19 | var installer = new BundleInstaller(this.TestContext, name); | 19 | var installer = new BundleInstaller(this.TestContext, name); |
20 | this.Installers.Enqueue(installer); | 20 | this.Installers.Push(installer); |
21 | return installer; | 21 | return installer; |
22 | } | 22 | } |
23 | 23 | ||
24 | protected PackageInstaller CreatePackageInstaller(string filename) | 24 | protected PackageInstaller CreatePackageInstaller(string filename) |
25 | { | 25 | { |
26 | var installer = new PackageInstaller(this.TestContext, filename); | 26 | var installer = new PackageInstaller(this.TestContext, filename); |
27 | this.Installers.Enqueue(installer); | 27 | this.Installers.Push(installer); |
28 | return installer; | 28 | return installer; |
29 | } | 29 | } |
30 | 30 | ||
31 | protected TestBAController CreateTestBAController() | 31 | protected TestBAController CreateTestBAController() |
32 | { | 32 | { |
33 | var controller = new TestBAController(this.TestContext); | 33 | var controller = new TestBAController(this.TestContext); |
34 | this.Installers.Enqueue(controller); | 34 | this.Installers.Push(controller); |
35 | return controller; | 35 | return controller; |
36 | } | 36 | } |
37 | 37 | ||
38 | public void Dispose() | 38 | public void Dispose() |
39 | { | 39 | { |
40 | while (this.Installers.TryDequeue(out var installer)) | 40 | while (this.Installers.TryPop(out var installer)) |
41 | { | 41 | { |
42 | try | 42 | try |
43 | { | 43 | { |
diff --git a/src/WixToolsetTest.BurnE2E/PackageInstaller.cs b/src/WixToolsetTest.BurnE2E/PackageInstaller.cs index bd1e30cc..c3516fe7 100644 --- a/src/WixToolsetTest.BurnE2E/PackageInstaller.cs +++ b/src/WixToolsetTest.BurnE2E/PackageInstaller.cs | |||
@@ -40,7 +40,7 @@ namespace WixToolsetTest.BurnE2E | |||
40 | /// <param name="expectedExitCode">Expected exit code</param> | 40 | /// <param name="expectedExitCode">Expected exit code</param> |
41 | /// <param name="otherArguments">Other arguments to pass to MSIExec.</param> | 41 | /// <param name="otherArguments">Other arguments to pass to MSIExec.</param> |
42 | /// <returns>MSIExec log File</returns> | 42 | /// <returns>MSIExec log File</returns> |
43 | public string UninstallProduct(MSIExecReturnCode expectedExitCode, params string[] otherArguments) | 43 | public string UninstallProduct(MSIExecReturnCode expectedExitCode = MSIExecReturnCode.SUCCESS, params string[] otherArguments) |
44 | { | 44 | { |
45 | return this.RunMSIExec(MSIExecMode.Uninstall, otherArguments, expectedExitCode); | 45 | return this.RunMSIExec(MSIExecMode.Uninstall, otherArguments, expectedExitCode); |
46 | } | 46 | } |
@@ -51,7 +51,7 @@ namespace WixToolsetTest.BurnE2E | |||
51 | /// <param name="expectedExitCode">Expected exit code</param> | 51 | /// <param name="expectedExitCode">Expected exit code</param> |
52 | /// <param name="otherArguments">Other arguments to pass to msiexe.exe.</param> | 52 | /// <param name="otherArguments">Other arguments to pass to msiexe.exe.</param> |
53 | /// <returns>MSIExec log File</returns> | 53 | /// <returns>MSIExec log File</returns> |
54 | public string RepairProduct(MSIExecReturnCode expectedExitCode, params string[] otherArguments) | 54 | public string RepairProduct(MSIExecReturnCode expectedExitCode = MSIExecReturnCode.SUCCESS, params string[] otherArguments) |
55 | { | 55 | { |
56 | return this.RunMSIExec(MSIExecMode.Repair, otherArguments, expectedExitCode); | 56 | return this.RunMSIExec(MSIExecMode.Repair, otherArguments, expectedExitCode); |
57 | } | 57 | } |
diff --git a/src/WixToolsetTest.BurnE2E/PrereqBaTests.cs b/src/WixToolsetTest.BurnE2E/PrereqBaTests.cs index b07b3aec..ced2e08e 100644 --- a/src/WixToolsetTest.BurnE2E/PrereqBaTests.cs +++ b/src/WixToolsetTest.BurnE2E/PrereqBaTests.cs | |||
@@ -18,7 +18,7 @@ namespace WixToolsetTest.BurnE2E | |||
18 | /// The preqba doesn't infinitely reload itself after failing to load the managed BA. | 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. | 19 | /// The engine automatically uninstalls the bundle since only permanent packages were installed. |
20 | /// </summary> | 20 | /// </summary> |
21 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6297")] | 21 | [Fact] |
22 | public void DncPreqBaDetectsInfiniteLoop() | 22 | public void DncPreqBaDetectsInfiniteLoop() |
23 | { | 23 | { |
24 | var packageA = this.CreatePackageInstaller("PackageA"); | 24 | var packageA = this.CreatePackageInstaller("PackageA"); |
@@ -49,7 +49,7 @@ namespace WixToolsetTest.BurnE2E | |||
49 | /// The preqba doesn't infinitely reload itself after failing to load the managed BA. | 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. | 50 | /// The engine automatically uninstalls the bundle since only permanent packages were installed. |
51 | /// </summary> | 51 | /// </summary> |
52 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6297")] | 52 | [Fact] |
53 | public void MbaPreqBaDetectsInfiniteLoop() | 53 | public void MbaPreqBaDetectsInfiniteLoop() |
54 | { | 54 | { |
55 | var packageB = this.CreatePackageInstaller("PackageB"); | 55 | var packageB = this.CreatePackageInstaller("PackageB"); |
diff --git a/src/WixToolsetTest.BurnE2E/RegistrationTests.cs b/src/WixToolsetTest.BurnE2E/RegistrationTests.cs new file mode 100644 index 00000000..640b5085 --- /dev/null +++ b/src/WixToolsetTest.BurnE2E/RegistrationTests.cs | |||
@@ -0,0 +1,51 @@ | |||
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.BurnE2E | ||
4 | { | ||
5 | using System; | ||
6 | using Xunit; | ||
7 | using Xunit.Abstractions; | ||
8 | |||
9 | public class RegistrationTests : BurnE2ETests | ||
10 | { | ||
11 | public RegistrationTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } | ||
12 | |||
13 | [Fact] | ||
14 | public void AutomaticallyUninstallsBundleWithoutBADoingApply() | ||
15 | { | ||
16 | this.InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(true); | ||
17 | } | ||
18 | |||
19 | [Fact] | ||
20 | public void AutomaticallyUninstallsBundleWithoutBADoingDetect() | ||
21 | { | ||
22 | this.InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(false); | ||
23 | } | ||
24 | |||
25 | private void InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(bool detect) | ||
26 | { | ||
27 | var packageA = this.CreatePackageInstaller("PackageA"); | ||
28 | var bundleA = this.CreateBundleInstaller("BundleA"); | ||
29 | var testBAController = this.CreateTestBAController(); | ||
30 | |||
31 | bundleA.Install(); | ||
32 | bundleA.VerifyRegisteredAndInPackageCache(); | ||
33 | packageA.VerifyInstalled(true); | ||
34 | |||
35 | packageA.UninstallProduct(); | ||
36 | bundleA.RemovePackageFromCache("PackageA"); | ||
37 | |||
38 | if (detect) | ||
39 | { | ||
40 | testBAController.SetQuitAfterDetect(); | ||
41 | } | ||
42 | else | ||
43 | { | ||
44 | testBAController.SetImmediatelyQuit(); | ||
45 | } | ||
46 | bundleA.Install(); | ||
47 | packageA.VerifyInstalled(false); | ||
48 | bundleA.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
49 | } | ||
50 | } | ||
51 | } | ||
diff --git a/src/WixToolsetTest.BurnE2E/TestBAController.cs b/src/WixToolsetTest.BurnE2E/TestBAController.cs index 54a81b46..91d1b817 100644 --- a/src/WixToolsetTest.BurnE2E/TestBAController.cs +++ b/src/WixToolsetTest.BurnE2E/TestBAController.cs | |||
@@ -40,6 +40,16 @@ namespace WixToolsetTest.BurnE2E | |||
40 | } | 40 | } |
41 | } | 41 | } |
42 | 42 | ||
43 | public void SetImmediatelyQuit(string value = "true") | ||
44 | { | ||
45 | this.SetBurnTestValue("ImmediatelyQuit", value); | ||
46 | } | ||
47 | |||
48 | public void SetQuitAfterDetect(string value = "true") | ||
49 | { | ||
50 | this.SetBurnTestValue("QuitAfterDetect", value); | ||
51 | } | ||
52 | |||
43 | /// <summary> | 53 | /// <summary> |
44 | /// Slows the cache progress of a package. | 54 | /// Slows the cache progress of a package. |
45 | /// </summary> | 55 | /// </summary> |