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

Upgrade available but not installing #2037

Closed
bc3tech opened this issue Mar 22, 2022 · 20 comments
Closed

Upgrade available but not installing #2037

bc3tech opened this issue Mar 22, 2022 · 20 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@bc3tech
Copy link

bc3tech commented Mar 22, 2022

Brief description of your issue

I ask winget for available upgrades. I tell it, then, to upgrade one. It tells me no applicable upgrade was found.

Steps to reproduce

> winget source update ; winget upgrade
Updating all sources...
Updating source: msstore...
Done
Updating source: winget...
  ██████████████████████████████  100%
Done
Name             Id                       Version     Available   Source
------------------------------------------------------------------------
Microsoft Teams  Microsoft.Teams          1.4.0.22976 1.5.00.4689 winget
Markdown Monster WestWind.MarkdownMonster 2.4.0.0     2.4.6.0     winget
2 upgrades available.
> winget upgrade WestWind.MarkdownMonster
No applicable update found.

Expected behavior

It should've upgraded Markdown Monster

Actual behavior

It says no upgrade is available despite previously showing me an available one

Environment

> winget --info
Windows Package Manager v1.2.10271
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22572.201
Package: Microsoft.DesktopAppInstaller v1.17.10271.0
@ghost ghost added the Needs-Triage Issue need to be triaged label Mar 22, 2022
@Trenly
Copy link
Contributor

Trenly commented Mar 23, 2022

Can you provide the log files which are created when you try winget upgrade WestWind.MarkdownMonster --verbose-logs ?

@brandonh-msft
Copy link

brandonh-msft commented Mar 23, 2022

ran that command:

> winget upgrade WestWind.MarkdownMonster --verbose-logs
No applicable update found.

Where are the logs put? (side note: would be great to simply print out "Logs written to XXXX" when you run a command with --verbose-logs)

@denelon
Copy link
Contributor

denelon commented Mar 23, 2022

@brandonh-msft you can run winget --info to see the log path.

@denelon
Copy link
Contributor

denelon commented Mar 23, 2022

@brandonh-msft how many instances of MarkdownMonster are displayed in Windows Apps & Features? It's possible we detected an older version, and the newer version was already installed.

@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Mar 23, 2022
@brandonh-msft
Copy link

brandonh-msft commented Mar 23, 2022

@brandonh-msft you can run winget --info to see the log path.

Log in this gist

@brandonh-msft how many instances of MarkdownMonster are displayed in Windows Apps & Features? It's possible we detected an older version, and the newer version was already installed.

image

@Trenly
Copy link
Contributor

Trenly commented Mar 23, 2022

Looks like it may be an issue with [winget-pkgs] specifying the wrong scope -

2022-03-23 08:05:56.518 [CLI ] Installer [X64,inno,User,] not applicable: Installer scope does not matched currently installed scope: User != Machine

The installer places the registry entries at

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{E3476879-4D00-405A-B058-90D4AEAD7C4A}_is1

@brandonh-msft
Copy link

brandonh-msft commented Mar 23, 2022

Looks like it may be an issue with [winget-pkgs] specifying the wrong scope -

Could be.
In my winget settings I've added the install pref to prefer User install instead of machine install

    "installBehavior": {
        "preferences": {
            "scope": "user"
        }
    }

Trenly added a commit to Trenly/winget-pkgs that referenced this issue Mar 23, 2022
Trenly added a commit to Trenly/winget-pkgs that referenced this issue Mar 23, 2022
Trenly added a commit to Trenly/winget-pkgs that referenced this issue Mar 23, 2022
Trenly added a commit to Trenly/winget-pkgs that referenced this issue Mar 23, 2022
@Trenly
Copy link
Contributor

Trenly commented Mar 23, 2022

Looks like it may be an issue with [winget-pkgs] specifying the wrong scope -

Could be. In my winget settings I've added the install pref to prefer User install instead of machine install

    "installBehavior": {
        "preferences": {
            "scope": "user"
        }
    }

That is true, but unless I'm wrong, a preference shouldn't cause the failure, only a requirement should. Is this accurate @denelon ?

Either way, when I try it on a sandbox and default settings, I get the same error. Changing the metadata in the manifest seemed to resolve the error in my sandbox environment, so I've opened a few PR's over at winget-pkgs

@denelon
Copy link
Contributor

denelon commented Mar 23, 2022

If a package supports both scopes, then the preference would be honored. If it only supported the other scope, having the preference would allow the other scope to be used. Or at least that's what it's supposed to do (there might be a bug).

@ItzLevvie
Copy link

ItzLevvie commented Mar 23, 2022

Looks like it may be an issue with [winget-pkgs] specifying the wrong scope -

2022-03-23 08:05:56.518 [CLI ] Installer [X64,inno,User,] not applicable: Installer scope does not matched currently installed scope: User != Machine

The installer places the registry entries at

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{E3476879-4D00-405A-B058-90D4AEAD7C4A}_is1

It's related to what's happening in microsoft/winget-pkgs#47655 (@OfficialEsco) due to the installer placing the registry entry in the incorrect location which prevents the upgrades from working.

Some Current User (Scope: user) installers in the package repository are installing to %USERPROFILE% but the registry entry is located in HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER which breaks the application upgrade because Machine != User.

Some All Users (Scope: machine) installers in the package repository are installing to %ProgramFiles% but the registry entry is located in HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE which breaks the application upgrade because User != Machine.

^ You can take RubyInstallerTeam.Ruby version 3.1.0-1 as an example. It installs to C:\Ruby31-x64 which is a machine-wide directory but when you run winget upgrade RubyInstallerTeam.Ruby you will get the No applicable update found. message because the registry entry is located in Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\RubyInstaller-3.1-x64-mingw-ucrt_is1 instead of HKEY_LOCAL_MACHINE. Package has Scope: machine in it.

Technically we're meant to use Scope: machine for packages that install outside of %USERPROFILE% because that's what I think @denelon said in one of the pull requests that @vedantmgoyal2009 made as @denelon doesn't want packages to be mislead as machine-wide when it actually installs to %USERPROFILE% or mislead as current user when it actually installs to %ProgramFiles% or other machine-wide directories.

EDIT (below):

Here's another example: SumatraPDF. It installs to %USERPROFILE% but requires UAC (administrator permissions) and the registry entry is located in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SumatraPDF instead of HKEY_CURRENT_USER.

SumatraPDF's package has Scope: user but the package upgrades doesn't work because of the incorrect registry entry location so the only workaround for that would be to change it to Scope: machine for upgrades to work properly.

ghost pushed a commit to microsoft/winget-pkgs that referenced this issue Mar 23, 2022
ghost pushed a commit to microsoft/winget-pkgs that referenced this issue Mar 23, 2022
ghost pushed a commit to microsoft/winget-pkgs that referenced this issue Mar 23, 2022
ghost pushed a commit to microsoft/winget-pkgs that referenced this issue Mar 23, 2022
@Trenly
Copy link
Contributor

Trenly commented Mar 23, 2022

It's related to what's happening in microsoft/winget-pkgs#47655 (@OfficialEsco) due to the installer placing the registry entry in the incorrect location which prevents the upgrades from working.

Some Current User (Scope: user) installers in the package repository are installing to %USERPROFILE% but the registry entry is located in HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER which breaks the application upgrade because Machine != User.

Some All Users (Scope: machine) installers in the package repository are installing to %ProgramFiles% but the registry entry is located in HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE which breaks the application upgrade because User != Machine.

Gotta love publisher inconsistency

@ghost
Copy link

ghost commented Mar 23, 2022

I have the same issue when I'm trying upgrade --all, --force or for id. Including VS C++ package 2015-2019.

(3/3) Encontrado Microsoft Visual C++ 2015-2019 Redistributable (x64) [Microsoft.VC++2015-2019Redist-x64] Versão 14.29.30139.0 Este aplicativo é licenciado para você pelo proprietário. A Microsoft não é responsável por, nem concede licenças a pacotes de terceiros. Downloading https://download.visualstudio.microsoft.com/download/pr/b929b7fe-5c89-4553-9abe-6324631dcc3a/296F96CD102250636BCD23AB6E6CF70935337B1BBB3507FE8521D8D9CFAA932F/VC_redist.x64.exe ██████████████████████████████ 24.0 MB / 24.0 MB Hash do instalador verificado com êxito Iniciando a instalação do pacote... O instalador falhou com o código de saída: 1638 O registro do instalador está disponível em: C:\Users\Aluandalee\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.VC++2015-2019Redist-x64.14.29.30139.0-2022-03-23-17-38-19.547.log Outra versão deste aplicativo já está instalada.

image

Log

@Trenly
Copy link
Contributor

Trenly commented Mar 23, 2022

Hash do instalador verificado com êxito Iniciando a instalação do pacote... O instalador falhou com o código de saída: 1638 O registro do instalador está disponível em: C:\Users\Aluandalee\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.VC++2015-2019Redist-x64.14.29.30139.0-2022-03-23-17-38-19.547.log Outra versão deste aplicativo já está instalada.

This is an entirely different issue; Your issue is that Visual C++ installer itself is giving an error code 1638. 1638 means that another version of the package is already installed. Based on your screenshot, you can't upgrade because you already have a newer version installed.

@OfficialEsco
Copy link

Hmm, looks like a 1.1 issue (maybe still in 1.2?), VC++ finally installs correctly for me on 1.3...
Before it would install EITHER x64 or x86 then just skip the other install because it thought it was updated (regex issue)

@Trenly
Copy link
Contributor

Trenly commented Mar 23, 2022

Hmm, looks like a 1.1 issue (maybe still in 1.2?), VC++ finally installs correctly for me on 1.3... Before it would install EITHER x64 or x86 then just skip the other install because it thought it was updated (regex issue)

I agree, however, it seems like the VC++ installer is finding some other related product. I checked and these product codes don't seem to exist in the repo at all, so I don't know what package they are to

[0754:163C][2022-03-23T17:38:20]i103: Detected related package: {A181A302-3F6D-4BAD-97A8-A426A6499D78}, scope: PerMachine, version: 14.31.31103.0, language: 0 operation: Downgrade
[0754:163C][2022-03-23T17:38:20]i103: Detected related package: {A977984B-9244-49E3-BD24-43F0A8009667}, scope: PerMachine, version: 14.31.31103.0, language: 0 operation: Downgrade
|
[0754:11D4][2022-03-23T17:38:20]e000: Error 0x80070666: Cannot install a product when a newer version is installed.
[0754:163C][2022-03-23T17:38:20]i500: Shutting down, exit code: 0x666

@ghost
Copy link

ghost commented Mar 23, 2022

Hash do instalador verificado com êxito Iniciando a instalação do pacote... O instalador falhou com o código de saída: 1638 O registro do instalador está disponível em: C:\Users\Aluandalee\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.VC++2015-2019Redist-x64.14.29.30139.0-2022-03-23-17-38-19.547.log Outra versão deste aplicativo já está instalada.

This is an entirely different issue; Your issue is that Visual C++ installer itself is giving an error code 1638. 1638 means that another version of the package is already installed. Based on your screenshot, you can't upgrade because you already have a newer version installed.

This is an example only. I had the same issue with MegaSync and had to force refresh some programs a few times. Apparently the tool is not able to verify if there is the newest version installed and when it runs 'winget upgrade' it returns that it is still there to install, as if it were a cache error.

@Trenly
Copy link
Contributor

Trenly commented Mar 23, 2022

This is an example only. I had the same issue with MegaSync and had to force refresh some programs a few times. Apparently the tool is not able to verify if there is the newest version installed and when it runs 'winget upgrade' it returns that it is still there to install, as if it were a cache error.

MegaSync is yet another completely different issue. The issue with MegaSync is that the publisher does not provide a version number when the package is installed - See microsoft/winget-pkgs#15946

@Trenly
Copy link
Contributor

Trenly commented Mar 23, 2022

@denelon - I believe the original issue here was resolved with microsoft/winget-pkgs#55454

@denelon denelon added this to the v1.3-Client milestone Apr 14, 2022
@denelon denelon modified the milestones: v1.3-Client, v1.4-Client May 31, 2022
@tribbloid
Copy link

thanks a lot, also affect me

@denelon denelon closed this as completed Aug 9, 2022
@sitiom
Copy link

sitiom commented Feb 26, 2023

Related: #3011

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

No branches or pull requests

8 participants