始终运行以Windows桌面桥作为管理员转换的应用程序吗?

Jam*_*mes 1 c# windows-10 uwp desktop-app-converter desktop-bridge

我有一个使用台式机转换为UWP Bridge应用程序,特别是台式机应用程序转换器,它可以自动完成所有操作。它可以转换并很好地安装,但是当我尝试运行它时,我收到一个错误,指出可执行文件需要提升。我可以通过解决此问题,Right Click -> Run as Administrator但我希望使用默认设置将应用重新打包,因此不需要执行此额外步骤。值得注意的是,我可以在没有管理员特权的情况下以正常安装方式运行该应用程序,只有转换后的应用程序才需要此权限。

有没有办法在AppxManifest.xml与转换应用程序相关的文件中包括所需的海拔要求?我希望会有像这样简单的事情

<Application Id="MyApp" Permissions="Administrator">
Run Code Online (Sandbox Code Playgroud)

上有明显的文档在这里,但我无法找到相关的权限或标高什么。

这是AppxManifest.xml转换器生成的。

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10">
  <Identity Name="MyApp" ProcessorArchitecture="x86" Publisher="CN=Me" Version="5.70.0.0" />
  <Properties>
    <DisplayName>MyApp</DisplayName>
    <PublisherDisplayName>Me</PublisherDisplayName>
    <Logo>Assets\AppStoreLogo.png</Logo>
  </Properties>
  <Resources>
    <Resource Language="en-us" />
    <Resource uap:Scale="100" />
    <Resource uap:Scale="125" />
    <Resource uap:Scale="150" />
    <Resource uap:Scale="200" />
    <Resource uap:Scale="400" />
  </Resources>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
  </Dependencies>
  <Capabilities>
    <rescap:Capability Name="runFullTrust" />
  </Capabilities>
  <Applications>
    <Application Id="MyApp" Executable="Integrator.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements DisplayName="MyApp" Description="MyApp" BackgroundColor="transparent" Square150x150Logo="Assets\AppMedTile.png" Square44x44Logo="Assets\AppList.png">
        <uap:DefaultTile Wide310x150Logo="Assets\AppWideTile.png" Square310x310Logo="Assets\AppLargeTile.png" Square71x71Logo="Assets\AppSmallTile.png">
          <uap:ShowNameOnTiles>
            <uap:ShowOn Tile="square150x150Logo" />
            <uap:ShowOn Tile="wide310x150Logo" />
            <uap:ShowOn Tile="square310x310Logo" />
          </uap:ShowNameOnTiles>
        </uap:DefaultTile>
      </uap:VisualElements>
      <Extensions>
        <uap3:Extension Category="windows.fileTypeAssociation">
          <uap3:FileTypeAssociation Name="gfe">
            <uap:SupportedFileTypes>
              <uap:FileType>.gfe</uap:FileType>
            </uap:SupportedFileTypes>
          </uap3:FileTypeAssociation>
        </uap3:Extension>
        <uap3:Extension Category="windows.fileTypeAssociation">
          <uap3:FileTypeAssociation Name="gfs">
            <uap:SupportedFileTypes>
              <uap:FileType>.gfs</uap:FileType>
            </uap:SupportedFileTypes>
          </uap3:FileTypeAssociation>
        </uap3:Extension>
        <uap3:Extension Category="windows.appExecutionAlias" Executable="Integrator.exe" EntryPoint="Windows.FullTrustApplication">
          <uap3:AppExecutionAlias>
            <desktop:ExecutionAlias Alias="Integrator5.exe" />
          </uap3:AppExecutionAlias>
        </uap3:Extension>
      </Extensions>
    </Application>
  </Applications>
</Package>
Run Code Online (Sandbox Code Playgroud)

Ste*_*SFT 5

更新:从Windows 10更新1809(内部版本17763)开始,您现在可以声明“ allowElevation”功能以启用自动/自提升功能。这是有关此功能的教程:https : //stefanwick.com/2018/10/01/app-elevation-samples-part-1/

先前的答案(适用于1809之前的Windows 10版本):
目前不支持应用程序的自动提升。用户可以选择以管理员身份运行您的应用。

在Desktop Bridge的准备指南中对此政策进行了声明:https//docs.microsoft.com/zh-cn/windows/uwp/porting/desktop-to-uwp-prepare (项目2)

谢谢,Stefan Wick-Windows开发人员平台