How to include Uninstall MyProgram.exe in visual s

2019-07-27 12:04发布

问题:

I have developed a wpf application and created setup for that. I am using windows installer for creating setup package. Now I want to include uninstall MyProgram.exe in start menu after installing my package.
I am able to add the exe to run my program after installation. I want to include uninstall MyProgram.exe, ReadMe file, Help File in start menu.
Any suggestions plz help me regarding this. Thanks in advance, Ibrahim.

回答1:

did you have a look at this post? How to add uninstall option in .NET Setup Project?

You can create an uninstall shortcut and then add this shortcut to your start menu. the post below explains how to add a shortcut to user's desktop, you can get the idea and apply the same things for the start menu. desktop shortcut icon not showing in web setup project



回答2:

When you create installation package, it is assigned unique id (Product Code, if i'm not forgetting). You can create a batch file with following line:

  @echo off
  start /b /l msiexec.exe /x {Product Code}

Now right click on file system tree (in files view of project) and include this batch file. Assign it a nice icon and create entry "Uninstall " to start menu folder for your application.

ps:- just type msiexec.exe in run or cmd window to get more options. pps:- Product Code is available in properties of your setup project. Select Setup Project in solution tree and open properties tab.