diff options
| author | Bob Arnson <bob@firegiant.com> | 2025-03-20 21:14:12 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2025-03-24 18:18:52 -0400 |
| commit | f3fb208959d5ef2f8df19f518224d413b233f751 (patch) | |
| tree | 0ef9b5f2e59edb2f25ad0040a1bfa293155c309c /src/test/burn/WixToolsetTest.BurnE2E | |
| parent | bf13a0b67dd644eb7d74cb0cfb6876840f73d82b (diff) | |
| download | wix-bob/UpdateRegistrationAcrossUpgrades.tar.gz wix-bob/UpdateRegistrationAcrossUpgrades.tar.bz2 wix-bob/UpdateRegistrationAcrossUpgrades.zip | |
Update registration disappears during upgrade.bob/UpdateRegistrationAcrossUpgrades
Update registration is stored in a shared registry key that Burn takes
care to keep around across upgrades. The approach it used broke
between WiX v3 and WiX v5. This change makes it work again by
writing update registration when the session ends.
Diffstat (limited to 'src/test/burn/WixToolsetTest.BurnE2E')
| -rw-r--r-- | src/test/burn/WixToolsetTest.BurnE2E/OptionalUpdateRegistrationTests.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/OptionalUpdateRegistrationTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/OptionalUpdateRegistrationTests.cs new file mode 100644 index 00000000..3731b0cc --- /dev/null +++ b/src/test/burn/WixToolsetTest.BurnE2E/OptionalUpdateRegistrationTests.cs | |||
| @@ -0,0 +1,44 @@ | |||
| 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 OptionalUpdateRegistrationTests : BurnE2ETests | ||
| 10 | { | ||
| 11 | public OptionalUpdateRegistrationTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } | ||
| 12 | |||
| 13 | [RuntimeFact] | ||
| 14 | public void BundleUpdateRegistrationIsStickyAndAccurateAcrossUpgrades() | ||
| 15 | { | ||
| 16 | var packageAv1 = this.CreatePackageInstaller("PackageAv1"); | ||
| 17 | var packageAv2 = this.CreatePackageInstaller("PackageAv2"); | ||
| 18 | var bundleAv1 = this.CreateBundleInstaller("BundleAv1"); | ||
| 19 | var bundleAv2 = this.CreateBundleInstaller("BundleAv2"); | ||
| 20 | |||
| 21 | bundleAv1.Install(); | ||
| 22 | bundleAv1.VerifyRegisteredAndInPackageCache(); | ||
| 23 | var gotV1Registration = bundleAv1.TryGetUpdateRegistration(out var v1Registration); | ||
| 24 | |||
| 25 | bundleAv2.Install(); | ||
| 26 | bundleAv2.VerifyRegisteredAndInPackageCache(); | ||
| 27 | var gotV2Registration = bundleAv2.TryGetUpdateRegistration(out var v2Registration); | ||
| 28 | |||
| 29 | bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
| 30 | |||
| 31 | Assert.True(gotV1Registration, "Missing update registration after v1 install."); | ||
| 32 | Assert.True(gotV2Registration, "Missing update registration after v2 upgrade."); | ||
| 33 | |||
| 34 | Assert.Equal("Acme", v1Registration.Publisher); | ||
| 35 | Assert.Equal("Acme", v2Registration.Publisher); | ||
| 36 | Assert.Equal("Setup Geeks", v1Registration.PublishingGroup); | ||
| 37 | Assert.Equal("Setup Geeks", v2Registration.PublishingGroup); | ||
| 38 | Assert.Equal("~OptionalUpdateRegistrationTests", v1Registration.PackageName); | ||
| 39 | Assert.Equal("~OptionalUpdateRegistrationTests", v2Registration.PackageName); | ||
| 40 | Assert.Equal("1.0.0.0", v1Registration.PackageVersion); | ||
| 41 | Assert.Equal("2.0.0.0", v2Registration.PackageVersion); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
