Method 1:
In the packaging project, locate the "msiexec.exe" file (generally found in C: "Windows" SYSTEM32 (in the system directory ).
in the file system view, select the Program file, right-click msiexec.exe, and choose create shortcut ", rename the shortcut to "uninst ".
Change the shortcut argmuments to "/X {product ID}", and the value of the product ID is the productcode attribute value of the package project.
Method 2:
install and install the package, write down the proudctcode (select the solution Resource Management root directory, such as setup1, and then view the property tag, not the right-click attribute), which is used below
Create a new console uninst.exe file with vs. net.
Code is as follows:
Using system;
Namespace uninst
{
//
// Summary of class1.
//
class uninstall
{
//
// The main entry point of the application.
//
[stathread]
static void main (string [] ARGs)
{
string sysroot = system. environment. systemdirectory;
system. diagnostics. process. start (sysroot + "" msiexec.exe ","/X {850fed90-20d0-4eba-bedb-3d9dba25f6ec}/QR ");
}
}
}
After compilation, add the generated uninst.exe file to the installation package and regenerate the installation project.
From: http://www.cnblogs.com/jenry/articles/255343.html