I have created a major upgrade (Installscript msi) which is running perfectly when executing by clicking on the exe file.
I am also creating a console aplication which runs the same exe but this time after installation, along with the new version, previous version is showing up in the add/remove programs list.
all components are installing correctly but
Why previous version is showing up only when I run the exe from console application?
// Enter the executable to run, including the complete path
start.FileName = @"folder1\MyISProj.exe";
// Do you want to show a console window?
start.CreateNoWindow = true;
start.WindowStyle = ProcessWindowStyle.Minimized;
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
// Run the external process & wait for it to finish
using (Process proc = Process.Start(start))
{
//proc.WaitForExit();
proc.Close();
}
One more thing I have observed is, when I call exe from console application the installer will open and after accepting EULA and etc, when actual installation start then the console application is getting called again. To stop this behavior I have added a check in Main method to run the console application only once. Now when installer try to run the console applicaiton again it will check whether the process is already running, if yes it just returns from the console application.
Process[] result = Process.GetProcesses();
foreach (var item in result)
{
if (item.ProcessName.Contains("MyISProj"))
{
Console.WriteLine("There is already a instance running.");
System.Environment.Exit(0);
return;
}
}
But after doing this also add/remove program list shows two entries. What I have to do to solve this issue? I am stuck with this issue.
I am using InstallShield 2011 professional edition to create exe.