-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Expose deeper installation detection through Com #2420
Conversation
#define WINGET_INSTALLED_STATUS_ARP_ENTRY_FOUND S_OK | ||
#define WINGET_INSTALLED_STATUS_ARP_ENTRY_NOT_FOUND ((HRESULT)0x8A150201) | ||
#define WINGET_INSTALLED_STATUS_INSTALL_LOCATION_FOUND S_OK | ||
#define WINGET_INSTALLED_STATUS_INSTALL_LOCATION_NOT_APPLICABLE ((HRESULT)0x8A150202) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these actually be success codes when it is a case of not full success? (not have the error bit set) #Resolved
@@ -347,6 +347,9 @@ namespace AppInstaller::Repository::Microsoft | |||
// Pick up Language to enable proper selection of language for upgrade. | |||
AddMetadataIfPresent(arpKey, Language, index, manifestId, PackageVersionMetadata::InstalledLocale); | |||
|
|||
// Set installed architecture info. | |||
index.SetMetadataByManifestId(manifestId, PackageVersionMetadata::InstalledArchitecture, architecture); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot pull this out of portable; we do not know the actual architecture of the installed package based on the ARP registry location. Even for portable it is dubious, and we should record it into an ARP value (due to ARM64). #Resolved
@@ -270,6 +318,9 @@ namespace AppInstaller::Repository | |||
// Gets a value indicating whether an available version is newer than the installed version. | |||
virtual bool IsUpdateAvailable() const = 0; | |||
|
|||
// Checks installed status of the package. | |||
virtual std::vector<InstallerInstalledStatus> CheckInstalledStatus(InstalledStatusType types = InstalledStatusType::AllChecks) const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that this needs to be implemented as a member of IPackage
versus a standalone function that takes in an IPackage
and the other parameters. What is gained from enabling different IPackage
implementations to have different implementations of this function? #Resolved
|
||
/// The package installer scope. | ||
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] | ||
enum PackageInstallerScope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a scope enum. #ByDesign
{ | ||
bool operator()(const std::filesystem::path& a, const std::filesystem::path& b) const | ||
{ | ||
if (std::filesystem::equivalent(a, b)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part seems unnecessary if the goal is producing a < b
. #ByDesign
fileStatus = WINGET_INSTALLED_STATUS_FILE_FOUND_WITHOUT_HASH_CHECK; | ||
if (!expectedHash.empty()) | ||
{ | ||
if (fileHashes.find(filePath) == fileHashes.end()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to have a map for performance, then you should:
auto itr = find();
if (itr != end)
{
itr = emplace().first;
}
AreEqual(expected, itr->second);
To prevent any more map lookups than necessary. #Resolved
@check-spelling-bot ReportUnrecognized words, please review:
To accept these unrecognized words as correct, run the following commands... in a clone of the git@github.com:yao-msft/winget-cli.git repository
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that consumers are going to be happy with the API design before merging.
null
Microsoft Reviewers: Open in CodeFlow