Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
476a16d
add initial admin mode .md file
nagilson Oct 12, 2026
a11f9e8
WIP - initial admin spec; hand-written.
nagilson Oct 12, 2026
d82c305
cleanup and sync with meeting feedback
nagilson Oct 14, 2026
6b8be92
Futher expansion upon dotnetup admin edge cases or potential issues
nagilson Oct 14, 2026
0467f68
block unsigned dailies in admin mode by default
nagilson Oct 14, 2026
815bed7
consider muxer replacement option
nagilson Oct 14, 2026
6b1a39f
reg key should enforce admin mode rather than user local config file
nagilson Oct 14, 2026
2ca2542
fix admin mode to be able to revert it with uac
nagilson Oct 14, 2026
d393b2a
admin mode shuold set block unsigned by default - ugh claude made thi…
nagilson Oct 14, 2026
7070a6b
copilot fb
nagilson Oct 14, 2026
014af5c
add learnings from meeting with @joeloff
nagilson Oct 14, 2026
1cad672
dotnetup: add admin access mode contracts
nagilson Oct 14, 2026
63b4199
dotnetup: tag telemetry with access mode
nagilson Oct 14, 2026
b20d2f2
dotnetup: block unsupported commands in admin mode
nagilson Oct 14, 2026
c41c672
dotnetup: switch admin mode with init --mode and env set
nagilson Oct 14, 2026
f0b5e27
dotnetup: install Windows installer bundles in admin mode
nagilson Oct 14, 2026
2d1ac81
dotnetup: check admin installs without loading hostfxr in process
nagilson Oct 14, 2026
eea1f45
dotnetup: harden admin installer verification and cancellation
nagilson Oct 14, 2026
3aad05c
dotnetup: keep self update and setup working across admin mode changes
nagilson Oct 14, 2026
16ee132
dotnetup: document admin mode MVP
nagilson Oct 14, 2026
fc43e90
env script and legacy print env script shouldn't cause shell failure
nagilson Oct 16, 2026
604edaa
dotnetup: localize admin mode guidance and simplify gate diagnostics
nagilson Oct 16, 2026
dee539d
dotnetup: hide migration choices while admin mode is selected
nagilson Oct 16, 2026
0edd196
dotnetup: preserve the explicit untracked install option
nagilson Oct 16, 2026
4a0d2a6
dotnetup: remove unused legacy framework branches from policy store
nagilson Oct 16, 2026
887dc28
dotnetup: ignore user data overrides for installer bundle caches
nagilson Oct 16, 2026
00fadfc
dotnetup: consolidate admin test fixtures and command coverage
nagilson Oct 16, 2026
86fea34
Dont use user controllable directory for admin installs if dotnetup i…
nagilson Oct 16, 2026
fa84796
dotnetup: annotate the Authenticode verifier with its supported platform
nagilson Oct 16, 2026
3db2c88
dotnetup: report a specific error for non-.exe installer downloads
nagilson Oct 16, 2026
3e78ae2
dotnetup: check only host/fxr version directories for hostfxr
nagilson Oct 16, 2026
1535a03
dotnetup: localize installer orchestration messages
nagilson Oct 16, 2026
7852f07
dotnetup: clarify how env set leaves admin mode
nagilson Oct 16, 2026
a16c9c4
dotnetup: remove admin installer details from the signature verificat…
nagilson Oct 16, 2026
3754e0a
dotnetup: document the architecture assumption in admin root resolution
nagilson Oct 16, 2026
16a4bcf
dotnetup: share host-reported install checks between validators
nagilson Oct 16, 2026
e1effff
dotnetup: keep the admin-mode --untracked check in the install command
nagilson Oct 16, 2026
05fe8bc
fix style gates
nagilson Oct 19, 2026
44a57ec
Merge branch 'release/dnup' into nagilson-dotnetup-admin-mvp
nagilson Oct 19, 2026
1a94289
dotnetup: inject the machine policy instead of static test hooks
nagilson Oct 17, 2026
415fad1
dotnetup: complete policy injection coverage
nagilson Oct 19, 2026
4bc05bf
dotnetup: remove redundant bundle tracking assertion
nagilson Oct 19, 2026
cb30dcc
Fix dynamic dotnetup test assets after net12 transition
nagilson Oct 19, 2026
a35b6ab
Localize Windows installer bundle messages
nagilson Oct 19, 2026
e2fd7cd
Use native hostfxr invocation without parsing --list-runtime but with…
nagilson Oct 19, 2026
89259ef
Fix CI to not require sdk to build dotnetup to get sdks
nagilson Oct 19, 2026
3bd97cd
Simplify output instructions for admin mode
nagilson Oct 19, 2026
9e93fe3
Cancellation message doesnt display if its on stderr
nagilson Oct 19, 2026
6b9329d
Shorten ctrl + c interrupt + allow switching out with init --mode
nagilson Oct 19, 2026
c167eb9
Isolate installer cancellation rendering tests from CI enrichment
nagilson Oct 19, 2026
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 .github/memory/FILE_MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Important root files:
| [`src/Common`](../../src/Common), [`src/Microsoft.DotNet.ProjectTools`](../../src/Microsoft.DotNet.ProjectTools), [`src/Microsoft.Extensions.Logging.MSBuild`](../../src/Microsoft.Extensions.Logging.MSBuild) | Cross-area utilities, project tooling, and MSBuild logging support. | Consumed by the owning product areas; verify references before changing shared code. |
| [`src/Microsoft.Net.Sdk.Compilers.Toolset`](../../src/Microsoft.Net.Sdk.Compilers.Toolset), [`src/Microsoft.Win32.Msi`](../../src/Microsoft.Win32.Msi), [`src/System.CommandLine.StaticCompletions`](../../src/System.CommandLine.StaticCompletions) | Compiler toolset packaging, Windows installer support, and shell completion generation. | Consumed by layout, CLI, or platform-specific builds and tests. |
| [`src/SourceBuild`](../../src/SourceBuild) | Source-build-specific content and integration. | Consumed by the VMR/source-only build; use source-build guidance for source-only failures. |
| [`src/Installer`](../../src/Installer) | dotnetup NativeAOT entry point, command library, and installation library. See the [self-update design](../../documentation/general/dotnetup/designs/self-update/self-update-design.md) and [version-query contract](../../documentation/general/dotnetup/designs/self-update/self-update-verification.md). | Self-update uses bounded `--version` children for installed-version queries and startup verification, except that the Windows command gate reads the PE version resource in-process, and Windows self-update links the workload Authenticode checks from `src/Cli/dotnet/Installer/Windows/Security/Signature.cs`; rollback uses transaction state, not an embedded record. Tested by `test/dotnetup.Tests`. |
| [`src/Installer`](../../src/Installer) | dotnetup NativeAOT entry point, command library, and installation library. See the [self-update design](../../documentation/general/dotnetup/designs/self-update/self-update-design.md) and [version-query contract](../../documentation/general/dotnetup/designs/self-update/self-update-verification.md). | Self-update uses bounded `--version` children for installed-version queries and startup verification, except that the Windows command gate reads the PE version resource in-process, and Windows self-update links the workload Authenticode checks from `src/Cli/dotnet/Installer/Windows/Security/Signature.cs`; rollback uses transaction state, not an embedded record. Windows `admin` mode ([design](../../documentation/general/dotnetup/designs/dotnetup-admin-mode.md)) is selected by the `HKLM\SOFTWARE\Policies\Microsoft\dotnet\Dotnetup!AdminMode` value, gates commands through `CommandBase.GetAdminModeSupport`, and installs `.exe` bundles through `src/Installer/dotnetup.Library/WindowsInstaller`. Tested by `test/dotnetup.Tests`. |

## Test Structure

Expand Down
1 change: 1 addition & 0 deletions documentation/general/dotnetup/concepts/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ or later with the `dotnetup env` command.
| `none` | Does not modify these environment variables. Run .NET with `dotnetup dotnet`. |
| `shell` | Modifies the shell profile to set these environment variables. Processes started from that shell use the .NET SDKs and Runtimes installed by dotnetup. |
| `everywhere` | Modifies the system `PATH` and sets the user-level `DOTNET_ROOT` environment variable. Only available on Windows. |
| `admin` | Does not modify these environment variables. Installs run the official .NET installers into Program Files, which manage the system `PATH` themselves. Machine-wide; only available on Windows. See [dotnetup admin mode](../designs/dotnetup-admin-mode.md). |

By default, dotnetup also adds itself to the `PATH`, regardless of the access
mode setting. This can be controlled with
Expand Down
285 changes: 285 additions & 0 deletions documentation/general/dotnetup/designs/dotnetup-admin-mode.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion documentation/general/dotnetup/reference/dotnetup-env-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ The optional .NET access mode:
| `none` | Does not modify these environment variables. Run .NET with `dotnetup dotnet`. |
| `shell` | Modifies the shell profile to set these environment variables. Processes started from that shell use the .NET SDKs and Runtimes installed by dotnetup. |
| `everywhere` | Modifies the system `PATH` and sets the user-level `DOTNET_ROOT` environment variable. Only available on Windows. |
| `admin` | Switches this machine to `admin` mode, in which installs run the official .NET installers into Program Files. Changes a machine-wide setting for all users and asks for administrator permission. Only available on Windows. See [dotnetup admin mode](../designs/dotnetup-admin-mode.md). |

For details about each mode and considerations for `everywhere`, see
[dotnetup environment configuration](../concepts/environment.md).

When you omit `MODE`, the command reapplies the stored mode. The command
fails if no readable configuration exists.
fails if no readable configuration exists. While `admin` mode is active,
omitting `MODE` makes no changes, and selecting another mode leaves `admin`
mode first.

## Options

Expand Down
12 changes: 12 additions & 0 deletions documentation/general/dotnetup/reference/dotnetup-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,21 @@ system-managed installations. For descriptions of the access modes, see

Run this command again to reconfigure dotnetup.

### Admin mode

On Windows, `--mode admin` switches the machine to `admin` mode, in which
`dotnetup sdk install` and `dotnetup runtime install` run the official .NET
installers into Program Files. Switching into or out of `admin` mode changes a
machine-wide setting for all users and asks for administrator permission. While
`admin` mode is active, `dotnetup init` without `--mode` makes no changes; run
`dotnetup init --mode <none|shell|everywhere>` to leave it. For details, see
[dotnetup admin mode](../designs/dotnetup-admin-mode.md).

## Options

| Option | Description |
| --- | --- |
| `--mode <none\|shell\|everywhere\|admin>` | Select the access mode. Without this option, non-interactive runs keep their existing defaults. `admin` is only available on Windows; it switches this machine to `admin` mode and does not install .NET. |
| `--install-path <INSTALL_PATH>` | Select the installation root. |
| `--manifest-path <MANIFEST_PATH>` | Use a custom manifest file. |
| `--no-progress [<true\|false>]` | Disable progress display. |
Expand All @@ -47,4 +58,5 @@ Run this command again to reconfigure dotnetup.
dotnetup init
dotnetup init --shell bash
dotnetup init --install-path .\.dotnet
dotnetup init --interactive false --mode admin
```
19 changes: 19 additions & 0 deletions documentation/general/dotnetup/signature-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,15 @@ does two things:
`UnsignedDownloadBlockedByPolicy` error (defense-in-depth check inside
`DotnetDownloader.ResolveBlobFeedEntry`).

The channel-based predicate only drives the warning. Admin-mode Windows installer
Comment thread
nagilson marked this conversation as resolved.
Outdated
bundles decide whether a failed Authenticode check is acceptable from the actual
download source: only a bundle that was downloaded from the blob feed may run
unsigned, after its SHA-512 hash is verified and only while the IT opt-out is off.
A bundle resolved from the signed releases manifest must always pass Authenticode,
whatever the channel. The bundle is re-hashed against the downloader's expected
hash through a handle that denies write and delete access, and that handle is held
until the installer exits.

### Enabling the IT opt-out

Administrators that want to disallow unsigned dnup downloads can set
Expand All @@ -463,6 +472,13 @@ the policy with the platform-appropriate switch:

Clear the policy by deleting the value (or setting it to `0`).

Enabling dotnetup `admin` mode also sets this value to `1`, and leaving
`admin` mode leaves it unchanged. In `admin` mode, the value controls
whether unsigned daily `.exe` installers may run; see
[dotnetup admin mode](designs/dotnetup-admin-mode.md). The `AdminMode`
value under the same key selects `admin` mode and uses the same `0`/`1`
structure.

- **Linux / macOS** — create the sentinel file
`/etc/dotnet/dnup-block-unsigned-downloads` (any content; existence is
what matters). Example:
Expand All @@ -478,6 +494,9 @@ When the policy is in effect, attempts to install from the daily channel
(or any version that is not present in the signed releases manifest)
fail with a clear `UnsignedDownloadBlockedByPolicy` message directing
the user to choose a released version or escalate to their administrator.
`dotnetup self update` is exempt only when the installed `dotnetup` is
Authenticode-signed (Windows), because the replacement must then carry a
Microsoft-rooted Authenticode signature before it is installed.

The check is centralized in
`src/Installer/Microsoft.Dotnet.Installation/Internal/UnsignedSourcePolicy.cs`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,27 @@ public enum DotnetInstallErrorCode

/// <summary>The user declined confirmation of an operation.</summary>
OperationCancelled,

/// <summary>The invoked command is not supported while dotnetup is in admin mode.</summary>
AdminModeCommandNotSupported,

/// <summary>An option or argument passed to the command is not supported while dotnetup is in admin mode.</summary>
AdminModeSymbolNotSupported,

/// <summary>The operation requires <c>--untracked</c> while dotnetup is in admin mode.</summary>
AdminModeRequiresUntracked,

/// <summary>Admin mode could not be enabled or disabled because elevation was declined or failed, or the policy could not be written.</summary>
AdminModeChangeFailed,

/// <summary>Another Windows Installer (MSI) installation is in progress (exit code 1618).</summary>
InstallerBusy,

/// <summary>The Windows installer bundle returned a failure exit code.</summary>
InstallerFailed,

/// <summary>The Windows installer bundle reported success, but the expected installation could not be verified afterwards.</summary>
InstallerPostInstallVerificationFailed,
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.Dotnet.Installation.Internal;

internal class DotnetArchiveExtractor : IDisposable
internal class DotnetArchiveExtractor : IInstallArtifact
{
private readonly DotnetInstallRequest _request;
private readonly ReleaseVersion _resolvedVersion;
Expand Down
Loading
Loading