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 封裝工具的最新 Insider preview 組建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.
  • 移至 這裡 以判斷最新的 Insider preview 版本,並確認您已安裝該版本的 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 封裝工具驅動程式是以隨選功能的形式提供 (從 Windows Update FOD) 套件。The MSIX Packaging Tool driver is delivered as a Feature on Demand (FOD) package from Windows Update. 如果電腦上的 Windows Update 服務已停用,或 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 Services (WSUS) 、Configuration Manager 或影響 Windows Update 連線的群組原則Windows Server Update Service (WSUS), Configuration Manager, or group policies affecting Windows Update connectivity

下列錯誤碼可能表示電腦上的原則會影響 Windows Update 連線能力:-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.0MSIX 封裝工具版本來轉換現有的安裝程式,此工具就會強制執行 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>

使用服務 MSIXMSIX 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 封裝工具向下建立該 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 中指派適當的角色。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/資訊清單轉譯錯誤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 + FOpen 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.