Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall an app that another user installed?

I keep hitting this problem when I try to debug my Windows 8 apps and there is a copy already installed on another user account:

DEP0700 : Registration of the app failed. Another user has already installed a packaged version of this app. An unpackaged version cannot replace this. The conflicting package is {{{PackageName}}} and it was published by CN={{{Certificate Stuff}}}. (0x80073cf9)

Sometimes I can just log in or ask someone else to log in to the machine and uninstall the app. Alternatively I can change the application name/id, but one is not always possible and the other is risky (I don't want to check in the changed application id to source control).

There must be some way to uninstall it. Maybe a PowerShell script?

like image 215
Filip Skakun Avatar asked Dec 13 '12 18:12

Filip Skakun


People also ask

How do I uninstall a program from another user?

If so, you can try to use PowerShell Commands "Get-AppxPackage" to check the program info and then use "Remove-AppxPackage -Package -AllUsers" to uninstall it. I have tested it on my own Windows 10, after login with another user, command "Remove-AppxPackage -Package ” will report “Package was not found”.

Does uninstalling a program remove it for all users?

Yes it will remove the program for all accounts.

Can we restrict a user from uninstalling an app?

If you want to block users from uninstalling specific apps, scroll down to General. Then, simply lock the respective app(s). Once the app locked, users won't be able to launch it or uninstall it.


1 Answers

My process above still works, but it simply gets around a race condition issue, where Windows Update (yes, oddly enough) is in charge of wiping out "staged packages."

According to Microsoft, the "other fix" - and I still consider this issue to be a bug - is:

Cause of the problem:

Windows Update (WU) downloads newer versions of packages you have and “stages” them as Local System, so that when you go to the store to update the apps, the update process is as quick as possible. WU will eventually clean up the staged packages that were never installed.

What are some consequences of having "Staged" packages?

  1. Staged packages prevent you from installing that particular package in development mode

  2. Staged packages eat up some disk space, but due to hardlinking, the effect of this is mitigated. If a file is identical between multiple versions of a package, appx deployment hardlinks the files instead of maintaining two separate copies of the same file.

How do I find the "Staged" packages?

  1. In an administrator powershell prompt, the command:

    get-appxpackage -all

will display all packages on the machine. For a staged package, the PackageUserInformation will show {S-1-5-18 [Unknown user]: Staged} 2. Using powershell filtering, to get the list of all staged packagefullnames, you could do:

get-appxpackage -all |% {if ($_.packageuserinformation.installstate -eq "Staged"){$_.packagefullname}} 

How do I get rid of the "Staged" packages?

  1. Download psexec from sysinternals tools, written by Mark Russinovich

  2. To get rid of all of them, run in a regular admin/elevated command prompt (not powershell):

psexec -s powershell -c "get-appxpackage | remove-appxpackage"

like image 80
Auri Rahimzadeh Avatar answered Sep 21 '22 16:09

Auri Rahimzadeh