How to add uninstall option in .NET Setup Project?

主宰稳场 提交于 2019-12-06 22:29:07

问题


The .NET Setup project seems to have a lot of options, but I don't see an "Uninstall" option.

I'd prefer if people could "uninstall" from the standard "start menu" folder rather than send them to the control panel to uninstall my app, so can someone please tell me how to do this?

Also, I am aware of non Microsoft installers that have this feature, but if possible I'd like to stay with the Microsoft toolkit.


回答1:


You can make shortcut to:

msiexec /uninstall [path to msi or product code]



回答2:


Setup Projects have a "RemovePreviousVersons" feature that covers perhaps the most compelling use case for uninstall, but it keys off the "Product Code". See MSDN documentation. This "Product Code" doesn't seem to have been very well named, as it needs to be changed every time you update the Version number. In fact, VS2010 prompts you to do so. Unfortunately, neither the Product Code nor the Version number appears in the file properties of the generated .msi file.

This solution suffers from similar limitations with respect to maintainability as the prior suggestion that includes this same inscrutable Product Code in a hard-coded shortcut.

In reality, there don't seem to be any very attractive options here.




回答3:


Visual Studio 2013 allows you to create an Uninstall shortcut in the shortcut design page if you use the Installshield Add-on.



来源:https://stackoverflow.com/questions/61691/how-to-add-uninstall-option-in-net-setup-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!