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

Already installed app are not detected #216

Closed
aavdberg opened this issue May 19, 2020 · 15 comments
Closed

Already installed app are not detected #216

aavdberg opened this issue May 19, 2020 · 15 comments
Labels
Issue-Feature This is a feature request for the Windows Package Manager client. Needs-Author-Feedback Issue needs attention from issue or PR author
Milestone

Comments

@aavdberg
Copy link

aavdberg commented May 19, 2020

Brief description of your issue

Have installed Windows Terminal latest version and when run winget install "Windows Terminal" it gets installed again and don't detect that it was already installed.

Steps to reproduce

run winget install for a application that you have already installed with same version.

Expected behavior

Detect that app already is installed and give option to abort or overwrite. or text that you have to use extra parameter to overwrite.

Actual behavior

Environment

[winget --info]
Windows Package Manager v0.1.41331 Preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19628.1
Package: Microsoft.DesktopAppInstaller v1.0.41331.0
Any other software?
@denelon denelon added this to the Package Manager Backlog milestone May 23, 2020
@denelon denelon added the Issue-Feature This is a feature request for the Windows Package Manager client. label May 28, 2020
@Josh65-2201
Copy link

I think for the sake of batch scripts it should have a toggle that can be put at the start to skip already installed packages. example winget --skipInstalled

@alex-ong
Copy link

alex-ong commented Jun 9, 2021

I agree with josh-65; default behavior should do something logically and without user input. It can always output something afterwards, like you already have version 4.1 installed, installing 4.latest

If it's already installed the default behaviour should be to re-install over the top, or uninstall/reinstall.
By default, it installs the latest version. if this is different to what is currently installed, treat it as a different version being specified.

If a different version is specified, what should happen? Some apps support multiple versions installed (e.g. python), other's dont.

  • If it supports multiple versions, it would depend on the version specified.
    E.g.
    Installed python = 3.7.9, 3.6.2, 3.8.5
    winget install python --version "3.8.9"
    Now we have 4 installed
    winget install python --version "3.8"
    replaces 3.8.5 with 3.8.latest. Note that this relies on version specific feature #227 first.

  • If it only supports one version, then you'd expect it to replace the current installation.

@hotrungnhan
Copy link

Is this sovle ?

@fmms
Copy link

fmms commented Oct 12, 2021

I hit this issue today as well. Issuing the winget command two times in a row should not download and install the software twice. All Linux package managers e.g. yum, zypper, apt-get skip in that case. Chocolatey skips as well...

@Josh65-2201
Copy link

Even if it does have version information it still gets re-installed using winget install. I don't think any one here is talking about the upgrade command anyway.

@fmms
Copy link

fmms commented Oct 12, 2021

I agree there might be cases where I want to repair an installation. However, in general I believe I want to install stuff and in case it is already installed it should just be skipped. Indeed I was talking about winget install rather than winget upgrade.

@bdistin
Copy link

bdistin commented Dec 1, 2021

Seems like the issue is just around default behavior, and other behavior could be solved with flags rather than workarounds like uninstalling first. ie:

If it skips by default, and you want to repair the command could be something like winget install --force

if it reinstalls by default, and you want it to skip it could be something like winget install --skip-installed like @josh-65 suggested.

Edit:
Seems the syntax apt uses is apt-get --reinstall install PackageNameHere to force repair/reinstall. Not sure if the UX would be better to be similar to other existing package managers.

@btTeddy
Copy link

btTeddy commented Dec 4, 2021

I know is only 18 months since issue reported, but is there any chance to get it sorted?

@denelon
Copy link
Contributor

denelon commented Feb 18, 2022

We've recently implemented changes to not display when the version is "Unknown" in upgrade and "--include-unknown" to upgrade them. We are working on:

Once we have the matching improved, this will become one of the next features we're looking at. One of the changes we're considering is when a user runs winget install Microsoft.WindowsTerminal and the current version is installed, we will inform the user. If the version is newer, then we will inform the user and switch to the "upgrade" behavior. Some installers have specific switches we must pass to them to perform an upgrade as the install would fail (Visual Studio has this behavior).

The "--force" switch will still be honored in either case.

@henryhooverville
Copy link

I'm finding that winget is both really powerful - as all package managers are - but also this particular issue makes it quite impossible to script and manage an estate using scripts with winget to for example install applications and if they are installed to skip the installations. This is particularly visible with MS Teams which will force-close when installing, which you wouldn't want to force using InTune scripts because it would make MS Teams consistently unavailable for end-users.

@bobbintb
Copy link

bobbintb commented Aug 10, 2022

For the most part, the program not having a version in control panel seems to be an issue. I add a version number via the registry and the program no longer keeps installing. There are a few where they do not have a version number and adding it does not fix the issue. I use the same version number reported by winget.

Edit: It seems if WindowsInstaller does not exist or set to 1 in the registry entry it will keep reinstalling as well.

@denelon
Copy link
Contributor

denelon commented Aug 10, 2022

Many of the challenges we're trying to work through are related to installers that aren't as robust as we would like them to be. In many cases, we identify classes of issues and attempt to look at ways we can give hints to the client and users via the winget manifest. There are also additional improvements we're making on the validation side to provide better information back to PR authors so they know what metadata to add or when things don't match what was suggested.

Packages that install side-by-side are another problem space we're working on:

We're trying to meet developers where they are in terms of installer technologies and capabilities and determine reasonable default behaviors (and arguments to control behavior). Over time, we're hoping more developers will learn from user feedback associated with the Windows Package Manager to improve experiences.

@denelon
Copy link
Contributor

denelon commented Aug 10, 2022

We will be working on improvements for packages that are already installed when a user runs winget install <package> so we look for an update rather than just blindly installing the same thing again. We would still allow --force, but the default flow would switch to upgrade logic and the user would be informed.

@denelon
Copy link
Contributor

denelon commented Feb 16, 2023

@aavdberg, I believe this Issue has been resolved with our latest release.

Please confirm 😊

@denelon denelon added the Needs-Author-Feedback Issue needs attention from issue or PR author label Feb 16, 2023
@KoditkarVedant
Copy link

@denelon I have tried - the latest release seems to resolved the issue.

@denelon denelon closed this as completed Feb 27, 2023
@denelon denelon modified the milestones: Backlog-Client, v1.5-Client Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature This is a feature request for the Windows Package Manager client. Needs-Author-Feedback Issue needs attention from issue or PR author
Projects
None yet
Development

No branches or pull requests