static string GetHKCULicense(string softwareKey = "NServiceBus", string subKey = null)
{
var keyPath = @"SOFTWARE\" + softwareKey;
if (subKey != null)
{
keyPath += @"\" + subKey;
}
using (var registryKey = Registry.CurrentUser.OpenSubKey(keyPath))
{
return (string) registryKey?.GetValue("License", null);
}
}