3

我的包以侧载方式安装,并且不断遇到特定于应用程序的权限错误。

是的,许多人建议在注册表编辑器和组件服务中手动更改权限和所有者。

我的应用程序实际上在组件服务(DCOMCNFG、DCOMCNFG -32)下的 DCOM 配置中丢失。

我在 proc 监视器中既没有看到错误,也没有看到警告。在这种情况下,我如何授予权限?为什么 MSIX 安装程序无法完成此特定任务?

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID 

{2593F8B9-4EAF-457C-B68A-50F6B8EA6B54}

 and APPID 

{15C20B67-12E7-4BB6-92BB-7AFF07997402}

 to the user PRECISION\Tommy SID (S-1-5-21-3771326467-2290839719-591499861-1001) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.

我尝试使用此 PS 模块授予 DCOM 权限,但无济于事:

使用 PowerShell 授予、撤销、获取 DCOM 权限

Import-Module .\DCOMPermissions

Grant-DCOMPermission -ApplicationID "{9CA88EE3-ACB7-47C8-AFC4-AB702511C276}" -Account "SYSTEM" -Type Launch -Permissions LocalLaunch,LocalActivation -OverrideConfigurationPermissions

继续见证事件查看器中的错误,这会阻止我的应用程序启动:

显示错误 ID 10010 的事件查看器

我在这个 AppxManifest.xml 的帮助下构建了 MSIX 包

    <?xml version="1.0" encoding="utf-8"?>
<Package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10">
  <Identity Name="WeatherHistory" Version="0.7.0.2" Publisher="CN=Contoso Software, O=Contoso Corporation, C=US" />
  <Properties>
    <DisplayName>Weather History</DisplayName>
    <PublisherDisplayName>Cosmic ray</PublisherDisplayName>
    <Logo>Images/satelite.png</Logo>
  </Properties>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.18363.0" />
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.18363.0" />
  </Dependencies>
  <Resources>
    <Resource Language="en-us" />
  </Resources>
  <Applications>
    <Application Id="Weather.History" Executable="Weather.History.Splash.exe" EntryPoint="Weather.History.Splash">
      <VisualElements DisplayName="Weather History" Description="Frontend" Square150x150Logo="Images/satelite.png" Square44x44Logo="Images/satelite.png" BackgroundColor="yellow" xmlns="http://schemas.microsoft.com/appx/manifest/uap/windows10" />
      <Extensions>
        <Extension Category="windows.fullTrustProcess" Executable="Weather.History.Stylet.exe" xmlns="http://schemas.microsoft.com/appx/manifest/desktop/windows10" />
      </Extensions>
    </Application>
  </Applications>
  <Capabilities>
    <Capability Name="runFullTrust" xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" />
    <Capability Name="internetClient" />
  </Capabilities>
</Package>

...并将代码添加到我的包入口点 exe 中

private async void LaunchProduct()
    {
        try
        {
            if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
            {
                await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
            }
            else
            {
                Exit($"Your Windows version is not supported.");
            }
        }
        catch (Exception e)
        {
            Exit("Failed to launch Weather History", e);
        }
    }

有一个 WPF 启动尝试启动另一个 WPF 都基于常见的 TFM .NET 4.7。第一个 WPF 应该启动第二个作为利用此 MSIX 包扩展基础结构的受信任进程。专业助推器机制。如果我的看法是正确的。

这不是一个包,那么我的包实际针对的是什么架构?我总是编译任何 CPU。

我最终通过调用相应的工具来构建包:

makeappx.exe pack /v /o /f mapping.map /m Appxmanifest.xml /p ./Weather.History.msix
4

1 回答 1

2

入口点确实必须被指定为受信任的。

EntryPoint="Windows.FullTrustApplication"
于 2020-07-24T14:10:20.847 回答