(Solved) Deployment Failed when Installing APPX Package

When using the  Add-AppxPackage PowerShell cmdlet to upgrade/install apps on the Microsoft Store, you can receive the “Add-AppxPackage Deployment failed with HRESULT” error message during the process. This error occurs due to corrupted files that prevent the installation from occurring.

Powershell shows "Add-AppxPackage Deployment failed with HRESULT"
PowerShell shows “Add-AppxPackage Deployment failed with HRESULT” Fix

This guide will show you how to fix the “Add-AppxPackage Deployment failed with HRESULT” error.

Workaround: Perform a System Restart

When facing an error with the Windows PowerShell, then performing a simple system restart can be a quick fix. Therefore, as a workaround, you must restart your computer. This way, all the processes, and programs will boot properly and prevent the error from occurring. You can perform the system restart with the step listed below:

  1. Open the Windows Start Menu by pressing the Win key.
  2. Click on the Power option and Restart your computer by clicking on the “Restart” option.
    Restarting the Windows computer
    Restarting the Windows computer

1. Run the Windows Store Troubleshooter

Troubleshooter is a built-in feature in Windows. This feature enables your system to detect the problems that cause certain errors to occur on your device. Therefore, you must run the Windows Store Troubleshooter to detect and repair the error. The Windows Store Troubleshooter can be performed as follows:

  1. Open the Windows Settings by pressing the Win + I keys together.
  2. Navigate to System > Troubleshooter.
  3. Scroll down and click on the “Windows Store App” option at the end.
  4. Run the Windows Store Troubleshooter by clicking on the “Run the troubleshooter” option.
    Running the Windows Store troubleshooter
    Running the Windows Store troubleshooter
  5. After the problems have been detected, choose the solution as per your choice (For example resetting the Windows Store App to fix the issue).
    Resetting the Windows Store
    Resetting the Windows Store

2. Disable the StartMenuExperienceHost EXE File

Although the StartMenyExperienceHost EXE File is used for managing the Windows Start Menu, it is known to interfere with PowerShell commands. Therefore, you must disable this file before running the command at fault in PowerShell. With the steps below, you can disable the StartMenyExperienceHost EXE File:

  1. Open the Windows Start Menu by pressing the Win key.
  2. Type “PowerShell” in the search box.
  3. Right-click on it and select the “Run as an administrator” option.

    Running Powershell as an administrator
    Running Powershell as an administrator
  4. Now, copy and paste the following command into the PowerShell and press the Enter key:
    Powershell -ExecutionPolicy Unrestricted
  5. Right-click on the Windows Start Menu and select the “Task Manager” option.
    Opening the Task Manager
    Opening the Task Manager
  6. Click on the “Details” tab and look for the StartMenyExperienceHost EXE File.
  7. Open its file location by right-clicking on it and selecting the “Open file location” option. 
    Opening the file location
    Opening the file location
  8. Right-click on the EXE file and select the “Cut” option.
    Cutting the EXE file
    Cutting the EXE file
  9. Paste the file into a different Folder by pressing the Ctrl + V keys together.
  10. Right-click on the Windows Start Menu and select the “Task Manager” option.
    Opening the Task Manager
    Opening the Task Manager
  11. Right-click on the EXE file and select the “End task” option.
    Ending the task
    Ending the task
  12. Type the command at fault into PowerShell and press the Enter key.
    WARNING: After the command has been completed, you must paste the EXE file back to its default folder where you copied it from. If you are unable to do so, your entire Start Menu and Taskbar will break.

Check to see if the issue is resolved or not.

3. Run the System Scans

System file corruption is one of the major causes of this error. It prevents certain actions to be performed by the programs. Therefore, to make sure this doesn’t happen, you must run System Scans that will detect and repair the error found in the system files. Following the steps below, you will see how to repair damaged files through system scans:

  1. Open the Windows Start Menu by pressing the Win key.
  2. Type “cmd” in the Windows Search bar.
  3. Run the command prompt as an administrator by right-clicking on it and selecting the”Run as an administrator” option. 
    Running the Command Prompt as an administrator
    Running the Command Prompt as an administrator.
  4. Type the following command in the Command Prompt while giving a space between “sfc” and “/.”
    sfc /scannow
    Running system file checker on the command prompt.
    Running system file checker on the command prompt.
  5. the file checker automatically repairs the damaged files after scanning. 
Note: After the System File Checker has scanned the damaged files, you must run the DISM Command. Follow the steps below to run the DISM Command: 
  1. Paste the following command into the command prompt and press the Enter key to perform the DISM scan:
    Dism.exe /online /cleanup-image /restorehealth
    Running DISM Command on the Command Prompt
    Running DISM Command on the Command Prompt
  2. Restart your computer and make the necessary changes. 

4. Update your Windows

An outdated Windows prevents certain programs from executing properly. It can also be a leading factor in the occurrence of this error. Therefore, you must keep your Windows updated to prevent such errors from taking place.  Follow the instructions given below to update your Windows to the latest version: 

  1. Open the Windows Settings by pressing the Win + I keys together.
  2. Navigate to Update and Security > Windows Update.
  3. Click on the “Check for Updates” option.

    Checking an available Windows Update
    Checking an available Windows Update
  4. After the Windows update is found, download it by clicking on the Download option on the page. 
  5. Restart your system to make the necessary changes. 
Note: If Windows fails to find an update for your system automatically, you can manually download the latest update for your Windows. With the steps listed below, you can manually update Windows to the latest version:
  1. Go to the Official Microsoft Web Page.
  2. Download the latest Windows Update by clicking on the “Update Now” option.

    Downloading the Latest Windows Update
    Downloading the Latest Windows Update
  3. Install the update by clicking on the “Update Now” option on the Windows Update Assistant page.

    Installing Windows Update
    Installing Windows Update
  4.  After the installation is completed, restart the computer by clicking on the Restart option.

    Restarting the Computer
    Restarting the Computer

5. Run the System on Safe Mode

If the error still persists, then you must run the system on Safe Mode. After booting the system on Safe Mode, your system will start with a minimal set of drivers and default programs. You can run the system on Safe Mode as shown below:

  1. Open the Run Command by pressing the Win + R keys together.
  2. Type “msconfig” in the search box and click OK to open System Configuration.

    Opening System Configuration
    Opening System Configuration
  3. Open the Boot tab and check the “Safe Mode” box.
  4. Click on “Minimal” under Safe Mode.
  5. Set the timer as per your choice and Click Apply and OK.
    Booting System on Safe Mode
    Booting System on Safe Mode
  6. Restart your computer by selecting the “Restart” option on the System Configuration Prompt.
    Restarting computer
    Restarting computer
  7. Once the system is booted into Safe Mode, you must run the PowerShell.
  8. Open the Windows Start Menu by pressing the Win key.
  9. Type “PowerShell” in the search box.
  10. Right-click on it and select the “Run as an administrator” option.

    Running Powershell as an administrator
    Running Powershell as an administrator
  11. Now, type the command that was facing the error, for example:
    $manifest = (Get-AppxPackage Microsoft.WindowsStore).InstallLocation + '\AppxManifest.xml' ; Add-AppxPackage -DisableDevelopmentMode -Register $manifest)
Note: If the error doesn’t occur in Safe Mode, follow the method below.

6. Use In-Place Upgrade

In-Place Upgrade is a tool that allows you to upgrade your Windows while still keeping your files and other data intact. As a last resort, you must use In-Place Upgrade to repair command-line errors.

Disclaimer: Although this tool doesn’t affect your data, you must have a backup copy of your data. Therefore, perform this method as a last resort.
  1. Open the Official Microsoft Website.
  2. Download the tool by clicking on the “Download  Now” option under “Create Windows 10 installation media.”
    Downloading the tool
    Downloading the tool
  3. Select the folder you want to download the file from and select the Save option. 
    Saving the file in the folder
    Saving the file in the folder
  4. Click on the Three dots at the top right part of the browser and open the Downloads page.
    Opening the Downloads tab
    Opening the Downloads tab
  5. Locate the file by clicking on the” Show in Folder” option. 
    Opening the EXE file location
    Opening the EXE file location
  6.  Open the EXE file by right-clicking on it and selecting the “Open” option. 
    Opening the EXE File
    Opening the EXE File
  7. Click “YES” on the User Account Control Prompt to confirm the actions.
  8. Accept the terms and conditions by clicking on the “Accept” option. 
    Accepting the terms and conditions
    Accepting the terms and conditions
  9. Select the “Upgrade this PC Now” option on the “What do you want to do now” page.
    Upgrading this PC now
    Upgrading this PC now
  10. Install the Setup by clicking on the “Install” option. 
    Installing the tool
    Installing the tool
  11. Select your sign-in account after the installation.
  12. Choose the privacy settings for your device and click on the “Accept” option. 
    Choosing Privacy Settings for your device
    Choosing Privacy Settings for your device
  13. Use Cortana by clicking on the “Use Cortana” option.
    Using Cortana
    Using Cortana
  14. This will open the Windows Sign-in Screen. 
ABOUT THE AUTHOR

Muhammad Zubyan


Muhammad Zubyan is a certified Google IT Support Professional with over 7 years of extensive experience. He has worked on more than 1500 computers, gaining valuable insights that enable him to detect and troubleshoot any complicated root cause of Windows-related issues and errors. In addition to managing Appuals as a Senior Editor, he is currently developing his own Game Optimization program that caters to both gamers and casual users alike.