Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create an uninstall link in start menu for a ClickOnce application

Clickonce creates only a link in the start menu to run the application. I also want to create an uninstall link when a user installs my C# application using ClickOnce, preferably in the same submenu and next to the link for launching the application. (I am aware that it can be done with Add/remove programs, but it is a hassle to go there for every small application)

Background : I have created a series of quantitative finance related calculators in my website, which are deployed using ClickOnce. The apps are for educational purpose, and user would want to remove it after a couple of days, or immediately if it was not what he was looking for. So I want to make uninstall easy

like image 671
paseena Avatar asked Feb 11 '11 18:02

paseena


2 Answers

ClickOnce won't add this shortcut for you. ClickOnce will create a shortcut to launch your app and a shortcut to your help url, that's it. If you want that shortcut created, you'll have to do it yourself in your app's code.

Basically, all you need to do is look in the registry at... HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\[Your app's key]\UninstallString

Creating a shortcut out of that value (rundll32.exe dfshim.dll...) will accomplish what you want. However, as PetPaulson pointed out in the comments, this shortcut won't be removed by the ClickOnce uninstall. It will remain in their start menu; not good.

That said, I personally don't think it's worth the effort. I really dislike apps that create all sorts of shortcuts (start menu, desktop, uninstall, etc) for me. Most people know how to use Add/Remove Programs. Just my personal preference, though.

like image 52
codeConcussion Avatar answered Nov 08 '22 00:11

codeConcussion


Microsoft discourages this in its directives. Uninstallers should be accessible primarily from the "Add/Remove programs" dialog.

like image 39
Matěj Zábský Avatar answered Nov 08 '22 01:11

Matěj Zábský