public virtual EncryptedLicense InstallLicense(Type type, string licenseKey)
{
// Create an instance of the provider to validate the license
EncryptedLicense license = LoadLicense(LicenseManager.CurrentContext, type, licenseKey);
if (license != null)
{
// Grab information we need for putting license into the registry
string version = LicenseInstallForm.GetVersionCode(license.ProductInfo);
string product = LicenseInstallForm.GetProductCode(license.ProductInfo);
// Open (create if not present) the version specific path
string versionPath = _licensePath + version;
RegistryKey versionKey = Registry.CurrentUser.OpenSubKey(versionPath, true);
if (versionKey == null)
versionKey = Registry.CurrentUser.CreateSubKey(versionPath);
if (versionKey != null)
{
// Write the license key into the product code entry
versionKey.SetValue(product, licenseKey, RegistryValueKind.String);
}
}
return license;
}