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

Upgrade an installed App

Open denelon opened this issue 6 years ago • 94 comments

As a user I want to be able to use winget to install the most current version of a currently installed program so I don't have to go find it.

Experimental Feature winget upgrade - displays installed packages with an available upgrade. winget upgrade -? - displays help for the upgrade command. winget upgrade --all - upgrades all packages with an available upgrade. winget upgrade <package> - upgrades the specified package.

Note: upgrade depends on list also being enabled.

winget features - displays all experimental features and their status winget settings - launches settings.json to configure settings like experimental features

Edited: experimental status

denelon avatar May 11 '20 21:05 denelon

If the command is executed without any parameters, it could update "everything" installed by winget.

denelon avatar May 11 '20 21:05 denelon

I would strongly suggest we stick to the verbs familiar from apt:

winget update #Refreshes the repositories
winget upgrade #Actually updates apps

One of the very confusing things about package managers are the different syntaxes they use. I don't speak for everyone, but I genuinely find pacman, yum and dnf confusing. zypper is ok.

apt is popular and - imo - easy to understand. Introducing update as a command that actually starts updating apps would break muscle memory I believe

jantari avatar May 19 '20 18:05 jantari

I would strongly suggest we stick to the verbs familiar from apt:

winget update #Refreshes the repositories
winget upgrade #Actually updates apps

Yea, agreed. This is what Homebrew (brew) uses too, so even more prior-art here.

Rican7 avatar May 19 '20 18:05 Rican7

I think we can probably get away from the requirement to have a command to to 'refresh the repositories'. It feels like a little step backwards in time having to refresh apt, compared to yum. Surely the tool can work out if the repositories require updating automatically?

If we need to operate in a cached/offline mode that shouldn't that extreme edge case require a parameter rather than be the default?

As to which verb, update/upgrade? Why not allow the use of both?

khobbits avatar May 19 '20 21:05 khobbits

I agree with @khobbits that a "refresh the repos" commands is a backward step. I really hope that winget does not need to manually refresh the repositories before an update. On the other hand, I see @jantari's and @Rican7's PoV. Probably then the solution is somewhere in the middle. Disregard winget update and use winget upgrade as the default command.

Another solution might be that update is an alias for upgrade (or via versa).

despotak avatar May 19 '20 22:05 despotak

Yea, agreed. This is what Homebrew (brew) uses too, so even more prior-art here.

Agree with @khobbits and @despotak and just wanted to pitch in that Homebrew automatically updates when you brew install, brew upgrade or brew tap (see the man page and search for AUTO_UPDATE).

Another solution might be that update is an alias for upgrade (or via versa).

This seems like the best solution to me.

seanfisher avatar May 19 '20 22:05 seanfisher

While it may not be the right option for winget, apt separated update and upgrade steps for a reason. Besides not having to update the package list for every operation, it enables it to update the package list on a schedule, run security upgrades automatically, and give notifications in the MOTD when you log in about other packages that can be upgraded, without actually upgrading them.

Chocolatey does this with a separate outdated command.

lordcheeto avatar May 20 '20 01:05 lordcheeto

glad to see I'm not the only one praying for the love of God keep the update vs upgrade complexity out of Windows. Chocolatey's been just fine w/o it.

bc3tech avatar May 20 '20 16:05 bc3tech

update / upgrade is there for a reason. Perhaps you just want to check how much is going to be upgraded - or check the package list for anything that looks risky and do it later? Would be a step backward to not be able to do this imo

jaydn avatar May 21 '20 04:05 jaydn

Does winget work kind of chocolatey now? Chocolatey has local repository of installed packages, so that it can update them in case I want to all in 1 batch. But in case I'm upgrading already installed package from it's update system - there will be no problem. For now winget seems very basic, there is no command to see the already installed packages, so I assume that maybe it just downloads the installers and runs them with default parameters... One of the main reasons of package management for me is also security, I've not found any mentions of how package is checked before it's added to the repository of winget.

0x49D1 avatar May 21 '20 06:05 0x49D1

So how about all of these (with upgrade being an alias for update as already suggested):

  • winget update to update meta-data and upgrade all packages
  • winget update <package> to update meta-data and upgrade only <package>
  • winget update --only-meta-data to update meta-data only and upgrade no packages
  • winget update --no-meta-data to upgrade all packages based on local (not updated) meta-data
  • winget update --no-meta-data <package> to upgrade only <package> based on local (not updated) meta-data

I believe it's also important to be able to list all available updates without actually installing them, but that probably does not require a separate command and can simply be accomplished by a prompt before the actual update / upgrade.

sschuberth avatar May 21 '20 07:05 sschuberth

What's probably way more difficult than implementing the update command itself is the logic to automatically get the version of programs in order to determine if there is an update available. Many installers / executables do not maintain their embedded "File version" / "Product version", and there simply is no unified way how Windows programs announce their updates or check for updates themselves.

Edit: Looks like I misunderstood how winget is supposed to work. It does not even try to determine whether upstream has released a new version, but solely relies on its own meta-data which has to be maintained for each version of a package.

sschuberth avatar May 21 '20 08:05 sschuberth

What's probably way more difficult than implementing the update command itself is the logic to automatically get the version of programs in order to determine if there is an update available. Many installers / executables do not maintain their embedded "File version" / "Product version", and there simply is no unified way how Windows programs announce their updates or check for updates themselves.

Edit: Looks like I misunderstood how winget is supposed to work. It does not even try to determine whether upstream has released a new version, but solely relies on its own meta-data which has to be maintained for each version of a package.

The manifest yaml file that a company has to provide includes the version number in it. This should be easy to find then. Better yet it seems that the way everything is structured that the manifest name itself is the version number under the application folder.

https://github.com/microsoft/winget-pkgs/blob/master/manifests/Anki/Anki/2.1.26.yaml image

https://github.com/microsoft/winget-pkgs/tree/master/manifests/Adobe/Brackets image

crumdev avatar May 21 '20 13:05 crumdev

update / upgrade is there for a reason. Perhaps you just want to check how much is going to be upgraded - or check the package list for anything that looks risky and do it later? Would be a step backward to not be able to do this imo

which is why chocolatey added outdated (has already been proposed here). update/upgrade is confusing to literally every person unfamiliar with Linux.

bc3tech avatar May 21 '20 15:05 bc3tech

Shouldn't that just be another switch to "show what you are going to do"?

For instance, apt-get has a switch "-s/--simulate/--just-print/--dry-run/--recon/--noact" that just reports what it's going to upgrade, but doesn't actually do it.

twindan avatar May 21 '20 17:05 twindan

Shouldn't that just be another switch to "show what you are going to do"?

For instance, apt-get has a switch "-s/--simulate/--just-print/--dry-run/--recon/--noact" that just reports what it's going to upgrade, but doesn't actually do it.

And chocolatey has

     --noop, --whatif, --what-if
     NoOp / WhatIf - Don't actually do anything.

but IMO that should be filed as another issue if ppl want it. I've never used the feature.

bc3tech avatar May 21 '20 18:05 bc3tech

I have to change my OS to the insider version to try this? I don't see what to do with this block of code that I downloaded from Github???

i255d avatar May 21 '20 21:05 i255d

While it may not be the right option for winget, apt separated update and upgrade steps for a reason. Besides not having to update the package list for every operation, it enables it to update the package list on a schedule, run security upgrades automatically, and give notifications in the MOTD when you log in about other packages that can be upgraded, without actually upgrading them.

Chocolatey does this with a separate outdated command.

Except some savings in network traffic and server computing power, all the benefits you mentioned can be achieved without an offline cache, or at least without an explicit command to update offline cache. Assuming network data usage is not a problem, some benefits are actually burdens. For example: there is no need to update the package list on a schedule because local winget always accesses the online package list which is always up-to-date.

An update command that actually updates packages with a --dry-run switch is enough. Internally, winget can maintain certain local cache for performance optimization, but there is no need to expose that to users.

cnshenj avatar May 21 '20 23:05 cnshenj

I have to change my OS to the insider version to try this?

No

I don't see what to do with this block of code that I downloaded from Github???

Please read Installing the client

If you are talking about the --update feature, it's not available yet.

catthehacker avatar May 21 '20 23:05 catthehacker

I have to change my OS to the insider version to try this?

No

I don't see what to do with this block of code that I downloaded from Github???

Please read Installing the client

If you are talking about the --update feature, it's not available yet.

I have read Installing the client, it doesn't give any directions. It says I have to get on the insider program, which means, as far as I know, I have to change my OS to the insider addition, which is a problem on a computer I am using every day. There is no executable in the downloaded get hub. When I try to use Windows Store, it says installed on this pc, but it gives no info on how to use it. I have tried rebooting my pc, and it the winget command still doesn't work in PowerShell or from the command prompt. Why can't I just download the app, and put the executable in the path statement and it works???

This is installing a different addition of my OS???

Follow these steps to download Insider Preview: Verify which edition of Windows 10 you need to download. See the “Select Edition” section below for details If you’re not sure which ring your device is opted into, verify in the Settings Page: Settings > Update & Security > Windows Insider Program Read the system requirements. Click one of the Download links on this page to download an ISO file that you can use to install the preview. Review the instructions below for doing an in-place upgrade (keeps your files and applications) or a clean install (erases/removes all data from your device).

That is to much!!!!

i255d avatar May 21 '20 23:05 i255d