winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

winget upgrade does not pre-install a new dependency

Open chatcoda opened this issue 1 year ago • 4 comments

Brief description of your issue

Consider the following example:

winget list DBVis.DBVisualizer
Name         Id                 Version Available Source
--------------------------------------------------------
DbVisualizer DBVis.DBVisualizer 23.1    24.1      winget
winget upgrade DBVis.DBVisualizer
Found DbVisualizer [DBVis.DBVisualizer] Version 24.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
This package requires the following dependencies:
  - Packages
      Oracle.JavaRuntimeEnvironment
Installing dependencies:
(1/1) Found Java 8 [Oracle.JavaRuntimeEnvironment] Version 8.0.4010.10
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash

Then nothing occurs after the installer hash verification: [Oracle.JavaRuntimeEnvironment] is not installed and [DBVis.DBVisualizer] is not updated.

Steps to reproduce

  1. Install https://www.dbvis.com/product_download/dbvis-23.1/media/dbvis_windows-x64_23_1_jre.exe
  2. winget upgrade DBVis.DBVisualizer

Expected behavior

Dependency should be installed and the main package updated.

Actual behavior

Dependency is not installed and the main is not updated.

Environment

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

Windows: Windows.Desktop v10.0.22631.3007
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3482.0

chatcoda avatar Jan 29 '24 11:01 chatcoda

Hi @chatcoda,

Thanks for pasting the console output. It helps a lot.

The PR for this package includes the JRE dependency. Based on this and the console output, I'm guessing that the install process is reaching an error with the dependency, and not quite advancing to the main package install.

We only have one manifest version for DBVis.DBVisualizer - 24.1. The version existing on your system - 23.1 - must have been installed through other means. And a JRE or JDK might already be installed on your system, possibly even conflicting with the dependency.

Sometimes, even the installer type can cause a conflict, as it's not advised to install a package through one means (i.e. an Inno installer) and uninstall through another means (such as an MSI). In those cases, the user has to manually uninstall the old version before the new version can be installed - this has to be done manually as there's no manifest for the previous version with (un)install instructions. This kind of situation is common when upgrading a package with WInGet for the first time, and there is messaging to indicate this on the main package install. What appears to have happened here is that it happened with the dependency instead of the main package install.

Could you check your system for other Java software, and consider either upgrading or removing it before trying the install again?


Feature Request: Improve messaging when a dependency needs to be manually uninstalled and reinstalled.

stephengillie avatar Jan 29 '24 14:01 stephengillie

I could also reproduce the same by manually installing the 23.1 version and upgrading to 24.1. Here are the verbose logs

WinGet-2024-01-29-04-12-10.477.log

@chatcoda As a workaround, can you try winget upgrade DBVis.DBVisualizer --skip-dependencies? I could get it to upgrade fine without the dependency

mdanish-kh avatar Jan 29 '24 14:01 mdanish-kh

@stephengillie and @mdanish-kh thanks for your answers. In fact, I was only pointing out this problem to help improve winget. When I wrote this post, the problem had already been solved by running winget install Oracle.JavaRuntimeEnvironment before winget upgrade DBVis.DBVisualizer. I don't think conflict is the explanation. I tried it from Windows Sandbox, and the problem was identical...

chatcoda avatar Jan 29 '24 17:01 chatcoda

This issue crops up when doing an upgrade -all when a program such as DBVisualizer is installed.

@stephengillie and @mdanish-kh thanks for your answers. In fact, I was only pointing out this problem to help improve winget. When I wrote this post, the problem had already been solved by running winget install Oracle.JavaRuntimeEnvironment before winget upgrade DBVis.DBVisualizer. I don't think conflict is the explanation. I tried it from Windows Sandbox, and the problem was identical...

@chatcoda This just allowed me to update my system. Thank you!

Crazzzme avatar Feb 01 '24 09:02 Crazzzme

[Policy] Issue-Bug [Policy] Command-Upgrade [Policy] Dependencies

Trenly avatar Mar 06 '24 23:03 Trenly