aboutsummaryrefslogtreecommitdiff
path: root/src/WixTestTools/BundleRegistration.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixTestTools/BundleRegistration.cs')
-rw-r--r--src/WixTestTools/BundleRegistration.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/WixTestTools/BundleRegistration.cs b/src/WixTestTools/BundleRegistration.cs
index d473dcdd..1a066232 100644
--- a/src/WixTestTools/BundleRegistration.cs
+++ b/src/WixTestTools/BundleRegistration.cs
@@ -7,7 +7,8 @@ namespace WixTestTools
7 7
8 public class BundleRegistration 8 public class BundleRegistration
9 { 9 {
10 public const string BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY = "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; 10 public const string BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
11 public const string BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY_WOW6432NODE = "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
11 public const string BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH = "BundleCachePath"; 12 public const string BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH = "BundleCachePath";
12 public const string BURN_REGISTRATION_REGISTRY_BUNDLE_ADDON_CODE = "BundleAddonCode"; 13 public const string BURN_REGISTRATION_REGISTRY_BUNDLE_ADDON_CODE = "BundleAddonCode";
13 public const string BURN_REGISTRATION_REGISTRY_BUNDLE_DETECT_CODE = "BundleDetectCode"; 14 public const string BURN_REGISTRATION_REGISTRY_BUNDLE_DETECT_CODE = "BundleDetectCode";
@@ -89,13 +90,22 @@ namespace WixTestTools
89 90
90 public static bool TryGetPerMachineBundleRegistrationById(string bundleId, out BundleRegistration registration) 91 public static bool TryGetPerMachineBundleRegistrationById(string bundleId, out BundleRegistration registration)
91 { 92 {
92 var registrationKeyPath = $"{BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY}\\{bundleId}"; 93 var registrationKeyPath = $"{BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY_WOW6432NODE}\\{bundleId}";
93 using var registrationKey = Registry.LocalMachine.OpenSubKey(registrationKeyPath); 94 using var registrationKey = Registry.LocalMachine.OpenSubKey(registrationKeyPath);
94 var success = registrationKey != null; 95 var success = registrationKey != null;
95 registration = success ? GetBundleRegistration(registrationKey) : null; 96 registration = success ? GetBundleRegistration(registrationKey) : null;
96 return success; 97 return success;
97 } 98 }
98 99
100 public static bool TryGetPerUserBundleRegistrationById(string bundleId, out BundleRegistration registration)
101 {
102 var registrationKeyPath = $"{BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY}\\{bundleId}";
103 using var registrationKey = Registry.CurrentUser.OpenSubKey(registrationKeyPath);
104 var success = registrationKey != null;
105 registration = success ? GetBundleRegistration(registrationKey) : null;
106 return success;
107 }
108
99 private static BundleRegistration GetBundleRegistration(RegistryKey idKey) 109 private static BundleRegistration GetBundleRegistration(RegistryKey idKey)
100 { 110 {
101 var registration = new BundleRegistration(); 111 var registration = new BundleRegistration();