Skip to content

Commit

Permalink
Merge pull request #142 from sfoslund/FixHostingBundles
Browse files Browse the repository at this point in the history
Fix bug in hosting bundle registry query
  • Loading branch information
sfoslund authored Apr 16, 2020
2 parents d3280aa + 70371c6 commit 8b45ca0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/dotnet-core-uninstall/Shared/Utils/Regexes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal static class Regexes
private static readonly Regex _majorMinorRegex = new Regex(
$@"(?<{MajorGroupName}>\d+)\.(?<{MinorGroupName}>\d+)");
private static readonly Regex _previewVersionNumberRegex = new Regex(
$@"(\d+(\.\d+)?)?");
$@"(\d+(\.\d+)*)?");
private static readonly Regex _previewVersionNumberRuntimeDisplayNameRegex = new Regex(
$@"(\s\d+(\.\d+)?)?");
private static readonly Regex _rcVersionNumberRegex = new Regex(
Expand All @@ -35,7 +35,7 @@ internal static class Regexes
private static readonly Regex _previewVersionAspNetRuntimeDisplayNameRegex = new Regex(
$@"(?<{PreviewGroupName}>\s(Preview{_previewVersionNumberRuntimeDisplayNameRegex.ToString()}(\sBuild\s{_buildNumberRegex.ToString()}(\.\d+|\-\d+)?)?|Release\sCandidate\s{_rcVersionNumberRegex.ToString()}))");
private static readonly Regex _previewVersionHostingBundleDisplayNameRegex = new Regex(
$@"(?<{PreviewGroupName}>\s(Preview{_previewVersionNumberRuntimeDisplayNameRegex.ToString()}(\s(Build\s{_buildNumberRegex.ToString()}(\.\d+|\-\d+)?|{_buildNumberRegex.ToString()}(\s{_buildNumberRegex.ToString()})?(\spreview{_previewVersionNumberRegex.ToString()})?))?|Release\sCandidate\s{_rcVersionNumberRegex.ToString()}))");
$@"(?<{PreviewGroupName}>\s(Preview{_previewVersionNumberRuntimeDisplayNameRegex.ToString()}(\s(Build\s{_buildNumberRegex.ToString()}(\.\d+|\-\d+)?|Build\spreview{_previewVersionNumberRegex.ToString()}|{_buildNumberRegex.ToString()}(\s{_buildNumberRegex.ToString()})?(\spreview{_previewVersionNumberRegex.ToString()})?))?|Release\sCandidate\s{_rcVersionNumberRegex.ToString()}))");
private static readonly Regex _previewVersionSdkCachePathRegex = new Regex(
$@"(?<{PreviewGroupName}>\-(preview{_previewVersionNumberRegex.ToString()}|rc{_rcVersionNumberRegex.ToString()}(\.\d+)?)\-(?<{BuildGroupName}>\d+))");
private static readonly Regex _previewVersionRuntimeCachePathRegex = new Regex(
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-core-uninstall/Windows/RegistryQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private static void ParseVersionAndArch(RegistryKey registryKey, string displayN
string.Format(LocalizableStrings.HostingBundleFootnoteFormat, displayName, versionString) :
null;

if (string.IsNullOrEmpty(displayName) || string.IsNullOrEmpty(versionString) || string.IsNullOrEmpty(archString))
if (string.IsNullOrEmpty(displayName) || string.IsNullOrEmpty(versionString))
{
version = null;
arch = BundleArch.X64 | BundleArch.X86;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ internal void TestBundleMajorMinorRegexReject(string input)
[InlineData("Microsoft .NET Core 3.0.0 Preview 4 Build 19216-03 - Windows Server Hosting")]
[InlineData("Microsoft .NET Core 3.0.0 Preview 5 Build 19227-01 - Windows Server Hosting")]
[InlineData("Microsoft .NET Core 3.0.0 Preview 6 Build 19307.2 - Windows Server Hosting")]
[InlineData("Microsoft .NET Core 3.1.0 Preview 1 Build preview1.19307.20 - Windows Server Hosting")]
internal void TestBundleDisplayNameRegexAccept(string input)
{
TestRegexAccept(Regexes.BundleDisplayNameRegex, input);
Expand Down

0 comments on commit 8b45ca0

Please sign in to comment.