Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #64 from Particular/warning-obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonsmits authored Dec 1, 2020
2 parents c28e19e + b2fbc6e commit 9060ece
Show file tree
Hide file tree
Showing 4 changed files with 901 additions and 954 deletions.
6 changes: 6 additions & 0 deletions src/NServiceBus.PowerShell/Cmdlets/InstallPlatformLicense.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using RegistryView = Helpers.RegistryView;

[Cmdlet(VerbsLifecycle.Install, "NServiceBusPlatformLicense", DefaultParameterSetName = "ByLicenseFile")]
[Obsolete(@"Installing license information in the registry has been deprecated as the Particular Platform reads license info from file system. For legacy installations this cmdlet can still be used. See https://docs.particular.net/search?q=license.")]
public class InstallPlatformLicense : CmdletBase
{
[Parameter(Mandatory = true, HelpMessage = "Platform license file to import", Position = 0, ParameterSetName = "ByLicenseFile")]
Expand All @@ -19,6 +20,11 @@ public class InstallPlatformLicense : CmdletBase
[ValidateNotNullOrEmpty]
public string LicenseString { get; set; }

protected override void BeginProcessing()
{
WriteWarning("Installing license information in the registry has been deprecated as the Particular Platform reads license info from file system. For legacy installations this cmdlet can still be used. See https://docs.particular.net/search?q=license.");
}

protected override void ProcessRecord()
{
const string particular = @"Software\ParticularSoftware";
Expand Down
6 changes: 2 additions & 4 deletions src/NServiceBus.PowerShell/Helpers/RegistryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ public object ReadValue(string subKeyName, string valueName, object defaultValue
var cur = 0;
var len = blob.Length;

// ReSharper disable once ConditionIsAlwaysTrueOrFalse
while (ret == 0 && cur < len)
while (cur < len)
{
var nextNull = cur;
while (nextNull < len && blob[nextNull] != (char) 0)
Expand All @@ -350,7 +349,6 @@ public object ReadValue(string subKeyName, string valueName, object defaultValue
}
cur = nextNull + 1;
}
// ReSharper enable once ConditionIsAlwaysTrueOrFalse

data = new String[strings.Count];
strings.CopyTo((String[]) data, 0);
Expand Down Expand Up @@ -589,4 +587,4 @@ public RegistryValueKind GetRegistryValueKind(string subKeyName, string valueNam
}
}
}
}
}
Loading

0 comments on commit 9060ece

Please sign in to comment.