Sitelet https://web.archive.org/web/20220312050808/https://github.com/microsoft/winget-cli/pull/1796
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

Allow upgrades in packages that register a different installer type #1796

Merged
merged 3 commits into from Jan 20, 2022

Conversation

lechacon
Copy link
Member

@lechacon lechacon commented Dec 14, 2021 •

  • Modified the applicability check in InstalledTypeComparator to also consider the installer types listed under AppsAndFeaturesEntries
  • Extended string returned from ExplainInapplicable to also mention the installed type and other types accepted by the manifest.

Closes #1242. Validated that upgrading PowerToys (mentioned in that issue) worked correctly using a local manifest edited to include the AppsAndFeaturesEntries and installed type msi.

Microsoft Reviewers: Open in CodeFlow

@jedieaston
Copy link
Contributor

@jedieaston jedieaston commented Dec 14, 2021

Another test case for this is iTunes, it packages a msi inside a exe.

If you add this ARP entry:

  AppsAndFeaturesEntries:
    - DisplayName: iTunes
      Publisher: Apple Inc.
      DisplayVersion: 12.12.1.1
      InstallerType: msi

to the manifest, it works great!

PS C:\Users\easton\Downloads> winget upgrade -m .\12.12.1.1\
No applicable installer found; see logs for more details.
PS C:\Users\easton\Downloads> wingetdev upgrade -m .\12.12.1.1\
Found iTunes [Apple.iTunes] Version 12.12.1.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.
Successfully verified installer hash
Starting package install...
Successfully installed
PS C:\Users\easton\Downloads>

@denelon
Copy link
Contributor

@denelon denelon commented Dec 14, 2021

This addresses at least one version of Adobe Acrobat, and PowerToys (@crutkas).

@@ -210,6 +210,21 @@ namespace
PackageMatchFilter(PackageMatchField::Id, MatchType::Exact, "AppInstallerCliTest.TestExeInstaller")));
}

if (input == "TestExeInstallerWithDifferentInstalledType")
Copy link
Member Author

@lechacon lechacon Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of how long this function is getting. Many tests seem to use only a single case of all this and most are used in a single test, so we probably could add a constructor that took the manifests and always returned that. It would also put the search results closer to where it's used. Putting this here to see what others think of doing that..

Copy link
Member

@JohnMcPMS JohnMcPMS Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, making it easy to create specific new cases rather than extending this would be good.

@@ -210,6 +210,21 @@ namespace
PackageMatchFilter(PackageMatchField::Id, MatchType::Exact, "AppInstallerCliTest.TestExeInstaller")));
}

if (input == "TestExeInstallerWithDifferentInstalledType")
Copy link
Member

@JohnMcPMS JohnMcPMS Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, making it easy to create specific new cases rather than extending this would be good.

@lechacon lechacon marked this pull request as ready for review Jan 20, 2022
@lechacon lechacon merged commit 9dcbf99 into microsoft:master Jan 20, 2022
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants