| 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 WixTestTools; |
| 6 | using Xunit; |
| 7 | using Xunit.Abstractions; |
| 8 | |
| 9 | public class WixIuiBaTests : BurnE2ETests |
| 10 | { |
| 11 | public WixIuiBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } |
| 12 | |
| 13 | [RuntimeFact] |
| 14 | public void CanInstallArchitectureSpecificPrimaryPackage() |
| 15 | { |
| 16 | var defaultPackage = this.CreatePackageInstaller("InternalUIPackage"); |
| 17 | var x86Package = this.CreatePackageInstaller("InternalUIx86Package"); |
| 18 | var x64Package = this.CreatePackageInstaller("InternalUIx64Package"); |
| 19 | var arm64Package = this.CreatePackageInstaller("InternalUIarm64Package"); |
| 20 | var bundle = this.CreateBundleInstaller("ArchSpecificBundle"); |
| 21 | |
| 22 | defaultPackage.VerifyInstalled(false); |
| 23 | x86Package.VerifyInstalled(false); |
| 24 | x64Package.VerifyInstalled(false); |
| 25 | arm64Package.VerifyInstalled(false); |
| 26 | bundle.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 27 | |
| 28 | bundle.Install(); |
| 29 | bundle.VerifyRegisteredAndInPackageCache(); |
| 30 | defaultPackage.VerifyInstalled(false); |
| 31 | |
| 32 | var archSpecificInstalls = 0; |
| 33 | if (x86Package.IsInstalled()) |
| 34 | { |
| 35 | ++archSpecificInstalls; |
| 36 | } |
| 37 | |
| 38 | if (x64Package.IsInstalled()) |
| 39 | { |
| 40 | ++archSpecificInstalls; |
| 41 | } |
| 42 | |
| 43 | if (arm64Package.IsInstalled()) |
| 44 | { |
| 45 | ++archSpecificInstalls; |
| 46 | } |
| 47 | |
| 48 | Assert.Equal(1, archSpecificInstalls); |
| 49 | |
| 50 | bundle.Uninstall(); |
| 51 | bundle.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 52 | defaultPackage.VerifyInstalled(false); |
| 53 | x86Package.VerifyInstalled(false); |
| 54 | x64Package.VerifyInstalled(false); |
| 55 | arm64Package.VerifyInstalled(false); |
| 56 | } |
| 57 | |
| 58 | [RuntimeFact] |
| 59 | public void CanSilentlyInstallAndUninstallEmbeddedUIBundle() |
| 60 | { |
| 61 | var prereqPackage = this.CreatePackageInstaller("InternalUIPackage"); |
| 62 | var package = this.CreatePackageInstaller("EmbeddedUIPackage"); |
| 63 | var bundle = this.CreateBundleInstaller("EmbeddedUIBundle"); |
| 64 | |
| 65 | prereqPackage.VerifyInstalled(false); |
| 66 | package.VerifyInstalled(false); |
| 67 | bundle.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 68 | |
| 69 | bundle.Install(); |
| 70 | bundle.VerifyRegisteredAndInPackageCache(); |
| 71 | prereqPackage.VerifyInstalled(true); |
| 72 | package.VerifyInstalled(true); |
| 73 | |
| 74 | bundle.Uninstall(); |
| 75 | bundle.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 76 | prereqPackage.VerifyInstalled(true); |
| 77 | package.VerifyInstalled(false); |
| 78 | } |
| 79 | |
| 80 | [RuntimeFact] |
| 81 | public void CanSilentlyInstallAndUninstallInternalUIBundle() |
| 82 | { |
| 83 | var package = this.CreatePackageInstaller("InternalUIPackage"); |
| 84 | var bundle = this.CreateBundleInstaller("InternalUIBundle"); |
| 85 | |
| 86 | package.VerifyInstalled(false); |
| 87 | bundle.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 88 | |
| 89 | bundle.Install(); |
| 90 | bundle.VerifyRegisteredAndInPackageCache(); |
| 91 | package.VerifyInstalled(true); |
| 92 | |
| 93 | bundle.Uninstall(); |
| 94 | bundle.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 95 | package.VerifyInstalled(false); |
| 96 | } |
| 97 | |
| 98 | // Manual test for EmbeddedUIBundle: |
| 99 | // 1. Double click EmbeddedUIBundle.exe. |
| 100 | // 2. Verify that the prereq BA came up and click the install button (allow elevation). |
| 101 | // 3. Verify that the prereq BA automatically closed after installing the prereq. |
| 102 | // 4. Verify that the MSI UI came up and click the install button. |
| 103 | // 5. After it's finished, click the exit button. |
| 104 | // 6. Verify that no other UI is shown and that everything was installed. |
| 105 | // 7. Double click EmbeddedUIBundle.exe (allow elevation). |
| 106 | // 8. Verify that the prereq BA did not come up. |
| 107 | // 9. Verify that the MSI UI came up and click the uninstall button. |
| 108 | // 10. After it's finished, click the exit button. |
| 109 | // 11. Verify that no other UI is shown and that everything was uninstalled except for the prereq which was permanent. |
| 110 | // 12. Uninstall InternalUIPackage to make sure the machine is clean for other tests. |
| 111 | |
| 112 | // Alternate EmbeddedUIBundle test - manually install InternalUIPackage first and verify that the prereq BA doesn't come up during install either. |
| 113 | |
| 114 | // Manual test for InternalUIBundle: |
| 115 | // 1. Double click InternalUIBundle.exe on a machine that will prompt for elevation. |
| 116 | // 2. Verify that the splash screen appeared but the prereq BA did not come up. |
| 117 | // 3. Verify that the elevation prompt came up immediately instead of flashing on the taskbar. |
| 118 | // 4. Allow elevation. |
| 119 | // 5. Verify that the MSI UI came up and the splash screen disappeared. |
| 120 | // 6. Accept the two CA messages and click the install button. |
| 121 | // 7. After it's finished, click the exit button. |
| 122 | // 8. Verify that no other UI is shown and that everything was installed. |
| 123 | // 9. Double click InternalUIBundle.exe (allow elevation). |
| 124 | // 10. Verify that the prereq BA did not come up. |
| 125 | // 11. Verify that the MSI UI came up and click the uninstall button. |
| 126 | // 12. After it's finished, click the exit button. |
| 127 | // 13. Verify that no other UI is shown and that everything was uninstalled to make sure the machine is clean for other tests. |
| 128 | |
| 129 | // Manual test for Help: |
| 130 | // 1. Run EmbeddedUIBundle.exe /help from the command line. |
| 131 | // 2. Verify that the prereq BA shows the help information without trying to install the prereqs. |
| 132 | |
| 133 | // Manual test for Layout: |
| 134 | // 1. Run EmbeddedUIBundle.exe /layout from an unelevated command line on a machine that will prompt for elevation. |
| 135 | // 2. Verify that the prereq BA performs the layout without requiring any input from the user. |
| 136 | // 3. Verify that it never prompted for elevation. |
| 137 | // 4. Click the exit button. |
| 138 | |
| 139 | // Manual test for Caching error: |
| 140 | // 1. Copy InternalUIBundle.exe to a separate folder so that it can't find InternalUIPackage.msi. |
| 141 | // 2. Attempt to install InternalUIBundle.exe (allow elevation). |
| 142 | // 3. Verify that the prereq BA comes up with the Failure page saying that a file couldn't be found. |
| 143 | } |
| 144 | } |