MSIX 打包工具的已知问题和故障排除提示Known issues and troubleshooting tips for the MSIX Packaging Tool

本文描述使用 MSIX 打包工具将应用转换为 MSIX 时存在的已知问题,并提供故障排除提示供用户参考。This article describes known issues and provides troubleshooting tips to consider when converting your apps to MSIX using the MSIX Packaging Tool. 如果需要在 断开连接的环境中获取 .Msix 打包工具或驱动程序,请查看其他文档。Check out our other docs if you need to acquire the MSIX Packaging Tool or driver in a disconnected environments.

已知问题Known issues

获取 .MSIX 打包工具的最新预览版本Getting the latest Insider Preview build of the MSIX Packaging Tool

如果已选择加入我们的 预览体验计划,请确保具有正确版本的 .Msix 打包工具:If you have opted in to our Insider Program, make sure you have the correct version of the MSIX Packaging Tool:

  • 请参阅 .MSIX 打包工具中的 " 关于 " 部分,查看你所在的版本。Go to the About section in the MSIX Packaging Tool to view which version you are on.
  • 在此处 确定最新的有问必答预览版本,并确认已安装该版本的 .Msix 打包工具。Go here to determine the latest Insider Preview version, and confirm you have that version of the MSIX Packaging Tool installed.
  • 请确保注册了试验的 MSA 是登录到 Microsoft Store 的帐户。Make sure the MSA that's signed up for flighting is the account that is signed into the Microsoft Store.
  • 通过计算机上的 Microsoft Store 手动更新 .MSIX 打包工具。Manually update the MSIX Packaging Tool through the Microsoft Store on your computer. 如果此选项可供你使用,请打开应用商店,转到 " 下载" 和 "更新",然后单击 " 获取更新"。If this option if available to you, open the Store, go to Downloads and updates, and click Get updates. 或者,搜索 .MSIX 打包工具,然后在 "产品" 页上,您可以提示它进行更新。Alternatively, search for the MSIX Packaging Tool, and on the product page you can then prompt it for an update.
  • 若要安装 .MSIX 打包工具以供脱机使用,请按照 以下说明进行操作 ,以确保通过脱机过程获得最新的应用。To install the MSIX Packaging Tool for offline use, follow these instructions to ensure you get the latest app through our offline process.

如果你有兴趣加入我们的预览体验计划,请单击 此处If you are interested in joining our Insider Program, click here.

.MSIX 打包工具驱动程序MSIX Packaging Tool driver

.MSIX 打包工具驱动程序作为 点播 (FOD) 包的功能提供 Windows 更新。The MSIX Packaging Tool driver is delivered as a Feature on Demand (FOD) package from Windows Update. 如果在计算机上禁用 Windows 更新服务,或者如果 Windows 有问必答航班环设置与计算机的操作系统内部版本不匹配,则将无法安装它。It will fail to install if the Windows Update service is disabled on the computer or if Windows Insider flight ring settings do not match the OS build of the computer.

如果在获取驱动程序时遇到问题,或者正在脱机环境中工作,则可以在 此处找到下载驱动程序的链接。If you are running into problems acquiring the driver, or you are working in an offline environment, you can find links to download the driver here.

如果已下载驱动程序,并且在包转换过程中遇到问题,则可能是以下问题之一。If you have downloaded the driver and are running into issues during your package conversion, it may be one of the following issues.

网络连接问题Network connectivity issues

以下错误代码可能表示遇到连接问题:The following error codes might indicate that you are encountering connection issues:

  • -2145107924 (0x8024402c) -2145107924 (0x8024402c)
  • -2145107945 (0x80244017) -2145107945 (0x80244017)
  • -2145123272 (0x80240438) -2145123272 (0x80240438)

Windows Server Update 服务 (WSUS) 、Configuration Manager 或影响 Windows 更新连接的组策略Windows Server Update Service (WSUS), Configuration Manager, or group policies affecting Windows Update connectivity

以下错误代码可能表示计算机上的策略 Windows 更新连接:-2145124306 (0x8024002e) 。The following error code may indicate that policies on your computer are be affecting Windows Update connectivity: -2145124306 (0x8024002e).

如果你收到此错误代码,可能需要检查你的 环境设置和策略If you receive this error code, you may need to check your environment settings and policies.

驱动程序需要重新安装Driver required a reinstall

在这种情况下,.MSIX 打包工具会在错误消息中通知你,驱动程序需要重新启动。In this scenario, the MSIX Packaging Tool will notify you in the error message and logs that your driver needs a restart. 重新启动计算机,然后重新开始转换以解决此问题。Restart your computer and start your conversion again to fix this issue.

最低版本Minimum version

需要注意一些功能,这些功能会自动更改 .MSIX 包中的最小版本支持。There are a few features to be aware of that automatically change the minimun version support in your MSIX Package.

强制 Microsoft store 版本控制要求Enforce Microsoft store versioning requirements

如果使用早于1.2019.701.0.msix 打包工具版本转换现有的安装程序,则该工具将强制实施 Microsoft Store 版本控制要求,或使用其他工具创建未将最低版本设置为 10.0.16299.0 (Windows 10 版本 1709) 的包。If you convert your existing installer using a version of the MSIX Packaging Tool earlier than 1.2019.701.0, the tool had Enforce Microsoft Store versioning requirements on, or used another tool to create your package that did not set the minimum version to 10.0.16299.0 (Windows 10, version 1709). 将应用部署到 Windows 10 版本1709或更高版本时,这将导致错误消息。This will cause an error message when deploying your app to Windows 10, version 1709 or a later version.

若要解决此问题,请打开 .Msix 打包工具 并通过 包编辑器编辑应用。To fix this issue, open the MSIX Packaging Tool and edit your app through Package Editor. 打开清单并将元素的 MinVersion 属性设置 TargetDeviceFamily 为 "10.0.16299.0"。Open your manifest and set the MinVersion attribute of the TargetDeviceFamily element to "10.0.16299.0".

<Dependencies>
    <TargetDeviceFamily> Name="Windows.Desktop" MinVersion="10.0.16299.0" MaxVersionTested = "10.0.17763.0" />
</Dependencies>

.MSIX 服务MSIX with services

在 .MSIX 打包工具的1.2019.1220.0 版本中,我们添加了有关 使用服务创建 .msix 包的支持。In version 1.2019.1220.0 of the MSIX Packaging Tool, we added support for creating an MSIX package with Services. 由于服务支持的操作系统限制,.MSIX 打包工具会自动将 .MSIX 包支持的最低版本更改为10.0.19025.0。Due to the OS restrictions with services support, the MSIX Packaging Tool automatically changes the min version supported in an MSIX package with services to 10.0.19025.0. 这意味着,你不能在低于 Windows 10 版本2004的操作系统上安装 .MSIX 和服务,但你可以使用 .MSIX 打包工具向下创建 Windows 10 1809。This means that you cannot install an MSIX with services on an OS lower than the Windows 10 version 2004, but you can create that MSIX using the MSIX Packaging Tool down to Windows 10 1809. 如果需要在较低的操作系统上安装此应用,请相应地更新最小版本,但请注意,对服务的支持将不起作用。If you need to install this app on a lower OS, update the min version appropriately but note that support for services will not work.

框架和驱动程序Frameworks and drivers

如果应用需要框架,请确保在转换的监视阶段安装框架。If the app requires a framework, make sure the framework is installed during the monitoring phase of the conversion. 浏览日志以确保发生这种情况。Go through the logs to ensure this is happening. 如果你的应用程序需要安装驱动程序,则需要评估是否需要此驱动程序才能正常运行。If your app requires a driver to install, you need to evaluate whether this is required for your app to run properly. .MSIX 当前不支持驱动程序安装。MSIX currently does not support driver installation.

远程计算机Remote Machine

如果正在使用远程 VM 进行转换时遇到问题,请参阅 远程计算机转换的设置说明If you are running into issues with using a remote VM for your conversions, see Setup instructions for remote machine conversions.

转换过程中的问题Issues during conversion

  • 某些安装程序可能会转换失败并出现退出代码 259。Some installers might fail to convert with exit code 259. 这表示安装程序衍生了一个线程,但未等待该线程完成。This indicates that the installer spawned a thread and did not wait for it to complete. 换而言之,主线程已完成安装,但它衍生了一个仍在运行的线程,因此退出并返回了错误 259。In other words, the main thread finished installing but it exited with error 259 because it spawned a thread that is still running. 我们建议对 setup.exe 使用适当的安装选项。We recommend that you use the appropriate install option for setup.exe.

签名过程中的问题Issues during signing

错误的 PE 证书 (0x800700C1) Bad PE certificate (0x800700C1)

当包包含具有损坏证书的二进制文件时,会出现此问题。This problem occurs when the package contains a binary file that has a corrupt certificate. 若要解决此问题,请使用 dumpbin.exe /headers 命令转储文件头,并检查是否有错误的元素。To resolve this issue, use the dumpbin.exe /headers command to dump the file headers and inspect for bad elements. 手动重写标头以解决问题。Manually rewrite the headers to fix the issue. 通常,.MSIX 打包工具会自动检测错误的标头。In general, the MSIX Packaging tool automatically detects bad headers. 如果此问题仍然存在,请提供文件反馈。If this issue persists, file feedback. 可在此处找到详细信息。More information can be found here.

Device Guard 签名Device Guard signing

请确保按照下列 步骤 操作,并且要在 Microsoft Store for Business 中分配适当的角色。Make sure to follow these steps and that you are assigning the appropriate roles in the Microsoft Store for Business.

证书已过期Expired certificate

  • 在对包进行签名时使用时间戳。Use a timestamp when you sign your package.
  • 您可以使用有效的签名或时间戳证书来让步。You can resign with a valid sign or timestamp certificate.

您可以使用 批处理转换脚本来让步您的应用程序。You can resign your app using the batch conversion script.

疑难解答Troubleshooting

日志文件Log files

不管转换是否成功,每次转换都会生成日志文件。Whether or not your conversion was successful, log files are generated for every conversion. 可在以下位置找到这些日志文件:They can be found here:

%localappdata%\packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\DiagOutputDir\

将会写入故障代码,指示转换期间出现的任何故障点。Failure codes are written and indicate any point of failure during the conversion process. 错误代码易于理解。The error codes are meant to be user friendly.

来自远程设备或 VM 的日志文件Log files from remote devices or VMs

如果在远程设备或 VM 上执行转换,我们建议复制该设备提供的日志文件,并将其附加为反馈项的一部分。If the conversion is performed on a remote device or a VM, we recommend that you copy the log files from that device and attach them as part of the feedback item. 这有助于我们更有效地诊断和解决问题。This will help us diagnose and resolve issues more efficiently.

可在以下位置找到远程转换生成的日志:%localappdata%\packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\DiagOutputDir\<Logs_#>\RemoteServer\Log.txtYou will find the logs from the remote conversions here: %localappdata%\packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\DiagOutputDir\<Logs_#>\RemoteServer\Log.txt

如果你可以共享整个日志文件夹,该文件夹将包含本地客户端和远程服务器上发生的操作,则更有利。It would even more beneficial if you can share the whole Logs folder that will include the operations occurring on the local client as well the remote server.

常见问题Common problems

Makepri.exe/Manifest 转换错误MakePri/Manifest translation errors

当包的清单出现问题时,会出现此错误。This error occurs when there is an issue with the package’s manifest. 若要确定问题,请切换到 "包编辑器" 并打开清单。To identify the issue, go to Package Editor and open the manifest. 打开清单时,可以确定问题并提供正确的修补程序。When you open the manifest, you can identify the issue and provide the proper fix.

找不到文件File not found

该文件可以是打开的或不存在的。The file may either be open or non-existent. 若要解决此问题,请添加相应的文件或关闭当前正在使用的文件。To resolve this issue, add the appropriate file or close the file that is currently in use. 请注意, File not Found 如果它处于打开状态,则不会收到错误消息。Note that you will not get a File not Found error if it is open. 相反,您会收到 Access DeniedFile in Use 错误。Instead, you’ll get an Access Denied or File in Use error.

文件类型关联File Type Associations

有关文件类型关联 (FTA) 的问题随包的不同而异。The issues regarding File Type Associations (FTA) vary from package to package. .MSIX 打包工具支持双击安装的文件关联。MSIX Packaging Tool support file associations for double click installs. 例如,如果你的应用程序具有上下文菜单,则它不会自动添加,因此你需要将其手动添加到清单中。For example, if your app has context menu, it is not automatically added, so you will need to add it manually to the manifest. 有关示例,请参阅 desktop4: FileExplorerContextMenus 清单元素。See the desktop4:FileExplorerContextMenus manifest element for an example.

带参数的快捷方式Shortcuts with arguments

.MSIX 当前不支持具有参数的快捷方式。Shortcuts with arguments are not currently supported with MSIX. 如果检测到安装程序包含这些内容,则 .MSIX 将创建不带参数的磁贴。If we detect that the installer includes these, MSIX will create a tile with no arguments.

安装目录Install directory

这更常见的情况是使用辅助驱动器执行应用转换的用户。This is more common for those who use a secondary drive to perform app conversions. 如果选择更改安装位置,则会更改所有文件所在的根目录。If you choose to change the installation location, it changes the root of where all of the files go. 这意味着 .MSIX 打包工具需要知道所有这些文件的位置,并将在转换过程中捕获这些文件。This means that the MSIX Packaging tool will need to know where all these files go and will be captured during conversion.

你可以通过使用包支持框架写入来安装目录修补程序来解决此问题。You can fix this by using the Package Support Framework write to install directory fix. 默认情况下,我们已将此项作为功能添加到 .MSIX 工具中,这将导致1809。We have added this as a capability by default in the MSIX Tool, which allows this down to 1809. 如果你的应用程序在1709中不起作用,并且是1809,则这可能是个问题。If your application isn't working in 1709 and is in 1809, this is likely the issue.

发送反馈Sending feedback

发送反馈的最佳方式是通过 反馈中心The best way to send your feedback is through the Feedback Hub.

  1. 打开“反馈中心”或按 Windows 键 + F。****Open Feedback Hub or type Windows + F.
  2. 提供标题和必要的步骤以重现问题。Provide a title and necessary steps to reproduce the issue.
  3. 在“类别”下选择“应用”,然后选择“MSIX 打包工具”。************Under Category, select Apps and select MSIX Packaging Tool.
  4. 附加与转换相关的任何日志文件Attach any log files associated to the conversion. 可以在上面提供的文件夹中找到日志。You can find the logs in the folder provided above.
  5. 附加转换的 MSIX 包(如果可能)。Attach the converted MSIX package (if possible).
  6. 单击“提交” 。Click Submit.

也可以直接在 MSIX 打包工具中向我们发送反馈,方法是转到“设置”下的“反馈”选项卡。********You can also send us feedback directly from the MSIX Packaging Tool by going to the Feedback tab under Settings.

备注

可能需要等待 24 小时,我们才能收到你的反馈。It may take 24 hours for your feedback to get to us. 因此,如果使用 VM 来转换包,可能需要在转换后,持续打开 VM 并使其保持当前状态 24 小时。Therefore if you are using a VM to convert your package, you may want to keep your VM on and in its current state for 24 hours after conversion. 此外,还可以手动将转换日志附加到反馈。Also, you can manually attach conversion logs to the feedback.