mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 01:11:13 -06:00
SDA-3954 Avoid terminating C9Shell.exe during install
This commit is contained in:
parent
a29eec52bf
commit
58a44e6123
@ -13,7 +13,7 @@ namespace Symphony
|
|||||||
void dialog_Load(object sender, System.EventArgs e)
|
void dialog_Load(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
// Detect if Symphony is running
|
// 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 (isRunning)
|
||||||
{
|
{
|
||||||
// If it is running, disable the "next" button
|
// If it is running, disable the "next" button
|
||||||
|
@ -12,7 +12,7 @@ namespace Symphony
|
|||||||
private void MaintenanceDialog_Shown(object sender, System.EventArgs e)
|
private void MaintenanceDialog_Shown(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
// Detect if Symphony is running
|
// 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 (isRunning)
|
||||||
{
|
{
|
||||||
// If it is running, continue to the "Close Symphony" screen
|
// If it is running, continue to the "Close Symphony" screen
|
||||||
|
@ -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
|
// 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.
|
// 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("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.
|
// 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)
|
catch (System.ComponentModel.Win32Exception ex)
|
||||||
|
Loading…
Reference in New Issue
Block a user