Search code examples
uwpassetsdesktop-bridge

appxmanifest.xml for adaptive scaling assets


I am building a windows brdige app, and trying to include adaptive scaling assets for the tiles and such. However, when building the package, makeappx complains about non-existing files.

I use the following 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>

However, on running makeappx, i get the following errors:

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.

However, the assets directory does contain the files needed with the naming scheme as described in https://learn.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

What am I missing/doing wrong?


Solution

  • I was having similar problems with the adaptive assets. I am using electron-windows-store to package my app, but it was also complaining about non-existent files. Turns out there is a makepri.exe program that can run before makeappx.exe and it prepares the assets for makeappx.exe.

    I don't know exactly how this works when running the programs manually, but when using electron-windows-store setting makePri: true in the config allows me to use the adaptive resolution assets. In my case the makepri.exe program was downloaded along with the windows SDK, same folder as makeappx.exe.

    Unfortunately I couldn't find any good documentation on how these programs work outside of Visual Studio.