. Net program package installation program in the preparation of the uninstall program

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.