fix: keep pilot automation host alive
This commit is contained in:
@@ -28,7 +28,16 @@ public partial class App : System.Windows.Application
|
|||||||
catch (Exception exception) { System.Windows.MessageBox.Show("Controlled local configuration blocked: " + exception.Message, "Launcher Next"); Shutdown(2); }
|
catch (Exception exception) { System.Windows.MessageBox.Show("Controlled local configuration blocked: " + exception.Message, "Launcher Next"); Shutdown(2); }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e.Args.FirstOrDefault()?.Equals("pilot", StringComparison.OrdinalIgnoreCase) == true) { Shutdown(await PilotCli.RunAsync(e.Args.Skip(1).ToArray())); return; }
|
if (e.Args.FirstOrDefault()?.Equals("pilot", StringComparison.OrdinalIgnoreCase) == true)
|
||||||
|
{
|
||||||
|
// A pilot command is asynchronous and owns no WPF window. Without an
|
||||||
|
// explicit shutdown mode the dispatcher may terminate at its first
|
||||||
|
// await, after the Preview child has been started but before Apply
|
||||||
|
// and its evidence/rollback boundary have run.
|
||||||
|
ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
|
||||||
|
Shutdown(await PilotCli.RunAsync(e.Args.Skip(1).ToArray()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
new MainWindow().Show();
|
new MainWindow().Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user