问题描述
我已使用Desktop App Converter将Win32应用程序转换为.appx
.
I have used the Desktop App Converter to convert my Win32 application to .appx
.
转换器无法正确转换应用程序图标.图标的透明度丢失.虽然我已将此问题(bug?)报告给Microsoft,但我想尝试手动转换图标.而且我还是想最终手动生成.appx
(使用makeappx
).所以我需要创建AppxManifest.xml
.
The converter failed to convert application icons correctly. Icon transparency was lost. While I have reported this (bug?) to Microsoft, meanwhile I'd like to try to convert the icons manually. And I want to generate the .appx
manually (using the makeappx
) in the end anyway. So I need to create the AppxManifest.xml
.
问题是由Desktop App Converter生成的AppxManifest.xml
无效.所有图像路径均指向不存在的文件:
Problem is that the AppxManifest.xml
generated by the Desktop App Converter is not valid. All image paths point to non-existing 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">
在Assets
文件夹中没有像AppStoreLogo.png
(等)这样的文件,有这样的文件:
There are no files like AppStoreLogo.png
(etc) in the Assets
folders, there are files like:
AppStoreLogo.scale-100.png
AppStoreLogo.scale-125.png
AppStoreLogo.scale-150.png
AppStoreLogo.scale-200.png
AppStoreLogo.scale-400.png
因此makeappx
无法使用生成的清单生成.appx
.
So the makeappx
fails to generate the .appx
using the generated manifest.
虽然我显然可以通过将路径指向图像的scale-100
变体来修复清单,但我认为这不是正确的方法.
While I can obviously fix the manifest by pointing the paths to the scale-100
variant of the images, I feel that this is not the correct way.
确定比例的图像是有原因的.
The scaled images are the for a reason, for sure.
我可以看到这些图像和比例尺相关元素:
I can see these image and scales related elements:
-
清单中有一个
<Resources>
元素,列出了所有刻度.
There's the
<Resources>
element in the manifest that lists all the scales.
也有resources.*.pri
个文件,它们引用缩放后的图像.
There are also resources.*.pri
files, which reference the scaled images.
resources.pri
resources.scale-100.pri
resources.scale-125.pri
resources.scale-150.pri
resources.scale-200.pri
但是我不明白这一切如何结合在一起. 我应该在清单中使用哪些路径来维护缩放后的图像?
But I do not understand how this all goes together. What paths should I use in the manifest to maintain the scaled images?
推荐答案
在makeappx
的早期版本中,这可能是一个小故障.
It was probably some glitch in earlier versions of makeappx
.
一年后再次尝试时,makeappx
现在可以编译由Desktop App Converter生成的AppxManifest.xml
,即使它似乎与以前一样.
When trying over a year later again, the makeappx
can now compile the AppxManifest.xml
generated by Desktop App Converter, even though it seems to be about the same as before.
(Desktop App Converter仍然无法正确生成应用程序图标).
这篇关于修复Destop App Converter生成的AppX清单中的缩放图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!