對應用程式安裝程式檔案的安裝問題進行疑難排解Troubleshoot installation issues with the App Installer file

如果您從應用程式安裝程式檔案安裝應用程式時發現任何問題,本主題會提供一些可能有助益的疑難排解指引。If you find any issues when installing an application from the App Installer file, this topic will provide some troubleshooting guidance that may help.

必要條件Prerequisites

若要能夠在 Windows 10 中側載應用程式,使用者裝置必須符合以下需求:To be able to sideload apps in Windows 10, the user device must satisfy the next requirements:

  • 必須啟用裝置以使用開發人員模式或是側載應用程式。The device must be enabled for Developer Mode or Sideloading apps. 若要深入了解,請參閱啟用您的裝置以用於開發See Enable your device for development to learn more.
  • 用來簽署套件的憑證,必須受到裝置信任。The certificate used to sign the package must be trusted by the device. 如需詳細資訊,請參閱以下的<驗證憑證>一節。See the Trusted certificates section below for more details.
  • Windows 10 版本必須支援 .appinstaller 檔案結構描述和散發通訊協定。The Windows 10 version must support the .appinstaller file schema and the distribution protocol.

常見問題Common issues

第一次在使用者電腦中側載應用程式時有一些常見問題。There are some common issues when sideloading an application for first time in the user machine. 接下來的幾個章節描述最常見的問題和其解決方案。The next few sections describe the most frequent issues and their solutions.

Windows 版本Windows version

每個 Windows 10 版本改善側載體驗,在下表您會找到每個主要版本中可用的功能。Each Windows 10 release improves on the sideloading experience, in the table below you will find which features are available in each major release. 如果您嘗試使用 Windows 10 版本中不支援的方法側載應用程式,會發生部署錯誤。If you try to sideload an app using a method not supported in your version of Windows 10, you will get a deployment error.

版本Version 側載附註Sideload Notes
組建 17134 (2018 年4月更新版本 1803) Build 17134 (April 2018 Update, version 1803) 可以透過 UNC/共用資料夾存取 .appinstaller 檔案。The .appinstaller file can be accessed over UNC/Share folders. 也會提供可設定的更新檢查。Configurable update checks are also available.
組建 16299 (Fall Creators Update,版本 1709)Build 16299 (Fall Creators Update, version 1709) 導入了.appinstaller檔案以提供應用程式的自動更新。Introduced the .appinstaller file to provide automatic updates to your app. 此版本僅支援 HTTP 端點。This version only supports HTTP endpoints. 更新檢查不可以設定,而且每隔 24 小時發生一次。Update checks are not configurable and happens each 24 hours.
組建 15063 (Creators Update,版本 1703)Build 15063 (Creators Update, version 1703) 應用程式安裝程式應用程式可以從 Microsoft Store 下載 app 相依性(只能在發行模式)。The App Installer app is able to download app dependencies (only in release mode) from the Store.
組建 14393 (年度更新版,版本 1607)Build 14393 (Anniversary Update, version 1607) 導入了應用程式安裝程式應用程式以安裝.appx 和.appxbundle 檔案,.appinstaller 檔案不受支援。Introduced the App Installer app to install .appx and .appxbundle files, .appinstaller file is not supported.
組建 10586 (11 月更新,版本 1511)Build 10586 (November Update, version 1511) 透過 PowerShell 使用Add-AppxPackage命令,才可以側載。Sideload is only available through PowerShell using the Add-AppxPackage command.
Build 10240 (Windows 10,版本 1507)Build 10240 (Windows 10, version 1507) 透過 PowerShell 使用Add-AppxPackage命令,才可以側載。Sideload is only available through PowerShell using the Add-AppxPackage command.

受信任的憑證Trusted certificates

應用程式套件必須使用裝置信任的憑證進行簽署。App packages must be signed with a certificate that is trusted by the device. 一般憑證授權單位單位所提供的憑證,在 Windows 作業系統中預設是受信任的。Certificates provided by common Certificate Authorities are trusted by default in the Windows operating system.

但是,如果用來簽署應用程式套件的憑證不受信任,或者是在開發期間使用的本機產生/自我簽署的憑證,則應用程式安裝程式可能會報告套件未受信任,而且會防止其安裝:However, if the certificate used to sign an app package is not trusted, or is a locally-generated/self-signed certificate used during development, the app installer may report that the package is untrusted and will prevent it from being installed:

MSIX 已簽署,但缺少憑證或未受信任的憑證

若要解決此問題,具有裝置之本機系統管理員許可權的使用者必須使用 [ 電腦憑證 ] 工具,將憑證匯入下列其中一個容器:To solve this issue, a user with local administrator rights to the device must use the Computer Certificates tool to import the certificate into one of the following containers:

  1. 本機電腦:信任的人Local Computer: Trusted People
  2. 本機電腦:不建議使用受信任的根授權單位 () Local Computer: Trusted Root Authorities (not recommended)

重要

請勿將套件簽署憑證匯入使用者憑證存放區Do not import package signing certificates into the User Certificate store. 當驗證套件身分識別時,應用程式安裝程式不會搜尋使用者憑證。The App Installer does not search User Certificates when verifying package identity.

從 [開始] 功能表搜尋,即可輕鬆找到電腦憑證管理工具:The Computer Certificates management tool can be easily found by searching from the Start Menu:

透過 [開始] 功能表尋找 [本機電腦憑證] 工具

成功匯入簽署憑證之後,重新執行應用程式安裝程式會顯示該套件已受信任且可以安裝:Once the signing certificate is successfully imported, re-running the app installer will show that the package is trusted and can be installed:

使用受信任憑證簽署的 MSIX

未安裝相依性Dependencies not installed

Windows 10 的應用程式可以根據用來產生應用程式的應用程式平臺來建立架構相依性。Windows 10 applications can have framework dependencies based on the application platform used to generate the app. 如果您使用 C# 或 VB,app 會需要 .NET 執行階段和 .NET Framework 套件。If you are using C# or VB, the app will require the .NET Runtime and .NET framework packages. C++ 應用程式需要 VCLibs。C++ applications require the VCLibs.

重要

如果在發行模式設定中建置應用程式套件,將會從 Microsoft Store 取得架構相依性。If the app package is built in Release mode configuration, the framework dependencies will be obtained from the Microsoft Store. 不過,如果在偵錯模式設定中建置應用程式,將會從.appinstaller檔案中指定的位置取得相依性。However, if the app is built in Debug mode configuration, the dependencies will be obtained from the location specified in the .appinstaller file.

不可存取檔案Files not accessible

從 HTTP 端點安裝時,請務必確認所有檔案都是正確的 MIME 類型、可供存取。When installing from an HTTP endpoint, it is important to verify that all files are accessible with the correct MIME type. 確認這些檔案最簡單的方法是追蹤 Visual Studio 所產生 HTML 網頁中的連結。The easiest method to verify these files is by following the links provided in the HTML page generated by Visual Studio. 您必須檢查這些檔案︰You must check these files:

  • .appinstaller 檔案,提供為 application/xml.appinstaller file, available as an application/xml
  • .appx 和檔案 .appxbundle ,提供為 application/vns.ms-appx.appx and .appxbundle files, available as application/vns.ms-appx

找出應用程式安裝程式應用程式問題Isolate App Installer app issues

如果應用程式安裝程式無法安裝應用程式,這些步驟將有助於找出安裝問題。If the App Installer cannot install the app, these steps will help identify the installation issue.

確認應用程式套件檔案安裝Verify app package file installation

  • 將應用程式套件檔案下載至本機資料夾,並嘗試使用 Add-appxpackage PowerShell 命令進行安裝。Download the app package file to a local folder and try to install it using the Add-AppxPackage PowerShell command.

  • 下載.appinstaller檔案到本機資料夾,然後使用Add-AppxPackage -Appinstaller PowerShell 命令嘗試安裝它。Download the .appinstaller file to a local folder and try to install it using the Add-AppxPackage -Appinstaller PowerShell command.

應用程式安裝程式事件記錄檔App Installer event logs

應用程式部署基礎結構會發出記錄,這些記錄通常有助於透過 Windows 事件檢視器來偵測安裝問題: Application and Services Logs -> Microsoft -> Windows -> AppxDeployment-ServerThe app deployment infrastructure emits logs that are often useful for debugging installation issues via the Windows Event Viewer: Application and Services Logs -> Microsoft -> Windows -> AppxDeployment-Server