mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
RunShortcut reliability changes
This commit is contained in:
parent
c9c9fcc8b4
commit
e4add2570f
@ -26,8 +26,8 @@ using System.Resources;
|
|||||||
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
||||||
|
|
||||||
// Version information
|
// Version information
|
||||||
[assembly: AssemblyVersion("2.1.0.282")]
|
[assembly: AssemblyVersion("2.1.0.285")]
|
||||||
[assembly: AssemblyFileVersion("2.1.0.282")]
|
[assembly: AssemblyFileVersion("2.1.0.285")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
||||||
[assembly: CLSCompliant(true)]
|
[assembly: CLSCompliant(true)]
|
||||||
|
|
||||||
|
@ -939,22 +939,25 @@ namespace DisplayMagician
|
|||||||
//processesCreated = ProcessUtils.StartProcess(processToStart.Executable, processToStart.Arguments, processToStart.ProcessPriority);
|
//processesCreated = ProcessUtils.StartProcess(processToStart.Executable, processToStart.Arguments, processToStart.ProcessPriority);
|
||||||
processesCreated = ProcessUtils.StartProcess(processToStart.Executable, processToStart.Arguments, processToStart.ProcessPriority);
|
processesCreated = ProcessUtils.StartProcess(processToStart.Executable, processToStart.Arguments, processToStart.ProcessPriority);
|
||||||
|
|
||||||
// Record the program we started so we can close it later
|
// Record the program we started so we can close it later (if we have any!)
|
||||||
if (processToStart.CloseOnFinish)
|
if (processesCreated.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (Process p in processesCreated)
|
if (processToStart.CloseOnFinish)
|
||||||
{
|
{
|
||||||
logger.Debug($"ShortcutRepository/RunShortcut: We need to stop {p.StartInfo.FileName} after the main game or executable is closed.");
|
foreach (Process p in processesCreated)
|
||||||
}
|
{
|
||||||
startProgramsToStop.AddRange(processesCreated);
|
logger.Debug($"ShortcutRepository/RunShortcut: We need to stop {p.StartInfo.FileName} after the main game or executable is closed.");
|
||||||
}
|
}
|
||||||
else
|
startProgramsToStop.AddRange(processesCreated);
|
||||||
{
|
|
||||||
foreach (Process p in processesCreated)
|
|
||||||
{
|
|
||||||
logger.Debug($"ShortcutRepository/RunShortcut: No need to stop {p.StartInfo.FileName} after the main game or executable is closed, so we'll just leave it running");
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
foreach (Process p in processesCreated)
|
||||||
|
{
|
||||||
|
logger.Debug($"ShortcutRepository/RunShortcut: No need to stop {p.StartInfo.FileName} after the main game or executable is closed, so we'll just leave it running");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Win32Exception ex)
|
catch (Win32Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user