首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >需要指导如何使用Visual 17将QT桌面应用程序打包为AppX格式

需要指导如何使用Visual 17将QT桌面应用程序打包为AppX格式
EN

Stack Overflow用户
提问于 2019-11-28 08:13:51
回答 1查看 218关注 0票数 0

我正在尝试为我的QT应用程序创建一个appx/appxupload包,以便它可以发布到Windows。下面列出了生成appx包所遵循的步骤:

  1. 在包含.pro文件的目录中使用qmake -tp vc命令使用QT .pro文件生成Visual项目文件。我在QT solution.
  2. Added
  3. 中使用了x86 msvc-2017工具包,使用Visual 2017版本15.9.10打开了.vcproj文件,并构建了该项目以检查是否有任何错误。
  4. 在同一Visual中添加了一个新的项目Windows应用程序打包项目(VisualC++)到同一个Visual中,该项目(现在转换为Visual项目)作为对Applications的引用,用于在我的新的project
  5. Added打包所有Visual资产中。在设计器模式下的应用程序名称和其他配置设置,然后构建project
  6. Package应用程序将其上载到Windows

当我试图安装和运行应用程序时,我收到一个错误消息:这个应用程序启动失败,因为它无法在“.”中找到或加载Qt平台插件"windows“。所有QT插件都存在于安装文件夹中,但是我的应用程序exe文件存在于安装目录中的另一个文件夹中,如AppName\AppName.exe。如果我将AppName.exe复制到AppName文件夹之外并运行,则应用程序运行良好。

我浏览了各种xml文件,并在应用程序部分看到,Executable = "AppName\AppName.exe"而不是Executable = AppName.exe。我相信有一个可以配置应用程序目标路径的配置设置。如果exe文件与所有其他QT文件的级别相同,则应用程序将运行良好,不会出现错误。

有人能帮忙解决这个问题吗?

谢谢

EN

回答 1

Stack Overflow用户

发布于 2019-11-28 08:59:48

Visual生成的Package.appxmanifest

代码语言:javascript
复制
<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>Images\StoreLogo.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="Images\Square150x150Logo.png" Square44x44Logo="Images\Square44x44Logo.png">
        <uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square310x310Logo="Images\LargeTile.png" Square71x71Logo="Images\SmallTile.png">
        </uap:DefaultTile>
        <uap:SplashScreen Image="Images\SplashScreen.png" />
      </uap:VisualElements>
    </Application>
  </Applications>
  <Capabilities>
    <Capability Name="internetClient" />
    <rescap:Capability Name="runFullTrust" />
  </Capabilities>
</Package>

这是在输出文件夹(bin/x86/Release/)中生成的AppxManifest.xml

代码语言:javascript
复制
<?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>Images\StoreLogo.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="AirMindThinker\AirMindThinker.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements DisplayName="AirMind Thinker" Description="AirMind Thinker Application" BackgroundColor="transparent" Square150x150Logo="Images\Square150x150Logo.png" Square44x44Logo="Images\Square44x44Logo.png">
        <uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square310x310Logo="Images\LargeTile.png" Square71x71Logo="Images\SmallTile.png"></uap:DefaultTile>
        <uap:SplashScreen Image="Images\SplashScreen.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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59084311

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档