using System;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.Windows.Forms;
namespace Uninstall{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (args.Length == 1)
{
Program.Uninstall(args[0]);
}
}
private static void Uninstall(string productGuid)
{
try
{
Process p = new Process();
p.StartInfo.FileName = Path.Combine(Environment.SystemDirectory, "msiexec.exe");
p.StartInfo.Arguments = String.Format("/x {0}", productGuid);
p.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
|