Why PackageManager.FindPackagesForUser method not fetching all the store app details
checkingrandom
206
Reputation points
I'm attempting to retrieve details of installed Store apps on the machine using the PackageManager class in C++/WinRT. However, I'm encountering an issue where I only receive a partial result. For example, if there are 20 Store apps installed, only 10 are listed, and the rest are not appearing. Below is the basic code I've used.
#include <windows.h>
#include<winrt/Windows.Management.Deployment.h>
#include<winrt/Windows.ApplicationModel.h>
#include <iostream>
using namespace winrt;
using namespace winrt::Windows::ApplicationModel;
using namespace winrt::Windows::Foundation;
//using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Management::Deployment;
int main()
{
init_apartment();
PackageManager packageManager;
auto packages = packageManager.FindPackagesForUser(L""); // specified the SID
for (auto const& package : packages)
{
if (!package.IsFramework())
{
std::wcout << L"Package Name: " << package.Id().Name().c_str() << std::endl;
std::wcout << L"Display Name: " << package.DisplayName().c_str() << std::endl;
std::wcout << L"Publisher: " << package.PublisherDisplayName().c_str() << std::endl;
std::wcout << L"-------------------------------------------------------------" << std::endl;
std::wcout << std::endl;
}
}
return 0;
}
Sign in to answer