How do I completely uninstall a ClickOnce application from my computer?
Asked Answered
R

4

48

While experimenting with trying to publish both a Foo and Foo Beta version of my application via ClickOnce I managed to clobber the existing and previously-working-fine Foo 1.0.0 install (replacing it with Foo Beta 1.0.5, which does not work) due to using the same GUID, assembly name, product name or something.

OK, honest mistake. In an attempt to revert this I then uninstalled Foo Beta using the Windows 7 add/remove programs.

My computer is now in a state where no instance of Foo shows up in Windows 7 Add/Remove programs. However, Foo Beta is still shown as installed. In addition, I am unable to re-install Foo 1.0.0, because it thinks that a newer version of the program (Foo Beta 1.0.5) already exists on my computer - instead I get the `Unable to install because a newer version of this product is already installed' message.

How can I get my computer to a state where neither Foo nor Foo Beta have ever been installed on it, so that I can then go and re-install Foo?

So far I have read Stack Overflow questions Uninstall ClickOnce clients and How can I remove all traces of a ClickOnce application from a customer's computer? and tried:

  1. Deleting all the relevant foo.exe directories under %USERPROFILE%/
  2. Running mage.exe -cc
  3. Editing the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall and removing the entry for my Foo program.

When I run the installer, I still get the error. Where is it finding traces of my program from? And for future reference, where is this documented?

Reader answered 5/6, 2012 at 11:8 Comment(0)
E
55

You can try using this command to clear the ClickOnce cache:

rundll32 dfshim CleanOnlineAppCache
Equilateral answered 6/6, 2012 at 13:29 Comment(3)
Isn't that equivalent to "mage.exe -cc"?Peregrine
Excellent. Worked great for me.Gibby
On my win7 box mage.exe doesn't show up in the standard path, but this worked for me.Presentday
D
35

DO IT THE OLD WAY! :D

use the "old" control panel to remove the Click Once app and re-install it. Do not use the "new " Windows Ten/2016 interface

EG this is GOOD and will remove Click Once:

Start => type
Control Panel\Programs\Programs and Features

enter image description here

EG this is BAD and will get you in a circular hell if you use it to remove Click Once:

Start => Run =>
ms-settings:

enter image description here

Drice answered 17/4, 2018 at 14:32 Comment(6)
Thanks for this info! Great to know!Reader
In case this helps anyone - I tried to uninstall a ClickOnce VSTO addin via the new Windows 10 interface, and it prompted for administrator credentials (the account it was installed on is not an administrator, so had to give separate administrator login credentials). After the admin login prompt, the uninstall fails with: Exception: Attempting to uninstall a customization that has not been installed on this computer or has already been uninstalled from this computer. Please correct the parameter values and try again. Using good old Control Panel, I successfully uninstalled the addin!Placable
This really deserves more upvotes when uninstalling ClickOnce on Windows 10! Just came across this problem again having long forgotten this workaround. Fortunately a Google search got me back to this answer :DPlacable
Worked seamlessly for me :)Sheldon
Holy mackerel, Windows is scary. I don't even know what my app is considered to be. It's just what comes out when I "publish" from Visual Studio. But this removed it, without complaint.Trippet
Worked for us when we had errors saying: "Error occurred during store lookup, component store may have been corrupted. Following failure messages were detected: + Application is not installed. * Error occurred during uninstall of the application. Following failure messages were detected: + Application is not installed." Couldn't uninstall the ClickOnce app, and couldn't install it again either. That was until we followed the instructions to remove it the 'old' way.Cola
S
29

1) Run rundll32 %SystemRoot%\system32\dfshim.dll CleanOnlineAppCache

2) You might have to manually delete the ClickOnce deployment folders,

  • On Windows Vista or higher, this will be the %LocalAppData%\Apps\2.0 directory.
  • On Windows XP this will be the %USERPROFILE%\Local Settings\Apps\2.0 directory.

3) You might also have to logout and login back

Sanctum answered 1/7, 2014 at 14:3 Comment(4)
BTW--I had to do this and then after the files were deleted do the rundll32 dfshim CleanOnlineAppCache noted above. (In that order) Only then did it work for me. +1 to both of you!Presentday
+1 I couldn't delete the entire 2.0 folder because of having several other ClickOnce apps installed, but deleting the folders relative to my app under there and also under the ...2.0\manifests folder did work.Window
ClickOnce also stores some information in registry (see Uriel Katz's comment to Oleksandr Matviienko's answer) so deletion of Apps\2.0 directory is not a complete app uninstallation. The first method, rundll32 dfshim CleanOnlineAppCache, works good and clears registry too.Athos
If you cannot complete the step 2) since some files are being used, just kill their process from the CPU tab of resource monitorAveril
L
0

Deleting all the relevant foo.exe directories under %USERPROFILE%/

You should also look inside manifests folder

Linkman answered 26/2, 2016 at 13:5 Comment(1)
If you plan to do it manually you need: 1. Remove Uninstall key 2. Look under here and remove all things related to your app (and subcomponents!): HKEY_CLASSES_ROOT\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0 HKEY_CURRENT_USER\SOFTWARE\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0 3. Under %LocalAppData%\Apps\2.0 look in Data and the obfuscated names folder for all the things that are relevant to your app, manifests too This removes it enough that an install doesn't fail so it is probably enough.Yukikoyukio

© 2022 - 2024 — McMap. All rights reserved.