Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "7.0.100-rc.1.22431.12"
"dotnet": "8.0.100"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22480.2"
Expand Down
4 changes: 2 additions & 2 deletions src/MSBuildBinLogQuery/MSBuildBinLogQuery.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Microsoft.Build.Logging.Query</RootNamespace>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.0.461" />
<PackageReference Include="Microsoft.Build" Version="17.9.5" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ private static bool IsAdmin()
{
try
{
if (RuntimeInfo.RunningOnWindows)
if (OperatingSystem.IsWindows())
{
var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
else if (RuntimeInfo.RunningOnOSX)
else if (OperatingSystem.IsMacOS())
{
return getuid() == 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.CommandLine.Invocation;
using System.CommandLine.Parsing;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Tools.Uninstall.MacOs;
using Microsoft.DotNet.Tools.Uninstall.Shared.BundleInfo;
using Microsoft.DotNet.Tools.Uninstall.Shared.Commands;
Expand Down Expand Up @@ -231,7 +232,7 @@ static CommandLineConfigs()
}
AssignOptionsToCommand(ListCommand, ListAuxOptions);

var bundleCollector = RuntimeInfo.RunningOnWindows ? new RegistryQuery() as IBundleCollector : new FileSystemExplorer() as IBundleCollector;
var bundleCollector = OperatingSystem.IsWindows() ? new RegistryQuery() as IBundleCollector : new FileSystemExplorer() as IBundleCollector;
ListCommand.Handler = CommandHandler.Create(ExceptionHandler.HandleException(() => ListCommandExec.Execute(bundleCollector)));
DryRunCommand.Handler = CommandHandler.Create(ExceptionHandler.HandleException(() => DryRunCommandExec.Execute(bundleCollector)));
RemoveCommand.Handler = CommandHandler.Create(ExceptionHandler.HandleException(() => UninstallCommandExec.Execute(bundleCollector)));
Expand Down
2 changes: 2 additions & 0 deletions src/dotnet-core-uninstall/Windows/RegistryQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using Microsoft.DotNet.Tools.Uninstall.MacOs;
using Microsoft.DotNet.Tools.Uninstall.Shared.BundleInfo;
Expand All @@ -15,6 +16,7 @@

namespace Microsoft.DotNet.Tools.Uninstall.Windows
{
[SupportedOSPlatform("windows")]
internal class RegistryQuery : IBundleCollector
{
public IEnumerable<Bundle> GetInstalledBundles()
Expand Down
8 changes: 4 additions & 4 deletions src/dotnet-core-uninstall/dotnet-core-uninstall.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win-x86;osx-x64</RuntimeIdentifiers>
<SignAssembly>true</SignAssembly>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RollForward>LatestMajor</RollForward>
</PropertyGroup>

Expand All @@ -15,11 +15,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="$(MicrosoftVisualStudioSetupConfigurationPackageVersion)" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.6.0" />
<PackageReference Include="NuGet.Versioning" Version="5.3.1" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="NuGet.Versioning" Version="6.9.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20574.7" />
<PackageReference Include="System.CommandLine.Rendering" Version="0.3.0-alpha.20574.7" />
<PackageReference Include="System.Resources.Extensions" Version="4.6.0" />
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/redist/redist.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
<DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
15 changes: 11 additions & 4 deletions test/dotnet-core-uninstall.Tests/Windows/RegistryQueryTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using FluentAssertions;
using Microsoft.DotNet.Tools.Uninstall.Tests.Attributes;
using Microsoft.DotNet.Tools.Uninstall.Windows;
Expand Down Expand Up @@ -48,19 +49,25 @@ public class RegistryQueryTests
[InlineData("Microsoft .NET SDK 5.0.100 (arm64)")]
internal void TestIsNetCoreBundleAccept(string input)
{
RegistryQuery.IsNetCoreBundle(input, "0.0", "mockuninstall.exe", "0.0")
.Should()
.BeTrue();
if (OperatingSystem.IsWindows())
{
RegistryQuery.IsNetCoreBundle(input, "0.0", "mockuninstall.exe", "0.0")
.Should()
.BeTrue();
}
}

[WindowsOnlyTheory]
[InlineData("Microsoft ASP.NET Web Frameworks and Tools VS2015")]
[InlineData("Microsoft .NET Core SDK - rc1 (x86)")]
internal void TestGetBundleVersionReturnsNullOnInvalidDisplayNames(string displayName)
{
RegistryQuery.GetBundleVersion(displayName, string.Empty, string.Empty)
if (OperatingSystem.IsWindows())
{
RegistryQuery.GetBundleVersion(displayName, string.Empty, string.Empty)
.Should()
.BeNull();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down