Replies: 2 comments 2 replies
-
It isn't the runFullTrust capability, it is whether or not the AppContainer is active. What determines how the application itself runs is the Application element of the manifest. If the package is targetted at older versions of Windows 10 (< 19041), then it is the EntryPoint attribute that controls things. If the entry point is a runtime class name, then this is a UWP application. If the entry point is windows.fullTrustApplication (case insensitive), then it is a medium IL application that runs outside of an AppContainer. If the entry point is windows.partialTrustApplication (case insensitive), then it is a low IL application that runs inside of an AppContainer. Anyway, things can get rather messy. First, you cannot check a single value to determine things fully. There are some shortcuts, like using Windows.UI.Core.CoreWindow.GetForCurrentThread on the main thread. This is going to fail in a desktop application, so if it succeeds then you know that you are working in a UWP environment. For your particular case, I think checking for the presence of the AppContainer should be enough. |
Beta Was this translation helpful? Give feedback.
-
Not just because of Example code: using Windows.Security.Authorization.AppCapabilityAccess;
namespace Foo;
public static class Bar
{
public static AppCapabilityAccessStatus CheckRFT()
{
var ac = AppCapability.Create("runFullTrust");
return ac.CheckAccess();
}
public static AppCapabilityAccessStatus CheckBFSA()
{
var ac = AppCapability.Create("broadFileSystemAccess");
return ac.CheckAccess();
}
} |
Beta Was this translation helpful? Give feedback.
-
MAUI app templates defines that WinUI apps runs with the
runFullTrust
capability. However, presumably, users can change it if they want.I would like to find out, if the
runFullTrust
capability is defined or not on runtime. It would help me skip this costly part in the PR of mine (dotnet/maui#23047) instead of just deleting that code entirely.Does anybody know how to find it out?
Beta Was this translation helpful? Give feedback.
All reactions