microsoft / microsoft/winget-cli

Package install UAC prompt is minimized when using WinGet COM API

Open
#3,335 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Feature
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Description of the new feature / enhancement

COM API for installing a package that requires elevation prompts a UAC that is minimized in the taskbar which can possibly be missed by the user.

image

Code used for this issue:

// winget search "Microsoft.DotNet.SDK.Preview"
var filter = _factory.CreatePackageMatchFilter();
filter.Option = PackageFieldMatchOption.ContainsCaseInsensitive;
filter.Field = PackageMatchField.CatalogDefault;
filter.Value = "Microsoft.DotNet.SDK.Preview";
findOptions.Selectors.Add(filter);
var match = _connectResult.PackageCatalog.FindPackages(findOptions);

// winget install {catalog package} --silent
var package = match.Matches[0].CatalogPackage;
var options = _factory.CreateInstallOptions();
options.PackageInstallMode = PackageInstallMode.Silent;
_pm.InstallPackageAsync(package, options).GetAwaiter().GetResult();
Proposed technical implementation details

Option to full-screen the UAC prompt or provide an API to set the parent window of the UAC dialog.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the COM API flow shown, especially CreateInstallOptions and InstallPackageAsync after package discovery. Trace how the elevated installation invokes the UAC prompt and determine whether the proposed full-screen behavior or parent-window API is feasible. Done means an elevated prompt is reliably visible or the API exposes the requested parent-window control.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
api, operating-systems, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.