Uninstall Click Once - All users
-
Monday, September 17, 2012 5:06 AM
Is there any way to uninstall, ClickOnce addin for all users on machine.
My requirement is to create Setup and deployment installer which will delete existing Clickonce addin for all users.
Is it possible to perform this ?
All Replies
-
Tuesday, September 18, 2012 5:42 AMModerator
Hi Banng,
Base on my understanding, ClickOnce applications are installed in apps/2.0 folder. You can go to the apps/2.0 folder to find out which folder contains the addin and delete it.
http://stackoverflow.com/questions/1266858/uninstall-click-once-clients
However ClickOnce is designed for per user, there may be some security problems to do this.
Best regards,
Chester Hong
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked As Answer by Chester HongMicrosoft Contingent Staff, Moderator Tuesday, October 02, 2012 8:16 AM
-
Tuesday, September 18, 2012 9:58 AM
Hi Chester Hong,
Thanks for the reply.
Yep. I had checked the above URL (stackoverflow).
To perform what mentioned in above URL through code (C#) seems difficult
Point 1:
Delete the deployed files. On my machine, the path to my ClickOnce deployed files is,%UserProfile%\AppData\Local\Apps\2.0. If you delete everything under this folder, it will delete allClickOnce applications. Obviously, you'd need to do this for each user profile..
Solution: Write the code to get all local users on machine, then for each user delete the folder %UserProfile%\AppData\Local\Apps\2.0
Point 2:
Now all that's left is an entry in Add/Remove programs. I think removing this is optional since it doesn't really hurt anything, but to get rid of it you can delete registry entries. Go through the users under HKEY_USERS and delete this key,Software\Microsoft\Windows\CurrentVersion\Uninstall\[random string associated with your app].
Solution:
Add code to delete registry entry against searched user in point 1.
All above activities could only be done by administrator only (I think).
But I wonder, is this a recommended way ?
I have not tried this.
-
Wednesday, September 19, 2012 7:32 AMModerator
Hi Banng,
Since ClickOnce is designed for per-user. It is not a recommended way. I think the goal of ClickOnce is to ensure that only the current user can control the application.
Because ClickOnce applications are inherently isolated, installing or running a ClickOnce application cannot break existing applications. ClickOnce applications are completely self-contained; each ClickOnce application is installed to and run from a secure per-user, per-application cache.
From MSDN document: http://msdn.microsoft.com/en-us/library/142dbbz4%28v=VS.80%29.aspx
Best regards,
Chester Hong
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


