-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Print message when install technology is different in upgrade scenarios #1649
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
Changes from all commits
88637a4
b276033
47d24a6
4dd9c88
90aa101
94f24c3
bfa8ae8
8d018ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,6 +221,7 @@ IIS | |
| ILogger | ||
| IManifest | ||
| impl | ||
| inapplicabilities | ||
| Inet | ||
| inheritdoc | ||
| inno | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,21 @@ | |
|
|
||
| namespace AppInstaller::CLI::Workflow | ||
| { | ||
| // Flags to indicate why an installer was not applicable | ||
| enum class InapplicabilityFlags : int | ||
| { | ||
| None = 0x0, | ||
| OSVersion = 0x1, | ||
| InstalledScope = 0x2, | ||
| InstalledType = 0x4, | ||
| InstalledLocale = 0x8, | ||
| Locale = 0x10, | ||
| Scope = 0x20, | ||
| MachineArchitecture = 0x40, | ||
| }; | ||
|
|
||
| DEFINE_ENUM_FLAG_OPERATORS(InapplicabilityFlags); | ||
|
|
||
| namespace details | ||
| { | ||
| // An interface for defining new filters based on user inputs. | ||
|
|
@@ -25,7 +40,7 @@ namespace AppInstaller::CLI::Workflow | |
| std::string_view Name() const { return m_name; } | ||
|
|
||
| // Determines if the installer is applicable based on this field alone. | ||
| virtual bool IsApplicable(const Manifest::ManifestInstaller& installer) = 0; | ||
| virtual InapplicabilityFlags IsApplicable(const Manifest::ManifestInstaller& installer) = 0; | ||
|
|
||
| // Explains why the filter regarded this installer as inapplicable. | ||
| // Will only be called when IsApplicable returns false. | ||
|
|
@@ -47,16 +62,22 @@ namespace AppInstaller::CLI::Workflow | |
| }; | ||
| } | ||
|
|
||
| struct InstallerAndInapplicabilities | ||
| { | ||
| std::optional<Manifest::ManifestInstaller> installer; | ||
| std::vector<InapplicabilityFlags> inapplicabilitiesInstaller; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It probably doesn't matter right now, but it seems odd to not know which installer each goes with. |
||
| }; | ||
|
|
||
| // Class in charge of comparing manifest entries | ||
| struct ManifestComparator | ||
| { | ||
| ManifestComparator(const Execution::Context& context, const Repository::IPackageVersion::Metadata& installationMetadata); | ||
|
|
||
| // Gets the best installer from the manifest, if at least one is applicable. | ||
| std::optional<Manifest::ManifestInstaller> GetPreferredInstaller(const Manifest::Manifest& manifest); | ||
| InstallerAndInapplicabilities GetPreferredInstaller(const Manifest::Manifest& manifest); | ||
|
|
||
| // Determines if an installer is applicable. | ||
| bool IsApplicable(const Manifest::ManifestInstaller& installer); | ||
| InapplicabilityFlags IsApplicable(const Manifest::ManifestInstaller& installer); | ||
|
|
||
| // Determines if the first installer is a better choice. | ||
| bool IsFirstBetter( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1237,6 +1237,12 @@ Please specify one of them using the `--source` option to proceed.</value> | |
| <data name="CountOutOfBoundsError" xml:space="preserve"> | ||
| <value>The requested number of results must be between 1 and 1000.</value> | ||
| </data> | ||
| <data name="UpgradeDifferentInstallTechnologyInNewerVersions" xml:space="preserve"> | ||
| <value>A newer version was found, but the install technology is different from the current version installed. Please uninstall the package and install the newer version.</value> | ||
| </data> | ||
| <data name="UpgradeDifferentInstallTechnology" xml:space="preserve"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not clear to me when this would be used over the other string.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UpgradeDifferentInstallTechnologyInNewerVersions is for UpgradeDifferentInstallTechnology is for specific version it is different codepaths and i thought it was weird showing "At least a newer package was found..." when a version is specified. |
||
| <value>The install technology of the newer version specified is different from the current version installed. Please uninstall the package and install the newer version.</value> | ||
| </data> | ||
| <data name="WindowsPackageManagerPreview" xml:space="preserve"> | ||
| <value>Windows Package Manager (Preview)</value> | ||
| <comment>The product name plus an indicator that this is a pre-release version.</comment> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.