microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.31k stars 676 forks source link

Documentation Request: WinUI 3 Full Trust & Partial Trust - how to configure + Pros/Cons of each #10015

Open mryderie opened 1 week ago

mryderie commented 1 week ago

There's a lack of official documentation around the use of Full Trust vs. Partial Trust in WinUI 3.

The WinUI 3 project template comes with Full Trust configured as default, but without docs, it's not clear why that is.

Can we get some offical documentation describing how to configure both, and the pros/cons of each please?

Example:

Partial Trust Cons:

Full Trust Cons:

Related discussions/issues: https://github.com/microsoft/WindowsAppSDK/discussions/1900 https://github.com/microsoft/WindowsAppSDK/discussions/3435 https://github.com/microsoft/WindowsAppSDK/discussions/3447 https://github.com/microsoft/WindowsAppSDK/discussions/4383 https://github.com/microsoft/WindowsAppSDK/issues/3536 https://github.com/microsoft/microsoft-ui-xaml/issues/9557

DarranRowe commented 6 days ago

The two primary locations for this documentation are the Application manifest reference for the Appx manifest, and the MSIX documentation, specifically, Understanding how packaged desktop apps run on Windows. In particular, if the trust level of the package is full trust/mediumIL, then the environment is almost identical to a regular desktop application. The biggest things that you are likely to run into is that AppData writes and the HKCU registry writes could be redirected, and the working directory for the application may default to System32. If the trust level of the package is partial trust/appContainer, then the application will be running inside a light weight app container. Starting Windows 11 24H2, you can also opt into BNO redirection and lifecycle handling, making the environment more like a UWP application. How this configured is officially documented in MSIX AppContainer apps, and the restrictions in the environment is documented in AppContainer for legacy apps.

Also, yes this is general desktop application documentation, but WinUI 3 applications are regular WinUI 3 applications. This means that the documentation applies.

For the file pickers, could you upvote this reply if you haven't already? Also, get as many people as you can to upvote it too. The file pickers not working need to be fixed, the team that are responsible for them are not fixing them, so there needs to be a way to show demand for the pickers. This is why I have a request that is actionable by the Windows App SDK team there.