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

Allow multiple apps in a single command

Open florelis opened this issue 2 years ago • 1 comments

This change adds support specifying multiple packages in a single command for install, update and uninstall. For example, winget install app1 app2.

  • Added a new argument type called MultiQuery, which is the same as Query but has a limit for values larger than 1. Thankfully the arg parsing was already implemented :)
  • Used this new argument in the install, upgrade and uninstall commands. The first step in these commands is now to check if MultiQuery has more than 1 value, and if it doesn't it is replaced by a single Query argument. This way, the change is not visible to existing code.
  • If there is more than one value for the multi-query argument, we proceed to search for each query in a separate sub-query, and then we install them all one at a time. The code for this is refactored from the import flow which does pretty much the same thing.
  • Added unit tests for these 3 commands.

I did not extend argument validation in this PR. Ideally we would block arguments that don't make sense for more than one package when doing multi-queries, like --override. I will send a separate PR to refactor the argument validation to make this easier without repeating it in the three commands.

Closes #219

Microsoft Reviewers: Open in CodeFlow

florelis avatar Jan 17 '23 20:01 florelis

Only thing pending now should be arg validation, which once I merge #2862 will be only tagging the arg with the right categories. Although it will have to be a special case since it depends on whether it has one or multiple values.

florelis avatar Jan 27 '23 22:01 florelis

When and how ill we get the new release ?

emoxam avatar Feb 07 '23 08:02 emoxam

If you are looking for stable releases, this will be included in v1.5 client release tracked by milestone here https://github.com/microsoft/winget-cli/milestone/39 It is planned to be released around May

If you are looking to test it early, you can join the Windows Insider program to get preview builds, or watch our release page here https://github.com/microsoft/winget-cli/releases

yao-msft avatar Feb 07 '23 19:02 yao-msft

Where can i get Windows Insider program to get preview builds ?

emoxam avatar Feb 08 '23 06:02 emoxam

https://insider.windows.com/ 😊

denelon avatar Feb 08 '23 16:02 denelon

I mean - on github there are words Development Releases - "Join the Windows Package Manager Insider program by signing up." and "If you decide to install the latest release from GitHub, and you have successfully joined the insider program, you will receive updates when the next development release has been published in the Microsoft Store." I've joined, and i've got mail a few days ago, but MS store has nothing to give me, i have winget -v v1.4.10173 and no update so far. What is going on ? Where is a new version? For example this one https://github.com/microsoft/winget-cli/releases/tag/v1.5.101-preview

emoxam avatar Feb 09 '23 14:02 emoxam

I mean - on github there are words Development Releases - "Join the Windows Package Manager Insider program by signing up." and "If you decide to install the latest release from GitHub, and you have successfully joined the insider program, you will receive updates when the next development release has been published in the Microsoft Store." I've joined, and i've got mail a few days ago, but MS store has nothing to give me, i have winget -v v1.4.10173 and no update so far. What is going on ? Where is a new version? For example this one v1.5.101-preview (release)

Preview releases aren't cut after every PR. There is internal validation and testing that has to happen before a release is cut. I would think it would be another week or two before these changes are available in a preview

Trenly avatar Feb 09 '23 14:02 Trenly

What we gave at store is 1.19.10173 - how does this relate to github versions ? There is no 1.19 at github!

emoxam avatar Feb 09 '23 14:02 emoxam

What we gave at store is 1.19.10173 - how does this relate to github versions ? There is no 1.19 at github!

AppInstaller contains winget, but it is not winget itself; The version marked Latest in Github Releases is what is bundled with the AppInstaller from MSStore (unless you're on an insider build)

Trenly avatar Feb 09 '23 14:02 Trenly

What we gave at store is 1.19.10173 - how does this relate to github versions ? There is no 1.19 at github!

AppInstaller contains winget, but it is not winget itself; The version marked Latest in Github Releases is what is bundled with the AppInstaller from MSStore (unless you're on an insider build)

Trenly avatar Feb 09 '23 14:02 Trenly

So no hope to wait new appinstaller at store ?

emoxam avatar Feb 09 '23 14:02 emoxam

What we gave at store is 1.19.10173 - how does this relate to github versions ? There is no 1.19 at github!

I know it doesn't seem to make sense, but there is a difference of 15 between the minor version of the App Installer package and the minor version of the winget cli. App Installer v1.19.10173 includes winget v1.4.10173.

This change will come in the preview for winget v1.5, so it will be a App Installer v1.20.

I think it takes some time to start getting preview builds after joining the insider program. Once you see you're on a v1.5 build you'll know you are receiving preview builds, so you should get the one with this change once it's out.

florelis avatar Feb 09 '23 19:02 florelis

So i should look at store to see if there an update to App Installer v1.20 ? P.S. Maybe it could be useful to write somewhere at package description what version of wiget it includes ?

emoxam avatar Feb 10 '23 06:02 emoxam