I have followed this article http://www.codeproject.com/useritems/DeployUninstall.asp
and created uninstaller for my setup project. However, I have translated it into C# from VB.net
my code is like this:
static void Main()
string arguments = Environment.GetCommandLine
foreach(string argument in arguments)
string parameters = argument.Split('=');
if (parameters.ToLower() == "/u")
string productCode = parameters;
string path = Environment.GetFolderPath(
Process proc = new Process();
proc.StartInfo.FileName = string.Concat(path,"\\msie
proc.StartInfo.Arguments = string.Concat(" /i ", productCode);
The uninstaller works ok and it unistalls my project. Only once issue here is that when I click uninstaller, it starts the application first and the uninstallation window comes second. I have put "Application.Run(new Form1());" code at last line (after uninstallation code), why it is still be executed? What can I do to avoid start the project and only uninstall it?
Thanks a lots!