Skip to content

Conversation

@dsplaisted
Copy link
Member

Move enough implementation into the library to implement the following methods:

  • IDotnetInstaller.Install
  • IDotnetReleaseInfoProvider.GetLatestVersion

Usage:

        var releaseInfoProvider = InstallerFactory.CreateReleaseInfoProvider();
        var installer = InstallerFactory.CreateInstaller();

        var latestVersion = releaseInfoProvider.GetLatestVersion(InstallComponent.SDK, channel);

        installer.Install(
            new DotnetInstallRoot(targetInstallPath, InstallerUtilities.GetDefaultInstallArchitecture()),
            InstallComponent.SDK,
            latestVersion!);

Other interface methods are not hooked up and will throw NotImplementedException.

@dsplaisted dsplaisted requested a review from nagilson October 20, 2025 23:51
Copy link
Member

@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

Looking good so far! I definitely think logging/telemetry is a top priority for us after this, as well as adding even more tests. I'll leave this feedback now. Working on adding a little more verification to the e2e tests, then ill help merge your PR into that pipeline change so we have a working PR CI flow.

IEnumerable<string> GetAvailableChannels();

ReleaseVersion GetLatestVersion(InstallComponent component, string channel);
ReleaseVersion? GetLatestVersion(InstallComponent component, string channel);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: It might be better to fail if we can't find a release version - that would likely be cleaner than requiring invokers to use !. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

As is, the caller should probably check for a null return value and either throw an error or handle appropriately if there is one. It might be better to just throw in the implementation. I think we'll want to clean up a lot of the ReleaseManifestcode, probably we can consider when we do that.

we can chat if we want this to be internal - though it might be helpful for consumers to be able to marshal the architecture from the runtime into our architecture type that we use in our install objects, considering it's part of dotnet install root, which is also public
@dsplaisted dsplaisted merged commit 6f45876 into dotnet:dnup Oct 21, 2025
12 checks passed
namespace Microsoft.Dotnet.Installation.Internal;

internal class ArchiveDotnetInstaller : IDotnetInstaller, IDisposable
internal class ArchiveDotnetExtractor : IDisposable
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about the name DotnetArchiveExtractor? It feels more consistent with other types like DotnetInstaller.

Copy link
Member

Choose a reason for hiding this comment

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

I like this name! Agree it's an improvement.

{
internal class DotnetInstaller : IDotnetInstaller
{
public void Install(DotnetInstallRoot dotnetRoot, InstallComponent component, ReleaseVersion version)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: DotnetInstaller and DotnetReleaseInfoProvider have brank lines between the members.


namespace Microsoft.DotNet.Tools.Dnup.Tests;

public class LibraryTests
Copy link
Member

Choose a reason for hiding this comment

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

Did you consider splitting these out into a separate test assembly? It would help discoverability and help separate areas of concerns.

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