SDA-3954 Avoid terminating C9Shell.exe during install

This commit is contained in:
Robin Westberg 2022-11-11 08:51:46 +01:00 committed by Salah Benmoussati
parent a29eec52bf
commit 58a44e6123
3 changed files with 2 additions and 16 deletions

View File

@ -13,7 +13,7 @@ namespace Symphony
void dialog_Load(object sender, System.EventArgs e)
{
// Detect if Symphony is running
bool isRunning = (System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1 || System.Diagnostics.Process.GetProcessesByName("C9Shell").Length >= 1);
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1;
if (isRunning)
{
// If it is running, disable the "next" button

View File

@ -12,7 +12,7 @@ namespace Symphony
private void MaintenanceDialog_Shown(object sender, System.EventArgs e)
{
// Detect if Symphony is running
bool isRunning = (System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1 || System.Diagnostics.Process.GetProcessesByName("C9Shell").Length >= 1);
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1;
if (isRunning)
{
// If it is running, continue to the "Close Symphony" screen

View File

@ -110,7 +110,6 @@ class Script
// instruct the installer to not send a Close message, but instead send the EndSession message, and we have a custom event
// handler in the SDA code which listens for this message, and ensures app termination when it is received.
new CloseApplication("Symphony.exe", false) { EndSessionMessage = true },
new CloseApplication("C9Shell.exe", false) { EndSessionMessage = true }
);
// The build script which calls the wix# builder, will be run from a command environment which has %SYMVER% set.
@ -289,19 +288,6 @@ class Script
}
}
});
// The embedded C9 Shell should terminate when the parent window is closed, but it doesn't always work. So we'll just force it to exit
System.Diagnostics.Process.GetProcessesByName("C9Shell").ForEach(p =>
{
if (System.IO.Path.GetFileName(p.MainModule.FileName) == "C9Shell.exe")
{
if (!p.HasExited)
{
p.Kill();
p.WaitForExit();
}
}
});
}
}
catch (System.ComponentModel.Win32Exception ex)