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

Add architecture override option to Update command #206

Merged
merged 10 commits into from
Dec 1, 2021
Merged

Conversation

ryfu-msft
Copy link
Contributor

@ryfu-msft ryfu-msft commented Nov 24, 2021

Resolves #198

This PR addresses issues that some users have been having with the update command detecting the wrong architecture from the installers they provide when trying to use the update command. This discrepancy is often seen in nullsoft installers, which are detected to be x86 based off their installer executables, even if they install a x64 application.

To resolve this, we added the ability for users to append the overriding architecture to the end of the installerURL they are updating with. The architecture must be separated by the '|' character with no spaces.

Example (overriding x64 installer with x86):
wingetcreate update -u https://foobar_x64_installer.exe|x86

Changes:

  • Adds an example to the UpdateCommand on how to use the architecture override.
  • Add functionality for parsing installerUrls for architecture overrides by splitting based on the '|' character.
  • Matching new installers to existing installers now first checks if a match can be found by comparing the installerType and the new overriding architecture. If no match can be found, then the architecture detected from the url string or the binary are used instead. If both of these comparisons fail, a matching error is shown to the user.
  • Refactor matching logic into separate method called FindInstallerMatch().

Testing:
Added 5 unit tests to verify the functionality of this new features:

  • Verifies that invalid architecture specified for override shows error message
  • Verifies that multiple architectures specified for override shows error message
  • Verifies update command succeeds with an overriding architecture specified that matches an existing installer
  • Verifies the update command succeeds if the overriding architecture fails to match, but the url and binary detection does find a match to an existing installer.
  • Verifies that failing a match when updating with an architecture override shows a warning message to the user.
Microsoft Reviewers: Open in CodeFlow

@ryfu-msft ryfu-msft requested a review from palenshus November 24, 2021 18:48
@ryfu-msft ryfu-msft requested a review from a team as a code owner November 24, 2021 18:48
@ghost ghost added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Nov 24, 2021
Copy link
Contributor

@palenshus palenshus left a comment

Choose a reason for hiding this comment

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

🕐

@ghost ghost removed the Needs-Author-Feedback label Nov 29, 2021
@ryfu-msft ryfu-msft requested a review from palenshus November 30, 2021 23:13
@palenshus palenshus dismissed their stale review December 1, 2021 18:56

revoking review

Copy link
Contributor

@palenshus palenshus left a comment

Choose a reason for hiding this comment

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

🕐

@ghost ghost added the Needs-Author-Feedback label Dec 1, 2021
@ghost ghost removed the Needs-Author-Feedback label Dec 1, 2021
@ryfu-msft ryfu-msft requested a review from palenshus December 1, 2021 19:20
Copy link
Contributor

@palenshus palenshus left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wingetcreate looks for installer architecture instead of application architecture
2 participants