Capturing scaled images in the AppX manifest generated by Destop App Converter

I used the Desktop App Converter to convert my Win32 application to .appx.

The converter was unable to correctly convert application icons. The transparency icon has been lost. Although I reported this (bug?) To Microsoft, in the meantime I would like to try converting the icons manually. And I want to generate .appxmanually (using makeappx) in the end anyway. Therefore, I need to create AppxManifest.xml.


The problem is that the AppxManifest.xmlgenerated Desktop App Converter is not valid. All image paths point to non-existent files:

<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">
  ...
  <Properties>
    ...
    <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>
  ...
  <Applications>
    <Application Id="WinSCP" Executable="WinSCP.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements DisplayName="WinSCP" Description="WinSCP" BackgroundColor="transparent" Square150x150Logo="Assets\AppMedTile.png" Square44x44Logo="Assets\AppList.png">
        <uap:DefaultTile Wide310x150Logo="Assets\AppWideTile.png" Square310x310Logo="Assets\AppLargeTile.png" Square71x71Logo="Assets\AppSmallTile.png">

In folders Assetsof files such as AppStoreLogo.png(etc.), there are such files as:

AppStoreLogo.scale-100.png
AppStoreLogo.scale-125.png
AppStoreLogo.scale-150.png
AppStoreLogo.scale-200.png
AppStoreLogo.scale-400.png

, makeappx .appx .

, , , scale-100 , , .

, .


:

  • <Resources> , .

  • resources.*.pri, .

    resources.pri
    resources.scale-100.pri
    resources.scale-125.pri
    resources.scale-150.pri
    resources.scale-200.pri
    

, . ?

+4
4

, makeappx.

makeappx AppxManifest.xml Desktop App Converter, , , , .


(Desktop App Converter - ).

0

.PRI, . makepri, .PRI XML .

0

WinSCP AppX Advanced Installer.

, . .

, , . ( VM, )

:

enter image description here

enter image description here

appx, . , .

To get the contents of the PRI, you need to run the command: makepri.exe dump

Here is the contents of resources.pri.xml from the new package:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PriInfo>
	<ResourceMap name="MartinPrikryl.WinSCP" version="1.0" primary="true">
		<Qualifiers>
			<AlternateForm>UNPLATED</AlternateForm>
			<Scale>100,125,150,200,400</Scale>
			<TargetSize>256,48</TargetSize>
		</Qualifiers>
		<ResourceMapSubtree name="Files">
			<ResourceMapSubtree name="Assets">
				<NamedResource name="Store50x50Logo.png" uri="ms-resource://MartinPrikryl.WinSCP/Files/Assets/Store50x50Logo.png">
					<Candidate qualifiers="Scale-400" isDefault="true" type="Path">
						<Value>Assets\Store50x50Logo.scale-400.png</Value>
					</Candidate>
					<Candidate qualifiers="Scale-200" isDefault="true" type="Path">
						<Value>Assets\Store50x50Logo.scale-200.png</Value>
					</Candidate>
					<Candidate qualifiers="Scale-150" isDefault="true" type="Path">
						<Value>Assets\Store50x50Logo.scale-150.png</Value>
					</Candidate>
					<Candidate qualifiers="Scale-125" isDefault="true" type="Path">
						<Value>Assets\Store50x50Logo.scale-125.png</Value>
					</Candidate>
					<Candidate qualifiers="Scale-100" isDefault="true" type="Path">
						<Value>Assets\Store50x50Logo.scale-100.png</Value>
					</Candidate>
				</NamedResource>
				<NamedResource name="WinSCPSquare150x150Logo.png" uri="ms-resource://MartinPrikryl.WinSCP/Files/Assets/WinSCPSquare150x150Logo.png">
					<Candidate qualifiers="Scale-125" isDefault="true" type="Path">
						<Value>Assets\WinSCPSquare150x150Logo.scale-125.png</Value>
					</Candidate>
				</NamedResource>
				<NamedResource name="WinSCPSquare310x310Logo.png" uri="ms-resource://MartinPrikryl.WinSCP/Files/Assets/WinSCPSquare310x310Logo.png">
					<Candidate qualifiers="Scale-100" isDefault="true" type="Path">
						<Value>Assets\WinSCPSquare310x310Logo.scale-100.png</Value>
					</Candidate>
				</NamedResource>
				<NamedResource name="WinSCPSquare44x44Logo.png" uri="ms-resource://MartinPrikryl.WinSCP/Files/Assets/WinSCPSquare44x44Logo.png">
					<Candidate qualifiers="TargetSize-48" isDefault="true" type="Path">
						<Value>Assets\WinSCPSquare44x44Logo.targetsize-48.png</Value>
					</Candidate>
					<Candidate qualifiers="TargetSize-256, AlternateForm-UNPLATED" type="Path">
						<Value>Assets\WinSCPSquare44x44Logo.targetsize-256_altform-unplated.png</Value>
					</Candidate>
				</NamedResource>
				<NamedResource name="WinSCPSquare71x71Logo.png" uri="ms-resource://MartinPrikryl.WinSCP/Files/Assets/WinSCPSquare71x71Logo.png">
					<Candidate qualifiers="Scale-100" isDefault="true" type="Path">
						<Value>Assets\WinSCPSquare71x71Logo.scale-100.png</Value>
					</Candidate>
				</NamedResource>
				<NamedResource name="WinSCPWide310x150Logo.png" uri="ms-resource://MartinPrikryl.WinSCP/Files/Assets/WinSCPWide310x150Logo.png">
					<Candidate qualifiers="Scale-100" isDefault="true" type="Path">
						<Value>Assets\WinSCPWide310x150Logo.scale-100.png</Value>
					</Candidate>
				</NamedResource>
			</ResourceMapSubtree>
		</ResourceMapSubtree>
	</ResourceMap>
</PriInfo>
Run code

Here is the manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" IgnorableNamespaces="uap rescap" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
  <Identity Name="MartinPrikryl.WinSCP" ProcessorArchitecture="x64" Publisher="CN=Caphyon-sha2, OU=AdvancedInstaller, O=Caphyon, E=support@caphyon.net" Version="5.9.3.7136"/>
  <Applications>
    <Application Id="WinSCP" Executable="VFS\ProgramFilesX86\WinSCP\WinSCP.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements DisplayName="WinSCP" Description="WinSCP" BackgroundColor="transparent" Square150x150Logo="Assets\WinSCPSquare150x150Logo.png" Square44x44Logo="Assets\WinSCPSquare44x44Logo.png">
        <uap:InitialRotationPreference>
          <uap:Rotation Preference="portrait"/>
          <uap:Rotation Preference="landscape"/>
        </uap:InitialRotationPreference>
        <uap:DefaultTile Square310x310Logo="Assets\WinSCPSquare310x310Logo.png" Square71x71Logo="Assets\WinSCPSquare71x71Logo.png" Wide310x150Logo="Assets\WinSCPWide310x150Logo.png"/>
      </uap:VisualElements>
    </Application>
  </Applications>
  <Resources>
    <Resource Language="en-US"/>
  </Resources>
  <Capabilities>
    <rescap:Capability Name="runFullTrust"/>
  </Capabilities>
  <Properties>
    <DisplayName>WinSCP</DisplayName>
    <PublisherDisplayName>Martin Prikryl</PublisherDisplayName>
    <Logo>Assets\Store50x50Logo.png</Logo>
  </Properties>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0"/>
  </Dependencies>
</Package>
Run code
-1
source

Source: https://habr.com/ru/post/1669391/


All Articles