8

I have 2 accounts on my Win 10 Pro computer. One with and the other default without admin rights. I can with an non admin account install ClickOnce applications that I have created with Visual Studio 2016. That works.

But as soon as I try to uninstall the application from the non admin rights account, I am prompted to switch to the admin account. However the admin account does not know of this application so it crashes with some ARP error when trying to uninstall the app.

Catch 22!

So how do I solve this? Is there in Visual-studio some switch that controls this?

Peter Vogt
  • 353
  • 1
  • 4
  • 16
  • Under Windows 7 exactly the same application can be uninstalled by a non admin user without problems. This problem appears to apply only to Windows 10 – Peter Vogt Jan 16 '17 at 21:05

3 Answers3

11

The solution is to use the Control Panel to de-install the app.

There I have no problems removing an application that I as non admin user installed

Peter Vogt
  • 353
  • 1
  • 4
  • 16
4

Having experienced the same issue (2 years later), and not noticing the distinction between "Control Panel" and "Settings", I'd like to elaborate on Peter Vogt's own answer:

To uninstall a ClickOnce application without admin priviledges on Windows 10, use the old-style application list, now labeled as Programs and Features. Unfortunately, this can't be searched directly from the start menu, but it can be found in (at least) 2 places:

  • Directly from the old-style Control Panel, as "Uninstall a program".
  • From the new Settings -> Apps screen ("Apps & features"), use the "Programs and Features" link on the right.
blanne
  • 141
  • 1
  • 4
  • Note that the second way (Settings -> Apps -> Programs) is exactly the way the OP was complaining fails. As a non-admin user, install any ClickOnce-deployed app. Then go try to remove that app through Add/Remove Programs in System Settings. That takes you to what you've described above as the second option. Attempting to remove the app from there brings up a UAC dialog because it insists on elevation. If you refuse to elevate, it aborts, if you do elevate, it fails because the app doesn't exist for the admin user. If not an admin user, old-school Control Panel is the only way. – Jimbo1987 Dec 29 '21 at 17:17
  • @Jimbo1987 Sorry for the very late reply. Are you sure we're talking about the same? "Programs and Features" link in the bottom of the Settings -> Apps screen? It still takes me to the old control panel in Windows 10. And OP didn't actually specify where to find control panel, hence my answer. – blanne Mar 07 '22 at 12:37
  • Ahhh. Indeed we were not talking about the same thing. I was referring to the list of "Apps & Features" on the right-hand panel of "Settings -> Apps & features", whereas you were referring to the "Programs and Features" *link* that appears under the "Related Settings" heading below the list I was referring to. Indeed your link takes you to the old-school list that actually works. Thanks for clarifying. – Jimbo1987 Mar 08 '22 at 13:13
2

The workaround is to run the uninstaller directly, and not via Add or remove programs in Win10.

You can find the uninstaller command under the registry key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, search for the application's key, and grab the value of UninstallString. If you execute that command directly, the uninstaller will work as expected, without user right elevation.

The command you have to execute will look something like this:

rundll32.exe dfshim.dll,ShArpMaintain MyApp.application, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil

I'm sure this is some kind of Windows 10 issue as it works well on Windows 7.

deje
  • 81
  • 4
  • I agree. Uninstalling a ClickOnce application works just fine in Windows 7 but not in Windows 10. And manually uninstalling an app involves too many steps for non admin user – Peter Vogt Jan 27 '17 at 21:47
  • And it only askes for an admin password if I try to uninstall the app by clicking on "Windows Settings" >> System >> "Apps & features", find the app, and right click Uninstall. If I execute the rundll32.exe command directly it has no problems removing the app Is this a configuration issue of my non-admin user roles perhaps? – Peter Vogt Jan 28 '17 at 01:10
  • 5
    What is odd is that I can uninstall my app if I go via the "Control panel" >> "Uninstall a application" without problems. **Only** if I use the Settings window to uninstall my app am I asked to switch to an admin user. – Peter Vogt Jan 28 '17 at 04:55
  • 1
    @PeterVogt, I wonder if you ever solved this - especially since I have the exact same issue? I saw your post in the MS forums and I found the response you got rather sad. If elevated privileges really is necessary (counter intuitive since the Control panel approach works) it could be really useful to know exactly what element requires this - it could be a windows log entry or similar. – Chau Jan 18 '21 at 06:47