From 81908a5ec1647d76b45f50e4a18c37e1544818be Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 11 Mar 2021 17:54:30 -0600 Subject: Port forward compatible tests from old repo. --- src/WixTestTools/BundleRegistration.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/WixTestTools') diff --git a/src/WixTestTools/BundleRegistration.cs b/src/WixTestTools/BundleRegistration.cs index 1a066232..bf9e2903 100644 --- a/src/WixTestTools/BundleRegistration.cs +++ b/src/WixTestTools/BundleRegistration.cs @@ -151,5 +151,31 @@ namespace WixTestTools return registration; } + + public static bool TryGetDependencyProviderValue(string providerId, string name, out string value) + { + value = null; + + string key = String.Format(@"Installer\Dependencies\{0}", providerId); + using (RegistryKey providerKey = Registry.ClassesRoot.OpenSubKey(key)) + { + if (null == providerKey) + { + return false; + } + + value = providerKey.GetValue(name) as string; + return value != null; + } + } + + public static bool DependencyDependentExists(string providerId, string dependentId) + { + string key = String.Format(@"Installer\Dependencies\{0}\Dependents\{1}", providerId, dependentId); + using (RegistryKey dependentKey = Registry.ClassesRoot.OpenSubKey(key)) + { + return null != dependentKey; + } + } } } -- cgit v1.2.3-55-g6feb