Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dnup.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"path": "sdk.slnx",
"projects": [
"src\\Installer\\dnup\\dnup.csproj",
"src\\Installer\\Microsoft.Dotnet.Installation\\Microsoft.Dotnet.Installation.csproj",
"test\\dnup.Tests\\dnup.Tests.csproj",
]
}
Expand Down
3 changes: 2 additions & 1 deletion sdk.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
</Folder>
<Folder Name="/src/Installer/">
<Project Path="src/Installer/dnup/dnup.csproj" />
<Project Path="src/Installer/Microsoft.Dotnet.Installation/Microsoft.Dotnet.Installation.csproj" />
</Folder>
<Folder Name="/src/Layout/">
<Project Path="src/Layout/finalizer/finalizer.csproj" />
Expand Down Expand Up @@ -289,12 +290,12 @@
<Project Path="test/ArgumentForwarding.Tests/ArgumentForwarding.Tests.csproj" />
<Project Path="test/ArgumentsReflector/ArgumentsReflector.csproj" />
<Project Path="test/containerize.UnitTests/containerize.UnitTests.csproj" />
<Project Path="test/dnup.Tests/dnup.Tests.csproj" />
<Project Path="test/dotnet-format.UnitTests/dotnet-format.UnitTests.csproj" />
<Project Path="test/dotnet-MsiInstallation.Tests/dotnet-MsiInstallation.Tests.csproj" />
<Project Path="test/dotnet-new.IntegrationTests/dotnet-new.IntegrationTests.csproj" />
<Project Path="test/dotnet-watch.Tests/dotnet-watch.Tests.csproj" />
<Project Path="test/dotnet.Tests/dotnet.Tests.csproj" />
<Project Path="test/dnup.Tests/dnup.Tests.csproj" />
<Project Path="test/EndToEnd.Tests/EndToEnd.Tests.csproj" />
<Project Path="test/HelixTasks/HelixTasks.csproj" />
<Project Path="test/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests.csproj" />
Expand Down
12 changes: 12 additions & 0 deletions src/Installer/Microsoft.Dotnet.Installation/DotnetInstallRoot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Dotnet.Installation;
public record DotnetInstallRoot(
string? Path,
InstallType Type,
InstallArchitecture Architecture);
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Deployment.DotNet.Releases;

namespace Microsoft.Dotnet.Installation;

internal interface IDotnetInstallDiscoverer
{
IEnumerable<ReleaseVersion> ListInstalledVersions(DotnetInstallRoot dotnetRoot, InstallComponent component);
}
12 changes: 12 additions & 0 deletions src/Installer/Microsoft.Dotnet.Installation/IDotnetInstaller.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Deployment.DotNet.Releases;

namespace Microsoft.Dotnet.Installation;

public interface IDotnetInstaller
{
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.

Should we provide a doc string mentioning this Installer interface does not support updating / tracking of these installers? I imagine we'll end up implementing an 'archive' installer for local zip installs just like how the other one works today. That allows us to expand with an admin installer in the future (msi, pkg, distro feed pk mgr)

Copy link
Member

Choose a reason for hiding this comment

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

Do we want to support a custom interface for our output? (e.g. spectre .console abstraction)
We could do similarly for logging.

Copy link
Member

Choose a reason for hiding this comment

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

Curious on @MichaelSimons opinion on this!

Copy link
Member

Choose a reason for hiding this comment

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

I think this is something to ask Aspire. Would we also make use of it in the DNUP usage scenario?

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, how we want to hook up logging (and in general console output) is a good question.

Copy link
Member

Choose a reason for hiding this comment

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

Aspire asked for update support. Is the vision that they would manage the update via the install/uninstall apis vs providing a direct api?

Copy link
Member

Choose a reason for hiding this comment

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

Daniel and I discussed and the vision was that there would be a separate installer interface that creates the 'dnup manifest' but just not in a dnup directory and instead in the dotnet root. The first release of the lib would just support basic install and a more complex interface would later be available that does more of the heavy lifting. I think we called it IDotnetInstallerManager.

void Uninstall(DotnetInstallRoot dotnetRoot, InstallComponent component, ReleaseVersion version);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Deployment.DotNet.Releases;

namespace Microsoft.Dotnet.Installation;

public interface IDotnetReleaseInfoProvider
{
IEnumerable<string> GetAvailableChannels();

ReleaseVersion GetLatestVersion(InstallComponent component, string channel);

// Get all versions in a channel - do we have a scenario for this?
Copy link
Member

Choose a reason for hiding this comment

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

Since we are using the term channel currently to mean, 'latest' or 'lts' or '9.0' or '9.0.102' in DNUP we may want to consider the terminology here. Channel has a specific meaning the release manifest context which is separate from how we are treating 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.

What does channel mean in the context of the release manifest? Any ideas on how to disambiguate?

Copy link
Member

@nagilson nagilson Oct 10, 2025

Choose a reason for hiding this comment

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

A channel version typically describes the major.minor that defines the manifest: https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json ( see at the top of the file.) @joeloff mentioned channel is considered an overloaded term. (Note that I take ownership of calling it a channel too in the code 😁 )

The LTS/STS disambiguation is a term called 'release-type'.

The fully specified version is a 'version'.

So far in our code base, the 'channel' can be any of those - a fully specified version, unfully specified version (or even a channel-version per se), a release type, or something else ('latest', 'preview').

//IEnumerable<ReleaseVersion> GetAllVersions(InstallComponent component, string channel);

SupportType GetSupportType(InstallComponent component, ReleaseVersion version);
}

public enum SupportType
{
OutOfSupport,
LongTermSupport,
StandardTermSupport
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
using System.Collections.Generic;
using System.Text;

namespace Microsoft.DotNet.Tools.Bootstrapper
namespace Microsoft.Dotnet.Installation;

public enum InstallArchitecture
{
public enum InstallArchitecture
{
x86,
x64,
arm64
}
x86,
x64,
arm64
}
12 changes: 12 additions & 0 deletions src/Installer/Microsoft.Dotnet.Installation/InstallComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.Dotnet.Installation;

public enum InstallComponent
{
SDK,
Runtime,
ASPNETCore,
WindowsDesktop
}
13 changes: 13 additions & 0 deletions src/Installer/Microsoft.Dotnet.Installation/InstallType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.Dotnet.Installation;

public enum InstallType
{
None,
// Inconsistent would be when the dotnet on the path doesn't match what DOTNET_ROOT is set to
Inconsistent,
Admin,
User
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Deployment.DotNet.Releases" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Installer/dnup/DnupManifestJsonContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.DotNet.Tools.Bootstrapper
[JsonSerializable(typeof(List<DotnetInstall>))]
[JsonSerializable(typeof(DotnetVersion))]
[JsonSerializable(typeof(DotnetVersionType))]
[JsonSerializable(typeof(InstallMode))]
[JsonSerializable(typeof(InstallComponent))]
[JsonSerializable(typeof(InstallArchitecture))]
[JsonSerializable(typeof(InstallType))]
[JsonSerializable(typeof(ManagementCadence))]
Expand Down
9 changes: 1 addition & 8 deletions src/Installer/dnup/DotnetInstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@

using System;
using Microsoft.Deployment.DotNet.Releases;
using Microsoft.Dotnet.Installation;

namespace Microsoft.DotNet.Tools.Bootstrapper;

public record DotnetInstallRoot(
string? Path,
InstallType Type,
InstallArchitecture Architecture)
{
// Do we need a GUID for the ID here?
}

/// <summary>
/// Represents a .NET installation with a fully specified version.
/// The MuxerDirectory is the directory of the corresponding .NET host that has visibility into this .NET installation.
Expand Down
12 changes: 0 additions & 12 deletions src/Installer/dnup/IChannelVersionResolver.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/Installer/dnup/InstallComponent.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/Installer/dnup/InstallType.cs

This file was deleted.

10 changes: 9 additions & 1 deletion src/Installer/dnup/dnup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Strings.resx" GenerateSource="true" Namespace="Microsoft.DotNet.Tools.Bootstrapper"/>
<Using Include="Microsoft.Dotnet.Installation" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.Dotnet.Installation\Microsoft.Dotnet.Installation.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Strings.resx" GenerateSource="true" Namespace="Microsoft.DotNet.Tools.Bootstrapper" />
</ItemGroup>

</Project>