需要有关使用 Visual Studio 17 将 QT 桌面应用程序打包为 AppX 格式的指导
Need guidance on packaging QT Desktop Application into AppX format using Visual Studio 17
我正在尝试为我的QT GUI应用程序创建一个appx/appxupload包,以便可以将其发布到Windows应用商店。以下是我生成 appx 包所遵循的步骤列表:
- 使用我的 QT .pro 文件生成一个 Visual Studio 项目文件,方法是在包含我的 .pro 文件的目录中使用qmake -tp vc命令。我在QT中使用了x86 msvc-2017套件
- 使用Visual Studio 2017,版本15.9.10打开.vcproj文件,并生成项目以检查是否有任何错误。
- 将一个新项目Windows 应用程序打包项目 (Visual C++(添加到同一个 Visual Studio 解决方案中。
- 添加了我的 QT 项目(现在转换为 Visual Studio 项目(作为对新打包项目中应用程序的引用
- 在设计器模式下添加了所有视觉对象资产、应用名称和其他配置设置,然后生成项目
- 打包应用程序以上载到 Windows 应用商店
当我尝试安装和运行该应用程序时,我收到一条错误消息:此应用程序无法启动,因为它无法在"中找到或加载Qt平台插件"windows"。所有QT插件都存在于安装文件夹中,但是我的应用程序exe文件存在于安装目录中的另一个文件夹中,例如AppName\AppName.exe。如果我将 AppName.exe复制到 AppName 文件夹外部并运行,则应用程序运行正常。
我浏览了各种 xml 文件,在应用程序部分下看到可执行文件 = "AppName\AppName.exe"而不是可执行文件 = AppName.exe。我相信有一个配置设置,可以在其中配置应用程序目标路径。如果 exe 文件与所有其他 QT dll 的文件处于同一级别,则应用程序将正常运行而不会出错。
有人可以帮助解决这个问题吗?
谢谢
Visual Studio 生成的Package.appxmanifest
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap">
<Identity Name="CybernetyxTechnikPvt.Ltd.AirMindThinker" Publisher="CN=FD00F14F-4E0A-4328-8B66-60A5777EDBFE" Version="1.0.24.0" />
<Properties>
<DisplayName>AirMind Thinker</DisplayName>
<PublisherDisplayName>Cybernetyx Technik Pvt. Ltd.</PublisherDisplayName>
<Logo>ImagesStoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements DisplayName="AirMind Thinker" Description="AirMind Thinker Application" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png" Square310x310Logo="ImagesLargeTile.png" Square71x71Logo="ImagesSmallTile.png">
</uap:DefaultTile>
<uap:SplashScreen Image="ImagesSplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
这是在输出文件夹 (bin/x86/Release/( 中生成的AppxManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap build" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build">
<!--
THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS.
Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file.
For more information on package manifest files, see http://go.microsoft.com/fwlink/?LinkID=241727
-->
<Identity Name="CybernetyxTechnikPvt.Ltd.AirMindThinker" Publisher="CN=FD00F14F-4E0A-4328-8B66-60A5777EDBFE" Version="1.0.24.0" ProcessorArchitecture="x86" />
<Properties>
<DisplayName>AirMind Thinker</DisplayName>
<PublisherDisplayName>Cybernetyx Technik Pvt. Ltd.</PublisherDisplayName>
<Logo>ImagesStoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.14393.0" MaxVersionTested="10.0.17763.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.17763.0" />
<PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.26905.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
</Dependencies>
<Resources>
<Resource Language="EN-US" />
</Resources>
<Applications>
<Application Id="App" Executable="AirMindThinkerAirMindThinker.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements DisplayName="AirMind Thinker" Description="AirMind Thinker Application" BackgroundColor="transparent" Square150x150Logo="ImagesSquare150x150Logo.png" Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png" Square310x310Logo="ImagesLargeTile.png" Square71x71Logo="ImagesSmallTile.png"></uap:DefaultTile>
<uap:SplashScreen Image="ImagesSplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
<build:Metadata>
<build:Item Name="Microsoft.Build.DesktopBridge.Tasks.dll" Version="4.6.30319.200" />
<build:Item Name="TargetFrameworkMoniker" Value=".NETCore,Version=v5.0" />
<build:Item Name="VisualStudio" Version="15.0" />
<build:Item Name="VisualStudioEdition" Value="Microsoft Visual Studio Community 2017" />
<build:Item Name="OperatingSystem" Version="10.0.18362.1 (WinBuild.160101.0800)" />
<build:Item Name="Microsoft.Build.AppxPackage.dll" Version="15.0.28307.104" />
<build:Item Name="ProjectGUID" Value="e995a5ab-e99d-4e1c-864d-a5fbbfc73ceb" />
<build:Item Name="MakePri.exe" Version="10.0.17763.132 (WinBuild.160101.0800)" />
</build:Metadata>
</Package>
相关文章:
- 试图在visual studio上用C++创建一个桌面应用程序
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- 在C应用程序中运行C++(带有STL)函数
- 使用VerQueryValue检索应用程序的文件描述
- Qt C++静态thread_local QNetworkAccessManager是线程应用程序的好选择吗
- 使用调试/崩溃报告将应用程序部署到客户端
- C++控制台应用程序阻止退出
- 码头化的C++应用程序是否向后兼容早期的内核版本
- 将应用程序从32位移植到64位时出现问题
- 如何改变c++应用程序的视觉效果
- WM_CTLCOLORSTATIC从未在WIN32应用程序中触发
- PC中的程序和PHONE中的本机描述应用程序之间的数据连接
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 示例外壳应用程序显示的 V8 "segmentation fault (core dumped)"错误
- phytec phyBOARD iMX-6在从闪存而不是SD卡运行qt5 opengles应用程序时表现不佳(FPS减半
- 为什么导入Mixed native/CLR lib.dll的本机C++应用程序没有在Mixed lib.dll中的外部变
- 如何从Windows应用程序输出到标准?
- C++应用程序 MySQL odbc 数据库连接错误:在引发"otl_tmpl_exception<>"实例后终止调用
- 如何在 64 位 vb.net Windows 应用程序中引用 32 位 dll
- 需要有关使用 Visual Studio 17 将 QT 桌面应用程序打包为 AppX 格式的指导