appxmanifest.xml用于自适应扩展资产

时间:2018-08-31 07:56:56

标签: uwp assets desktop-bridge

我正在构建Windows brdige应用程序,并尝试为图块等添加自适应缩放资产。但是,在构建软件包时,makeappx会抱怨文件不存在。

我使用以下appxmanifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<!--suppress XmlUnusedNamespaceDeclaration -->
<Package
   xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
   xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
   xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
   xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
  <!-- use single quotes to avoid double quotes escaping in the publisher value  -->
  <Identity Name="IRMASignatureApp"
    ProcessorArchitecture="x64"
    Publisher='CN=ms'
    Version="1.0.0.0" />
  <Properties>
    <DisplayName>IRMASignatureApp</DisplayName>
    <PublisherDisplayName>Privacy By Design Foundatation</PublisherDisplayName>
    <Description>An IRMA app to create IRMA signatures</Description>
    <Logo>assets\StoreLogo.png</Logo>
  </Properties>
  <Resources>
    <Resource Language="en-US" />
  </Resources>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.14316.0" />
  </Dependencies>
  <Capabilities>
    <rescap:Capability Name="runFullTrust"/>
  </Capabilities>
  <Applications>
    <Application Id="IRMASignatureApp" Executable="app\IRMASignatureApp.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements
       BackgroundColor="#464646"
       DisplayName="IRMASignatureApp"
       Square150x150Logo="assets\Square150x150Logo.png"
       Square44x44Logo="assets\Square44x44Logo.png"
       Description="An IRMA app to create IRMA signatures">

        <uap:DefaultTile Wide310x150Logo="assets\Wide310x150Logo.png" />

      </uap:VisualElements>

    </Application>
  </Applications>
</Package>

但是,在运行makeappx时,出现以下错误:

MakeAppx : error: Manifest validation error: Line 33, Column 8, Reason: The file name "assets\Square150x150Logo.png" declared for element "*[local-name()='Applications']/*[local-name()='Application']/*[local-name()='VisualElements']" doesn't exist in the package.
MakeAppx : error: Manifest validation error: Line 34, Column 8, Reason: The file name "assets\Square44x44Logo.png" declared for element "*[local-name()='Applications']/*[local-name()='Application']/*[local-name()='VisualElements']" doesn't exist in the package.
MakeAppx : error: Manifest validation error: Line 37, Column 26, Reason: The file name "assets\Wide310x150Logo.png" declared for element "*[local-name()='Applications']/*[local-name()='Application']/*[local-name()='VisualElements']/*[local-name()='DefaultTile']" doesn't exist in the package.

但是,资产目录确实包含https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/app-assets中所述的命名方案所需的文件:

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        8/28/2018  11:21 AM           3757 Square150x150Logo.scale-100.png
-a----        8/28/2018  11:21 AM           4630 Square150x150Logo.scale-125.png
-a----        8/28/2018  11:21 AM           5633 Square150x150Logo.scale-150.png
-a----        8/28/2018  11:21 AM           7504 Square150x150Logo.scale-200.png
-a----        8/28/2018  11:21 AM          15784 Square150x150Logo.scale-400.png
-a----        8/28/2018  11:21 AM           7832 Square310x310Logo.scale-100.png
-a----        8/28/2018  11:21 AM           9873 Square310x310Logo.scale-125.png
-a----        8/28/2018  11:21 AM          11802 Square310x310Logo.scale-150.png
-a----        8/28/2018  11:21 AM          16065 Square310x310Logo.scale-200.png
-a----        8/28/2018  11:21 AM          35149 Square310x310Logo.scale-400.png
-a----        8/28/2018  11:21 AM           1874 Square44x44Logo.scale-100.png
-a----        8/28/2018  11:21 AM           2284 Square44x44Logo.scale-125.png
-a----        8/28/2018  11:21 AM           2867 Square44x44Logo.scale-150.png
-a----        8/28/2018  11:21 AM           3880 Square44x44Logo.scale-200.png
-a----        8/28/2018  11:21 AM           7327 Square44x44Logo.scale-400.png
-a----        8/28/2018  11:21 AM            834 Square44x44Logo.targetsize-16.png
-a----        8/28/2018  11:21 AM           1034 Square44x44Logo.targetsize-20.png
-a----        8/28/2018  11:21 AM           1262 Square44x44Logo.targetsize-24.png
-a----        8/28/2018  11:21 AM           9912 Square44x44Logo.targetsize-256.png
-a----        8/28/2018  11:21 AM           1191 Square44x44Logo.targetsize-30.png
-a----        8/28/2018  11:21 AM           1321 Square44x44Logo.targetsize-32.png
-a----        8/28/2018  11:21 AM           1486 Square44x44Logo.targetsize-36.png
-a----        8/28/2018  11:21 AM           1579 Square44x44Logo.targetsize-40.png
-a----        8/28/2018  11:21 AM           2078 Square44x44Logo.targetsize-48.png
-a----        8/28/2018  11:21 AM           2548 Square44x44Logo.targetsize-60.png
-a----        8/28/2018  11:21 AM           2761 Square44x44Logo.targetsize-64.png
-a----        8/28/2018  11:21 AM           3130 Square44x44Logo.targetsize-72.png
-a----        8/28/2018  11:21 AM           3410 Square44x44Logo.targetsize-80.png
-a----        8/28/2018  11:21 AM           4192 Square44x44Logo.targetsize-96.png
-a----        8/28/2018  11:21 AM           2415 Square71x71Logo.scale-100.png
-a----        8/28/2018  11:21 AM           2919 Square71x71Logo.scale-125.png
-a----        8/28/2018  11:21 AM           3689 Square71x71Logo.scale-150.png
-a----        8/28/2018  11:21 AM           4937 Square71x71Logo.scale-200.png
-a----        8/28/2018  11:21 AM           9154 Square71x71Logo.scale-400.png
-a----        8/28/2018  11:21 AM           2119 StoreLogo.png
-a----        8/28/2018  11:21 AM           4004 Wide310x150Logo.scale-100.png
-a----        8/28/2018  11:21 AM           5036 Wide310x150Logo.scale-125.png
-a----        8/28/2018  11:21 AM           6114 Wide310x150Logo.scale-150.png
-a----        8/28/2018  11:21 AM           8227 Wide310x150Logo.scale-200.png
-a----        8/28/2018  11:21 AM          17693 Wide310x150Logo.scale-400.png

我缺少什么/做错了什么?

2 个答案:

答案 0 :(得分:1)

我在适应性资产方面也遇到类似的问题。我正在使用electron-windows-store打包我的应用程序,但是它也抱怨文件不存在。原来有一个makepri.exe程序可以在makeappx.exe之前运行,并为makeappx.exe准备资产。

我不知道在手动运行程序时这是如何工作的,但是在配置中使用electron-windows-store设置makePri: true时,我可以使用自适应分辨率资产。在我的情况下,makepri.exe程序与Windows SDK一起下载,与makeappx.exe相同。

不幸的是,我找不到关于这些程序如何在Visual Studio之外工作的任何好的文档。

答案 1 :(得分:-1)

要转换Electron应用程序,您需要执行一个步骤来创建Windows可执行文件。在您的示例中,它不是真正的“桌面应用程序”:它只是一堆HTML和Javascript文件,您需要将其转换为真正的应用程序,然后才能使用桌面桥进行转换。您可以尝试通过博客转换您的电子应用程序:

https://blogs.msdn.microsoft.com/appconsult/2017/03/14/convert-your-electron-app-using-the-desktop-bridge/