Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winget upgrade does not respect the scope used on installation #5099

Open
JanDeDobbeleer opened this issue Dec 28, 2024 · 4 comments
Open

winget upgrade does not respect the scope used on installation #5099

JanDeDobbeleer opened this issue Dec 28, 2024 · 4 comments
Labels
Command-Upgrade Issue related to WinGet Upgrade Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@JanDeDobbeleer
Copy link

Brief description of your issue

When using winget install in a non-elevated terminal, the installation is done with scope: user. However, when using upgrade immediately after in the same terminal window, the scope is identified as system.

Steps to reproduce

Install v27.17.0

winget install JanDeDobbeleer.OhMyPosh -v 24.17.0
2024-12-28 17:24:43.631 [CLI ] Starting installer selection.
2024-12-28 17:24:43.631 [CLI ] Installer [X64,msi,Machine,] is current best choice
2024-12-28 17:24:43.631 [CLI ] Installer [X64,msi,User,] is better [strong] than [X64,msi,Machine,] due to: Scope
2024-12-28 17:24:43.631 [CLI ] Installer [X64,msi,User,] is current best choice
2024-12-28 17:24:43.631 [CLI ] Installer [X64,msi,User,] is better [strong] than [X86,msi,Machine,] due to: Scope
2024-12-28 17:24:43.631 [CLI ] Installer [X64,msi,User,] is better [weak] than [X86,msi,User,] due to: Machine Architecture
2024-12-28 17:24:43.631 [CLI ] Installer [X64,msi,User,] is better [strong] than [Arm64,msi,Machine,] due to: Scope
2024-12-28 17:24:43.631 [CLI ] Installer [Arm64,msi,User,] is better [strong] than [X64,msi,User,] due to: Machine Architecture
2024-12-28 17:24:43.631 [CLI ] Installer [Arm64,msi,User,] is current best choice
2024-12-28 17:24:43.631 [CLI ] Completed installer selection.
2024-12-28 17:24:43.631 [CLI ] Selected installer Architecture: 4
2024-12-28 17:24:43.631 [CLI ] Selected installer URL: https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v24.17.0/install-arm64.msi
2024-12-28 17:24:43.631 [CLI ] Selected installer InstallerType: msi
2024-12-28 17:24:43.631 [CLI ] Selected installer Scope: User

Upgrade to latest

winget upgrade JanDeDobbeleer.OhMyposh
2024-12-28 17:26:57.914 [CLI ] Starting installer selection.
2024-12-28 17:26:57.914 [CLI ] Installer [X64,msi,Machine,] is current best choice
2024-12-28 17:26:57.914 [CLI ] Installer [X64,msi,User,] not applicable: Installer scope does not match currently installed scope: User != Machine
2024-12-28 17:26:57.914 [CLI ] Installer [X64,msi,Machine,] is better [weak] than [X86,msi,Machine,] due to: Machine Architecture
2024-12-28 17:26:57.914 [CLI ] Installer [X86,msi,User,] not applicable: Installer scope does not match currently installed scope: User != Machine
2024-12-28 17:26:57.914 [CLI ] Installer [Arm64,msi,Machine,] is better [strong] than [X64,msi,Machine,] due to: Machine Architecture
2024-12-28 17:26:57.914 [CLI ] Installer [Arm64,msi,Machine,] is current best choice
2024-12-28 17:26:57.914 [CLI ] Installer [Arm64,msi,User,] not applicable: Installer scope does not match currently installed scope: User != Machine
2024-12-28 17:26:57.914 [CLI ] Completed installer selection.
2024-12-28 17:26:57.914 [CLI ] Selected installer Architecture: 4
2024-12-28 17:26:57.914 [CLI ] Selected installer URL: https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v24.17.1/install-arm64.msi
2024-12-28 17:26:57.914 [CLI ] Selected installer InstallerType: msi
2024-12-28 17:26:57.914 [CLI ] Selected installer Scope: Machine

Expected behavior

It should also identify Installer [Arm64,msi,User,] is current best choice on upgrade.

Actual behavior

It identifies Installer [Arm64,msi,Machine,] is current best choice.

Full logs below.

WinGet-2024-12-28-17-26-54.424.log
WinGet-2024-12-28-17-24-39.755.log

Environment

Windows Package Manager v1.9.25200
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.26100.2605
System Architecture: Arm64
Package: Microsoft.DesktopAppInstaller v1.24.25200.0

Winget Directories                 
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links               
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Dec 28, 2024
@denelon denelon added Command-Upgrade Issue related to WinGet Upgrade Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Dec 28, 2024
@litmowise
Copy link

I have this related problem, using the winget upgrade command to upgrade a software programme results in two different versions.

Image

@litmowise
Copy link

Updating with the winget upgrade command also results in one more set of environment variables.

First installation

current user env
C:\Users\xxx\AppData\Local\Programs\oh-my-posh\themes
C:\Users\xxx\AppData\Local\Programs\oh-my-posh\bin\

After updating

local machine env (system env)
C:\Program Files (x86)\oh-my-posh\themes
C:\C:\Program Files (x86)\oh-my-posh\bin\

@JanDeDobbeleer
Copy link
Author

Updating with the winget upgrade command also results in one more set of environment variables.

@litmowise that's a side effect of the issue described above.

@litmowise
Copy link

@JanDeDobbeleer Thank you, I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-Upgrade Issue related to WinGet Upgrade Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

3 participants