Sep 28 2022 12:55 PM
The PSF uses the AppModel API (appmodel.h and kernel.appcore.dll) to obtain information about the currently executing package it is in.
In a scenario with SPC, there are multiple packages, and these calls can only learn about one of the packages (making certain types of fixes impossible).
Is there an API to find the the other packages running in the container such that AppModel calls can be made against those packages?
Oct 04 2022 12:22 PM
@TIMOTHY_MANGAN There is an API for that yes SharedPackageContainerManager Class (Windows.Management.Deployment) - Windows UWP applications | Mic...
One of our engineers has shared a snipped of code that might help get you started
TEST_METHOD(GetContainer)
{
auto id = CreatSimpleContainer(L"container", {
L"family1_8wekyb3d8bbwe",
L"family2_8wekyb3d8bbwe"
}).Id();
auto manager = winrt::SharedPackageContainerManager::GetDefault();
// Get container
auto container = manager.GetContainer(id);
log(L"Container name: ", container.Name().c_str());
log(L"Container id: ", container.Id().c_str());
VERIFY_ARE_EQUAL(container.Name(), L"container");
VERIFY_ARE_EQUAL(container.Id().size(), 36u);
auto members = container.GetMembers();
VERIFY_ARE_EQUAL(members.Size(), 2u);
VERIFY_ARE_EQUAL(members.GetAt(0).PackageFamilyName(), L"family1_8wekyb3d8bbwe");
VERIFY_ARE_EQUAL(members.GetAt(1).PackageFamilyName(), L"family2_8wekyb3d8bbwe");
}
Oct 08 2022 01:47 PM
@Aditi_Narvekar Thank you. I was hoping to access the API from C++ (to be added as part of the Package Support Framework, which currently doesn't support Shared Package Groups when software in multiple packages needs the PSF in an MSIX package). Is there any chance of a non-UWP API out there?
Regards,
Tim
Oct 08 2022 01:51 PM
Oct 10 2022 12:11 PM
@TIMOTHY_MANGAN So a couple of things:
Oct 10 2022 12:36 PM