您可以使用msiexec.exe。您可以简单地使用其product code. 使用命令您可以设置在卸载过程中是否显示 UI 或使其静默卸载,
string UninstallCommandString = "/x {0} /qn";
C# code
string UninstallCommandString = "/x {0} /qn";
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
process.StartInfo = startInfo;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardError = true;
startInfo.FileName = "msiexec.exe";
startInfo.Arguments = string.Format(UninstallCommandString, "Product Code");
process.Start();
Run Code Online (Sandbox Code Playgroud)