On Mon Sep 25 07:27:07 2023 +0000, Rémi Bernon wrote:
Fwiw this is not always the location of the executable, especially if it is located in a subfolder of the package, but the package root folder path instead. Anyway, this should be good enough for now.
Yeah, you're right. Minecraft calls `IApplicationData::get_LocalFolder()`, which is supposed to return the packages directory when `IStorageItem::get_Path()` is called, i.e. `AppData\Local\Packages\Microsoft.MinecraftUWP\LocalState`.
The IApplicationData::get_ methods correspond to folders within the relative package folder.
There doesn't seem to be a simple way of retrieving these directories. Each package has a number as a suffix. What I'm doing right now is loading the appxmanifest.xml file, using the identity name, and traversing the packages directory to find the right package. This doesn't account for duplicate names, which is unlikely to happen, but a concern nonetheless.
Still, this seems best done using package APIs. Also, since Wine does not yet support installing packages, retrieving the directory this way won't work. Or rather, it doesn't create the package folder that IApplicationData::get_ points to, I don't know if simply adding in package folders would be enough for some applications to work.