Add following code in your Program.cs
static void Main()
{
string[] arguments = Environment.GetCommandLineArgs();
foreach (string argument in arguments)
{
if (argument.ToLower() == "/u")
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
Process proc = new Process();
proc.StartInfo.FileName = string.Concat(path, "\\msiexec.exe");
proc.StartInfo.Arguments = " /x {616898C6-C696-4803-B548-C10BC3AA4342}";
proc.Start();
return;
}
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
Replace {616898C6-C696-4803-B548-C10BC3AA4342} with your product code (you can find it in the properties of setup project, ProductCode field (do not mis it with the application assembly ProductCode, it wont work)
Now create Uninstall shortcut in the setup project to the project output and add /u argument.
Wednesday, February 20, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment