Skip to content

Instantly share code, notes, and snippets.

@turric4n
Last active November 11, 2022 13:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save turric4n/e28aba970103367f04231ca8e70ade63 to your computer and use it in GitHub Desktop.
Save turric4n/e28aba970103367f04231ca8e70ade63 to your computer and use it in GitHub Desktop.
Repair APPX can be removed or reinstalled

Repair Windows APPX apps with broken implementation

Most of time we have to fight with Centenial/Universal Apps that are an hybrid thing... Aren't real Windows desktop applications because these are orchestrated and managed like an Android Application or IOS.

Installation of this APPS is a nightmare and most of the time is broken or buggy. So take care about everything related next.

If everything is ok and nothing is broken this would be sufficient : Get-AppXPackage | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"

Else we have to hack this horrible and broken Windows feature (APPX repository)

Find broken APPX Get-AppxPackage (try to implement again or remove) will crash

First open elevate a CMD as SYSTEM -> PSEXEC -i -s -d CMD (Make sure PSEXEC into PATH ENV)

Open a SQLITE editor

Open next database file : C:\ProgramData\Microsoft\Windows\AppRepository\StateRepository-Machine.srd

DELETE FROM Package WHERE _PACKAGEID IN (SELECT _PACKAGEID FROM Package WHERE PACKAGEFULLNAME LIKE '%NAME%')

DELETE FROM Application WHERE _ApplicationID IN (SELECT _ApplicationID FROM Application WHERE ApplicationUserModelId LIKE '%NAME%')

Save changes into database

Locate folder where application binaries are located with Get-AppxDefaultVolume

Go to folder and Get-ChildItem | Where-Object {$_ -like "APP"} | Remove-Item -Force -Recurse

Go to store and try install again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment