C# 制作卸载文件

时间:2023-03-09 04:53:10
C# 制作卸载文件

1.建一个控制台应用程序Uninstall;

2.在应用程序的mian方法中添加

static void Main(string[] args)
{
System.Diagnostics.Process.Start("msiexec", "/X{110CC34D-8EB3-4135-875A-53DD46E7A17B}");
}

其中的 {110CC34D-8EB3-4135-875A-53DD46E7A17B}是打包项目的ProductCode

3.将Uninstall.exe添加到打包项目中即可