From d18265619e4ce66e89fcb853713fc5f66a270f20 Mon Sep 17 00:00:00 2001 From: yao-msft <50888816+yao-msft@users.noreply.github.com> Date: Mon, 19 Sep 2022 20:49:14 -0700 Subject: [PATCH 1/4] Create #929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md --- ...behavior changes to winget install and winget upgrade flow.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md diff --git a/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md b/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md @@ -0,0 +1 @@ + From a0f02fadc8203b01be25c58a3f7643b3fc696037 Mon Sep 17 00:00:00 2001 From: yao-msft <50888816+yao-msft@users.noreply.github.com> Date: Mon, 19 Sep 2022 21:12:58 -0700 Subject: [PATCH 2/4] Update #929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md --- ... winget install and winget upgrade flow.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md b/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md index 8b13789179..8d96d07452 100644 --- a/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md +++ b/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md @@ -1 +1,26 @@ +--- +author: Yao Sun @yao-msft +created on: 2022-09-19 +last updated: 2022-09-19 +issue id: 929, 2334 +--- +# Improvements and behavior changes to winget install and winget upgrade flow + +For [#929](https://github.com/microsoft/winget-cli/issues/929), [#2334](https://github.com/microsoft/winget-cli/issues/2334) + +## Abstract + +This is a mini spec for describing upcoming beahvior changes and improvements to `winget install` and `winget upgrade` workflows. + +## Solution Design + +### Winget Install flow will look for installed packages and act accordingly + +**Existing Behavior**: `winget install` is a light-weight command that just installs the found package with latest version without any installed package detection and applicable version selection. + +**New Behavior**: By default, `winget install` will check for installed package after a package is found in a source. If an installed package is found, `winget install` will inform user in bold text and try to do a `winget upgrade` workflow instead. User will get `No applicable upgrade` if upgradable version not available. If an installed package is not found, `winget install` will try to search through all available package versions and find the latest that's applicable, in hope that installation success will be higher with less `No applicable installer`. + +**Note**: To better accommodate various user needs, the existing behavior will be preserved and can be invoked with `--force` flag. + +### Winget Upgrade flow will From 70a3b47e4d71337988f40121db855173333b8d24 Mon Sep 17 00:00:00 2001 From: yao-msft <50888816+yao-msft@users.noreply.github.com> Date: Mon, 19 Sep 2022 21:38:36 -0700 Subject: [PATCH 3/4] Update #929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md --- ... winget install and winget upgrade flow.md | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md b/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md index 8d96d07452..8ae9c887cb 100644 --- a/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md +++ b/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md @@ -21,6 +21,22 @@ This is a mini spec for describing upcoming beahvior changes and improvements to **New Behavior**: By default, `winget install` will check for installed package after a package is found in a source. If an installed package is found, `winget install` will inform user in bold text and try to do a `winget upgrade` workflow instead. User will get `No applicable upgrade` if upgradable version not available. If an installed package is not found, `winget install` will try to search through all available package versions and find the latest that's applicable, in hope that installation success will be higher with less `No applicable installer`. -**Note**: To better accommodate various user needs, the existing behavior will be preserved and can be invoked with `--force` flag. +**Note**: To better accommodate various user needs, the existing behavior will be preserved and can be invoked with `--force` argument. -### Winget Upgrade flow will +### Winget Upgrade flow will try to select installer that better matches installed package + +**Existing Behavior**: `winget upgrade` does not try to select installer by installed package's architecture, locale. + +**New Behavior**: + +- First, winget will try to record selected installer's architecture and locale for installation through winget +- winget will record architecture or locale from command as user intent. i.e. `winget install foo --architecture x86 --locale en-US` +- During upgrade flow installer selection, installer architecture or locale from previous installation will be treated as preference. Installer architecture or locale from user intent will be treated as requirement(i.e. the upgrade will fail if architecture or locale requirement cannot be met). + +**Note**: This improvement only works for installations through winget. Due to current limitations of winget tracking implementation, winget will only honor metadata from last installation for the same package. + +### `--force` argument separation from Override Hash Mismatch + +**Existing Behavior**: Currently, the `--force` argument is overloaded with overriding installer hash mismatch, overriding conflicting portable package, and potentially overriding the new `winget install` behavior. + +**New Behavior**: Since hash mismatch overriding is security related, it warrants a dedicated argument. `--ignore-security-hash`(name suggested in [#715](https://github.com/microsoft/winget-cli/issues/715)) will be introduced to represent installer hash mismatch overriding. `--force` argument will be kept for generic workflow behavior overriding. From adebdf9eb63a2092a7cf54a753533a2b2c33b8e6 Mon Sep 17 00:00:00 2001 From: yao-msft <50888816+yao-msft@users.noreply.github.com> Date: Tue, 11 Oct 2022 13:58:53 -0700 Subject: [PATCH 4/4] feedback --- ... changes to winget install and winget upgrade flow.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md b/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md index 8ae9c887cb..6e6cf2e4c6 100644 --- a/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md +++ b/doc/specs/#929 #2334 - Improvements and behavior changes to winget install and winget upgrade flow.md @@ -29,11 +29,12 @@ This is a mini spec for describing upcoming beahvior changes and improvements to **New Behavior**: -- First, winget will try to record selected installer's architecture and locale for installation through winget -- winget will record architecture or locale from command as user intent. i.e. `winget install foo --architecture x86 --locale en-US` -- During upgrade flow installer selection, installer architecture or locale from previous installation will be treated as preference. Installer architecture or locale from user intent will be treated as requirement(i.e. the upgrade will fail if architecture or locale requirement cannot be met). +- `architecture` and `locale` arguments will be added to `winget upgrade` command +- winget will try to record selected installer's architecture and locale for installation through winget +- winget will record architecture or locale from command line arguments as user intent. i.e. `winget install foo --architecture x86 --locale en-US` +- During upgrade flow installer selection, installer architecture or locale from previous installation will be treated as preference. Installer architecture or locale from user intent will be treated as requirement (i.e. the upgrade will fail if architecture or locale requirement cannot be met). -**Note**: This improvement only works for installations through winget. Due to current limitations of winget tracking implementation, winget will only honor metadata from last installation for the same package. +**Note**: This improvement only works for installations through winget. Due to current limitations of winget tracking implementation, side by side installations may not work perfectly, as winget will only honor metadata from last installation for the same package. User would need to provide `--architecture` or `--locale` to override the last installation metadata when side by side scenarios fail to work as expected. ### `--force` argument separation from Override Hash Mismatch