且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何创建一个完全信任的 UWP 应用程序?

更新时间:2023-11-20 15:03:16

我不知道这样的选项.是的,DAC 可以包含 Full-Trusted Win32 应用程序,但它仅适用于 Win32.UWP - WinRT - 应用受应用容器限制.

I don't know such of options. Yes, DAC can contain the Full-Trusted Win32 apps, but it is only applicable for Win32. UWP - WinRT - apps are restricted with App Container.

另一种选择是 - 使用特殊功能".

The alternative option is - using the "Special capabilities".

特殊和受限功能

有许多声明可以克服沙盒的限制.其中一些不适用于商店提交 - 仅适用于内部部署应用程序.其他人需要注册 Microsoft 才能在商店中部署.如果您的要求符合,您可以使用它.

There are many of declarations that overcome the restrictions of sandbox. Some of these are not applicable for store submission - only for in-house deployment apps. Others need registration for Microsoft to deploy with store. If your requirement is matched, you can use it.

(添加 - 2017 年 6 月)从 Win10 AU,我们可以使用FullTrustLauncher"API 从 UWP App 启动 Win32 组件.但是,是的,这并不意味着我们可以以完全信任的权限运行UWP"-WinRT 进程.它仅适用于 Win32 进程.而且,Win32 应用程序可执行文件应包含在应用程序的 AppX 包中,清单应将可执行文件声明为windows.fullTrustProcess".

(Added - June 2017) From Win10 AU, we can use the "FullTrustLauncher" API to launch the Win32 component from UWP App. But, yes, it does not mean we can run the "UWP" - WinRT process with full-trust rights. It's applicable only for Win32 process. And, the Win32 app executable should be contained in the application's AppX package and the manifest should declare the executable as "windows.fullTrustProcess".

  <Extensions> 
    <desktop:Extension Category="windows.fullTrustProcess" Executable="fulltrustprocess.exe"> 
      <desktop:FullTrustProcess> 
        <desktop:ParameterGroup GroupId="SyncGroup" Parameters="/Sync"/> 
        <desktop:ParameterGroup GroupId="OtherGroup" Parameters="/Other"/> 
      </desktop:FullTrustProcess> 
    </desktop:Extension> 
  </Extensions> 

全信任流程启动器类