46

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?

Community
  • 1
  • 1
fostandy
  • 4,282
  • 4
  • 37
  • 41

4 Answers4

52

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

rundll32 dfshim CleanOnlineAppCache
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
eoghank
  • 1,013
  • 7
  • 10
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

Mr Heelis
  • 2,370
  • 4
  • 24
  • 34
  • 2
    Thanks for this info! Great to know! – fostandy May 05 '18 at 15:13
  • 4
    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! – ErrCode May 07 '18 at 09:42
  • 4
    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 :D – ErrCode Oct 03 '18 at 03:27
  • Worked seamlessly for me :) – David Jones Mar 21 '19 at 01:21
  • 1
    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. – gbarry Apr 01 '19 at 18:52
  • 1
    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. – Swampie Oct 02 '20 at 13:18
27

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

Nemo
  • 3,285
  • 1
  • 28
  • 22
  • 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! – Jeff Jul 23 '14 at 15:15
  • 1
    +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. – squillman Feb 27 '17 at 22:39
  • 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. – N. Kudryavtsev Nov 02 '17 at 13:57
  • If you cannot complete the step 2) since some files are being used, just kill their process from the CPU tab of resource monitor –  Apr 24 '21 at 13:21
0

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

You should also look inside manifests folder

  • 2
    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. – Uriel Katz Aug 09 '16 at 13:27