diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-04-04 17:38:26 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-04-05 13:52:11 -0500 |
| commit | 75f4dce4ea53b82f99932573f27ccfc799d0c5c1 (patch) | |
| tree | 4225579b861b4998138c19e9108d3cf91b13ad80 /src/test | |
| parent | 44c2ca035c1a5d52a6b3299ba3abbb8b88f7f1c0 (diff) | |
| download | wix-75f4dce4ea53b82f99932573f27ccfc799d0c5c1.tar.gz wix-75f4dce4ea53b82f99932573f27ccfc799d0c5c1.tar.bz2 wix-75f4dce4ea53b82f99932573f27ccfc799d0c5c1.zip | |
Add option for BundlePackage to be hidden in ARP like MsiPackage.
Requires support for this feature in the nested bundle.
Simplest implementation of 4454
Diffstat (limited to 'src/test')
4 files changed, 53 insertions, 5 deletions
diff --git a/src/test/burn/TestData/BundlePackageTests/V3BundlePackageBundle/V3BundlePackageBundle.wixproj b/src/test/burn/TestData/BundlePackageTests/V3BundlePackageBundle/V3BundlePackageBundle.wixproj index d57ac072..a7930a09 100644 --- a/src/test/burn/TestData/BundlePackageTests/V3BundlePackageBundle/V3BundlePackageBundle.wixproj +++ b/src/test/burn/TestData/BundlePackageTests/V3BundlePackageBundle/V3BundlePackageBundle.wixproj | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | <BA>TestBA_x64</BA> | 5 | <BA>TestBA_x64</BA> |
| 6 | <UpgradeCode>{B6CAE45D-A7E5-4302-9FCF-4D05632F9FD7}</UpgradeCode> | 6 | <UpgradeCode>{B6CAE45D-A7E5-4302-9FCF-4D05632F9FD7}</UpgradeCode> |
| 7 | <InstallerPlatform>x64</InstallerPlatform> | 7 | <InstallerPlatform>x64</InstallerPlatform> |
| 8 | <SuppressSpecificWarnings>8506</SuppressSpecificWarnings> | ||
| 8 | </PropertyGroup> | 9 | </PropertyGroup> |
| 9 | <ItemGroup> | 10 | <ItemGroup> |
| 10 | <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> | 11 | <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> |
diff --git a/src/test/burn/WixTestTools/BundleRegistration.cs b/src/test/burn/WixTestTools/BundleRegistration.cs index 75660838..3541e7ea 100644 --- a/src/test/burn/WixTestTools/BundleRegistration.cs +++ b/src/test/burn/WixTestTools/BundleRegistration.cs | |||
| @@ -66,6 +66,8 @@ namespace WixTestTools | |||
| 66 | 66 | ||
| 67 | public string Publisher { get; set; } | 67 | public string Publisher { get; set; } |
| 68 | 68 | ||
| 69 | public int? SystemComponent { get; set; } | ||
| 70 | |||
| 69 | public string QuietUninstallString { get; set; } | 71 | public string QuietUninstallString { get; set; } |
| 70 | 72 | ||
| 71 | public string QuietUninstallCommand { get; set; } | 73 | public string QuietUninstallCommand { get; set; } |
| @@ -125,6 +127,7 @@ namespace WixTestTools | |||
| 125 | registration.Installed = idKey.GetValue(REGISTRY_BUNDLE_INSTALLED) as int?; | 127 | registration.Installed = idKey.GetValue(REGISTRY_BUNDLE_INSTALLED) as int?; |
| 126 | registration.ModifyPath = idKey.GetValue(REGISTRY_BUNDLE_MODIFY_PATH) as string; | 128 | registration.ModifyPath = idKey.GetValue(REGISTRY_BUNDLE_MODIFY_PATH) as string; |
| 127 | registration.Publisher = idKey.GetValue(REGISTRY_BUNDLE_PUBLISHER) as string; | 129 | registration.Publisher = idKey.GetValue(REGISTRY_BUNDLE_PUBLISHER) as string; |
| 130 | registration.SystemComponent = idKey.GetValue(REGISTRY_BUNDLE_SYSTEM_COMPONENT) as int?; | ||
| 128 | registration.UrlInfoAbout = idKey.GetValue(REGISTRY_BUNDLE_URL_INFO_ABOUT) as string; | 131 | registration.UrlInfoAbout = idKey.GetValue(REGISTRY_BUNDLE_URL_INFO_ABOUT) as string; |
| 129 | registration.UrlUpdateInfo = idKey.GetValue(REGISTRY_BUNDLE_URL_UPDATE_INFO) as string; | 132 | registration.UrlUpdateInfo = idKey.GetValue(REGISTRY_BUNDLE_URL_UPDATE_INFO) as string; |
| 130 | 133 | ||
diff --git a/src/test/burn/WixTestTools/BundleVerifier.cs b/src/test/burn/WixTestTools/BundleVerifier.cs index e0edb081..a5dbe0ec 100644 --- a/src/test/burn/WixTestTools/BundleVerifier.cs +++ b/src/test/burn/WixTestTools/BundleVerifier.cs | |||
| @@ -87,10 +87,12 @@ namespace WixTestTools | |||
| 87 | } | 87 | } |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | public string VerifyRegisteredAndInPackageCache() | 90 | public string VerifyRegisteredAndInPackageCache(int? expectedSystemComponent = null) |
| 91 | { | 91 | { |
| 92 | Assert.True(this.TryGetRegistration(out var registration)); | 92 | Assert.True(this.TryGetRegistration(out var registration)); |
| 93 | 93 | ||
| 94 | Assert.Equal(expectedSystemComponent, registration.SystemComponent); | ||
| 95 | |||
| 94 | Assert.NotNull(registration.CachePath); | 96 | Assert.NotNull(registration.CachePath); |
| 95 | Assert.True(File.Exists(registration.CachePath)); | 97 | Assert.True(File.Exists(registration.CachePath)); |
| 96 | 98 | ||
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/BundlePackageTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/BundlePackageTests.cs index 1bb0c0b6..bcdea974 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/BundlePackageTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/BundlePackageTests.cs | |||
| @@ -31,8 +31,8 @@ namespace WixToolsetTest.BurnE2E | |||
| 31 | multipleBundlePackagesBundle.Install(); | 31 | multipleBundlePackagesBundle.Install(); |
| 32 | multipleBundlePackagesBundle.VerifyRegisteredAndInPackageCache(); | 32 | multipleBundlePackagesBundle.VerifyRegisteredAndInPackageCache(); |
| 33 | 33 | ||
| 34 | bundleA.VerifyRegisteredAndInPackageCache(); | 34 | bundleA.VerifyRegisteredAndInPackageCache(expectedSystemComponent: 1); |
| 35 | bundleB_x64.VerifyRegisteredAndInPackageCache(); | 35 | bundleB_x64.VerifyRegisteredAndInPackageCache(expectedSystemComponent: 1); |
| 36 | 36 | ||
| 37 | // Source file should be installed | 37 | // Source file should be installed |
| 38 | Assert.True(File.Exists(packageA32SourceCodeFilePath), $"Should have found PackageA payload installed at: {packageA32SourceCodeFilePath}"); | 38 | Assert.True(File.Exists(packageA32SourceCodeFilePath), $"Should have found PackageA payload installed at: {packageA32SourceCodeFilePath}"); |
| @@ -61,14 +61,15 @@ namespace WixToolsetTest.BurnE2E | |||
| 61 | 61 | ||
| 62 | upgradeBundlePackageBundlev2.Install(); | 62 | upgradeBundlePackageBundlev2.Install(); |
| 63 | upgradeBundlePackageBundlev2.VerifyRegisteredAndInPackageCache(); | 63 | upgradeBundlePackageBundlev2.VerifyRegisteredAndInPackageCache(); |
| 64 | bundleAv2.VerifyRegisteredAndInPackageCache(); | 64 | bundleAv2.VerifyRegisteredAndInPackageCache(expectedSystemComponent: 1); |
| 65 | bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache(); | 65 | bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | [Fact] | 68 | [Fact] |
| 69 | public void CanInstallV3BundlePackage() | 69 | public void CanInstallV3BundlePackage() |
| 70 | { | 70 | { |
| 71 | var v3BundleName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Package Cache", "{215a70db-ab35-48c7-be51-d66eaac87177}", "CustomV3Theme"); | 71 | var v3BundleId = "{215a70db-ab35-48c7-be51-d66eaac87177}"; |
| 72 | var v3BundleName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Package Cache", v3BundleId, "CustomV3Theme"); | ||
| 72 | var v3Bundle = new BundleInstaller(this.TestContext, v3BundleName); | 73 | var v3Bundle = new BundleInstaller(this.TestContext, v3BundleName); |
| 73 | this.AddBundleInstaller(v3Bundle); | 74 | this.AddBundleInstaller(v3Bundle); |
| 74 | var v3BundlePackageBundle = this.CreateBundleInstaller("V3BundlePackageBundle"); | 75 | var v3BundlePackageBundle = this.CreateBundleInstaller("V3BundlePackageBundle"); |
| @@ -79,6 +80,47 @@ namespace WixToolsetTest.BurnE2E | |||
| 79 | v3BundlePackageBundle.VerifyRegisteredAndInPackageCache(); | 80 | v3BundlePackageBundle.VerifyRegisteredAndInPackageCache(); |
| 80 | 81 | ||
| 81 | Assert.True(LogVerifier.MessageInLogFile(logPath, "Applied execute package: v3bundle.exe, result: 0x0, restart: None")); | 82 | Assert.True(LogVerifier.MessageInLogFile(logPath, "Applied execute package: v3bundle.exe, result: 0x0, restart: None")); |
| 83 | |||
| 84 | Assert.True(BundleRegistration.TryGetPerMachineBundleRegistrationById(v3BundleId, false, out var v3Registration)); | ||
| 85 | Assert.Null(v3Registration.SystemComponent); | ||
| 86 | } | ||
| 87 | |||
| 88 | [Fact] | ||
| 89 | public void CanLeaveBundlePackageVisible() | ||
| 90 | { | ||
| 91 | var bundleAv1 = this.CreateBundleInstaller(@"..\UpgradeRelatedBundleTests\BundleAv1"); | ||
| 92 | var upgradeBundlePackageBundlev1 = this.CreateBundleInstaller("UpgradeBundlePackageBundlev1"); | ||
| 93 | |||
| 94 | bundleAv1.Install(); | ||
| 95 | bundleAv1.VerifyRegisteredAndInPackageCache(); | ||
| 96 | |||
| 97 | upgradeBundlePackageBundlev1.Install(); | ||
| 98 | upgradeBundlePackageBundlev1.VerifyRegisteredAndInPackageCache(); | ||
| 99 | bundleAv1.VerifyRegisteredAndInPackageCache(); | ||
| 100 | |||
| 101 | upgradeBundlePackageBundlev1.Uninstall(); | ||
| 102 | upgradeBundlePackageBundlev1.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
| 103 | bundleAv1.VerifyRegisteredAndInPackageCache(); | ||
| 104 | } | ||
| 105 | |||
| 106 | [Fact] | ||
| 107 | public void CanReferenceCountBundlePackage() | ||
| 108 | { | ||
| 109 | var bundleAv1 = this.CreateBundleInstaller(@"..\UpgradeRelatedBundleTests\BundleAv1"); | ||
| 110 | var upgradeBundlePackageBundlev1 = this.CreateBundleInstaller("UpgradeBundlePackageBundlev1"); | ||
| 111 | |||
| 112 | upgradeBundlePackageBundlev1.Install(); | ||
| 113 | upgradeBundlePackageBundlev1.VerifyRegisteredAndInPackageCache(); | ||
| 114 | bundleAv1.VerifyRegisteredAndInPackageCache(expectedSystemComponent: 1); | ||
| 115 | |||
| 116 | // Repair bundle so it adds itself as a reference to itself. | ||
| 117 | bundleAv1.Repair(); | ||
| 118 | bundleAv1.VerifyRegisteredAndInPackageCache(expectedSystemComponent: 1); | ||
| 119 | |||
| 120 | upgradeBundlePackageBundlev1.Uninstall(); | ||
| 121 | upgradeBundlePackageBundlev1.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
| 122 | |||
| 123 | bundleAv1.VerifyRegisteredAndInPackageCache(expectedSystemComponent: 1); | ||
| 82 | } | 124 | } |
| 83 | 125 | ||
| 84 | [Fact] | 126 | [Fact] |
