microsoft / microsoft/winget-cli

winget doesn't automatically understand machine-scope MSI installers

Open
#3,969 1 comment 7 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

When a winget manifest contains both a user and a machine scope installer definition, both MSIs, winget-cli on the client side doesn't automatically handle the machine-scope case for MSIs (aka appending ALLUSERS=1 on the commandline).

winget-cli should automatically understand machine-scope MSI installs wihtout the package-maintainers having to manually define installer switches. This already works for user-scope MSI (appending /qb, /qn etc., and wix, inno installers etc.).

Proposed technical implementation details

Given an installer manifest excerpt like this:

Installers:
- Architecture: x64
  InstallerType: msi
  Scope: user
  InstallerUrl: https://github.com/pdfarranger/pdfarranger/releases/download/1.10.0/pdfarranger-1.10.0-windows-installer.msi
  InstallerSha256: B77A5DC7C956F1E0986664B0587B9B7532CA304590F4F1C86B03960486DDE4F6
- Architecture: x64
  InstallerType: msi
  Scope: machine
  InstallerUrl: https://github.com/pdfarranger/pdfarranger/releases/download/1.10.0/pdfarranger-1.10.0-windows-installer.msi
  InstallerSha256: B77A5DC7C956F1E0986664B0587B9B7532CA304590F4F1C86B03960486DDE4F6

which is an edited version of https://github.com/microsoft/winget-pkgs/blob/master/manifests/p/PDFArranger/PDFArranger/1.10.0/PDFArranger.PDFArranger.installer.yaml to add support for machine-scope installs, winget-cli should install the MSI properly for all users because "Scope: machine" was defined in the manifest.

Currently, this is not the case. winget-cli does not append the correct parameter (ALLUSERS=1) and the machine-scope installer ends up being installed per-user anyway, despite winget install --scope machine.

A workaround I tested is to manually specify the ALLUSERS=1 switch. This works:

Installers:
- Architecture: x64
  InstallerType: msi
  Scope: user
  InstallerUrl: https://github.com/pdfarranger/pdfarranger/releases/download/1.10.0/pdfarranger-1.10.0-windows-installer.msi
  InstallerSha256: B77A5DC7C956F1E0986664B0587B9B7532CA304590F4F1C86B03960486DDE4F6
- Architecture: x64
  InstallerType: msi
  Scope: machine
  InstallerUrl: https://github.com/pdfarranger/pdfarranger/releases/download/1.10.0/pdfarranger-1.10.0-windows-installer.msi
  InstallerSha256: B77A5DC7C956F1E0986664B0587B9B7532CA304590F4F1C86B03960486DDE4F6
  InstallerSwitches:
    Custom: ALLUSERS=1

However I believe the built-in convenience of winget to automatically know the right parameters for many setup types, including per-user MSI, should be expanded to automatically support per-machine MSI as well so this workaround is no longer needed.

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 tracing the winget-cli MSI installer handling for manifest entries with Scope: machine and the existing per-user MSI switch behavior. Verify the implementation and tests cover appending ALLUSERS=1 for machine-scope MSI installs, including the --scope machine case, without requiring InstallerSwitches.Custom.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.