From 6f6e4ced9f398ff37a44b91fdba62479cde29d06 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 9 Jun 2022 15:30:48 -0500 Subject: Implement ArpEntry flavored ExePackage. 6772 --- src/test/burn/WixTestTools/ArpEntryInstaller.cs | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/test/burn/WixTestTools/ArpEntryInstaller.cs (limited to 'src/test/burn/WixTestTools/ArpEntryInstaller.cs') diff --git a/src/test/burn/WixTestTools/ArpEntryInstaller.cs b/src/test/burn/WixTestTools/ArpEntryInstaller.cs new file mode 100644 index 00000000..96d9fab9 --- /dev/null +++ b/src/test/burn/WixTestTools/ArpEntryInstaller.cs @@ -0,0 +1,43 @@ +// 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. + +namespace WixTestTools +{ + using System; + using Xunit; + + public partial class ArpEntryInstaller : IDisposable + { + public ArpEntryInstaller(WixTestContext testContext, string id, bool perMachine = true, bool x64 = false) + { + this.ArpId = id; + this.PerMachine = perMachine; + this.X64 = x64; + this.TestContext = testContext; + } + + public string ArpId { get; } + + public bool PerMachine { get; } + + public bool X64 { get; } + + private WixTestContext TestContext { get; } + + public void Unregister(bool assertIfMissing = true) + { + if (this.TryGetRegistration(out var registration)) + { + registration.Delete(); + } + else + { + Assert.True(false, "Tried to unregister when not registered."); + } + } + + public void Dispose() + { + this.Unregister(false); + } + } +} -- cgit v1.2.3-55-g6feb