dotnet / dotnet/sdk

dotnetup: Update `defaultinstall` command to set path preference

Open
#53,742 0 comments 0 reactions 1 assignee Claimed by @dsplaisted View on GitHub
Area-dotnetup
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

## Context

PR [#53464](https://github.com/dotnet/sdk/pull/53464) review identified that `dotnetup defaultinstall` is about the PathPreference mode setting, and that we aren't doing that across all platforms correctly yet.

### Related PR Comment

- [WalkthroughWorkflows.cs L390](https://github.com/dotnet/sdk/pull/53464#discussion_r3032606364) — @dsplaisted: "`dotnetup defaultinstall` isn't really related to whether runtimes are copied from the admin install. It's more about the 'PathPreference' mode setting. We should update the defaultinstall command to set the path preference in the config, and to be able to handle the difference between ShellProfile and FullPathReplacement. We can file a follow-up issue for that."

## Description

The `defaultinstall` command should:
1. Set the `PathPreference` in the dotnetup config
2. Handle the difference between `ShellProfile` (modifying shell profile to prepend dotnetup path) and `FullPathReplacement` (replacing the system PATH entry)
3. Not be confused with runtime/SDK migration from admin installs

References to `dotnetup defaultinstall` were removed from the migration prompts in the walkthrough as part of PR #53464, but the command itself needs updating.

## Acceptance Criteria

- [ ] `dotnetup defaultinstall` sets `PathPreference` in the config
- [ ] Support both `ShellProfile` and `FullPathReplacement` modes
- [ ] Add help text explaining what each mode does
- [ ] Add tests for the updated command behavior

## Relevant Code

- `src/Installer/dotnetup/Commands/Walkthrough/WalkthroughWorkflows.cs`
- `src/Installer/dotnetup/DotnetupConfig.cs`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.