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?
If all else fails and you are desperate, like was my case (because the user was deleted) This one is a little dangerous but it worked for me.
DO AT YOUR OWN RISK! I knew that my user was the last user created on the machine.
This answer is a combination of Auri Rahimzadeh's answer above on TAKEOWN and intika's answer where you modify the StateRepository-Machine.srd using 'DB Browser For SQLite' (downloaded here: DB Browser for SQLite 3), the only difference is I only edited one thing: In PackageUser I changed the value User 3 (Which was the ID of the previous deleted User) to 4 (Which is me, the last created User)
BE SURE TO CHECK THE User Table AND SEE WHAT VALUES WORK IN YOUR CASE!
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:
There was an improvement in Windows 10 1709 to the remove-appxpackage cmdlet, adding -allusers as an option.
So, to uninstall an App for all users, this command works:
Where [PackageFamilyName] is generally the GUID of your package.
Caveat / Caution: The command seems to make re-installation (re-provisioning the package using DISM) later very difficult, as it seems to treat is as if each user individually uninstalled the app. Too much to get into here...
I had to do the following:
The key for me was to add the -allusers flag, since without it I received an "...because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed." error.
If that doesn't work, you can also try the following, which worked for me. Note that this is for my dev machine, not a regular user's machine, so I don't know how it would affect non-devs :-P
Take ownership of the folders c:\Program Files\WindowsApps and C:\ProgramData\Microsoft\Windows\AppRepository - giving Administrator full access. Make sure TrustedInstaller also has Modify rights as well. You're also taking ownership. If you're unawares, this is done via the Properties on that folder.
Go to Services and stop the Windows Installer service.
Open C:\ProgramData\Microsoft\Windows\AppRepository\ and delete the PackageRepository.edb file.
Start the Windows Installer service again.
Launch Visual Studio as Administrator.
Attempt to launch your app. It should work.
After you run the app once you should be able to run VS in user mode again.
There is a set of PowerShell cmdlets for managing Windows Store apps. You can list the installed apps on the machine for all the users if you run the following command as an administrator:
I haven't found a way to uninstall an app for a different user, though.
Remove-AppxPackage
works only for the current user. This makes everything even more interesting if you delete a user having apps installed. At least in prerelease versions of Windows 8 this made it impossible to delete an app he had installed. I managed to successfully avoid such a situation since final release therefore I can't confirm the problem is still present, i.e. apps aren't uninstalled when a user account is deleted.