Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to uninstall 5.0 #170

Merged
merged 1 commit into from
Jan 7, 2021
Merged

Conversation

sfoslund
Copy link
Member

@sfoslund sfoslund commented Jan 5, 2021

Tested manually on windows and mac

@sfoslund sfoslund requested a review from wli3 January 5, 2021 22:11
@sfoslund sfoslund marked this pull request as draft January 6, 2021 18:48
@sfoslund sfoslund marked this pull request as ready for review January 6, 2021 21:35
@sfoslund sfoslund requested review from joeloff and wli3 and removed request for wli3 January 6, 2021 21:35
@joeloff
Copy link
Member

joeloff commented Jan 6, 2021

Looks good. I noticed there's some code that examines the DisplayVersion properties from the registry. Because of how the actual versions are calculated, the version in the DisplayName and the DisplayVersion will be different for 5.x installs. For example, for 5.0.100-preview.2-20176.6, the actual file version (which would also be used for the DisplayVersion) will be 5.1.20.17606.

Not sure if that impacts what the tool expects to receive as input, but just wanted to call it out.

@sfoslund
Copy link
Member Author

sfoslund commented Jan 7, 2021

the DisplayVersion will be different for 5.x installs

Yeah, I noticed that so I removed some code that was using DisplayVersion before. I think the only uses now are taken directly from CoreScan and are just checking that it's not empty- we can always assume it's non-empty, right?

@joeloff
Copy link
Member

joeloff commented Jan 7, 2021

Yeah, I noticed that so I removed some code that was using DisplayVersion before. I think the only uses now are taken directly from CoreScan and are just checking that it's not empty- we can always assume it's non-empty, right?

Correct. The DisplayVersion should always be set.

Copy link

@wli3 wli3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you point out which part is port from corescan? So I don't need to review that part

private static readonly Regex _hostingBundleVersionDisplayNameRegex = new Regex(string.Format(
_runtimeVersionBasicRegexFormat,
_previewVersionHostingBundleDisplayNameRegex.ToString()));
private static readonly Regex _hostingBundleAuxVersionDisplayNameRegex = new Regex(string.Format(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are removed due to applying corescan logic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they're no longer needed once we convert to corescan

[InlineData("Microsoft ASP.NET Core 3.0.0 Preview 6 Build 19307.2 - Shared Framework")]
[InlineData("Microsoft ASP.NET Core 2.2.6 - Shared Framework")]
[InlineData("Microsoft ASP.NET Core 2.2.0 Preview 3 Build 35497 - Shared Framework")]
[InlineData("Microsoft ASP.NET Core 2.1.0 Release Candidate 1 - Shared Framework")]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why these tests are removed? due to corescan logic does not support it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Half of the deleted tests are moved here since they are no longer directly testing the regex. The other half are removed because corescan's logic is less restrictive about which bundles are considered .NET bundles. With the regex's we were looking for very specific display name strings and with the corescan logic we're less exact.

For example, out original logic might not have marked Microsoft ASP.NET Core 2.1.0 Release Candidate 1 - Shared Framework as a .NET bundle because there are extra spaced around the -. The corescan logic doesn't care about that kind of thing, which is good because it will be more resillient to small format changes.

}

private static bool IsDotNetCoreBundleUninstaller(int? windowsInstaller)
internal static bool IsNetCoreBundle(string displayName, string displayVersion, string uninstallString, string bundleVersion)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wli3 Most of this method comes from CS

var hasAuxVersion = cachePathMatch.Groups[Regexes.AuxVersionGroupName].Success;
var footnote = hasAuxVersion ?
string.Format(LocalizableStrings.HostingBundleFootnoteFormat, displayName, versionString) :
null;

if (string.IsNullOrEmpty(displayName) || string.IsNullOrEmpty(versionString))
// Classify the bundle type
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is also taken from corescan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants